Fixed deprecations
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
077a6949e2
commit
3531256c3f
2 changed files with 8 additions and 4 deletions
|
@ -568,7 +568,7 @@ class Asset extends Depreciable
|
||||||
*/
|
*/
|
||||||
public function assignedType()
|
public function assignedType()
|
||||||
{
|
{
|
||||||
return strtolower(class_basename($this->assigned_type));
|
return $this->assigned_type ? strtolower(class_basename($this->assigned_type)) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,10 +173,14 @@ class Depreciable extends SnipeModel
|
||||||
|
|
||||||
public function depreciated_date()
|
public function depreciated_date()
|
||||||
{
|
{
|
||||||
|
if (($this->purchase_date) && ($this->get_depreciation())) {
|
||||||
$date = date_create($this->purchase_date);
|
$date = date_create($this->purchase_date);
|
||||||
date_add($date, date_interval_create_from_date_string($this->get_depreciation()->months.' months'));
|
|
||||||
|
|
||||||
return $date; //date_format($date, 'Y-m-d'); //don't bake-in format, for internationalization
|
return date_add($date, date_interval_create_from_date_string($this->get_depreciation()->months.' months'));//date_format($date, 'Y-m-d'); //don't bake-in format, for internationalization
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// it's necessary for unit tests
|
// it's necessary for unit tests
|
||||||
|
|
Loading…
Add table
Reference in a new issue