mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-30 07:59:50 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
d26bc19e3f
|
@ -68,7 +68,7 @@ class Depreciable extends SnipeModel
|
|||
*/
|
||||
public function getLinearDepreciatedValue() // TODO - for testing it might be nice to have an optional $relative_to param here, defaulted to 'now'
|
||||
{
|
||||
if ($this->purchase_date) {
|
||||
if (($this->get_depreciation()) && ($this->purchase_date)) {
|
||||
$months_passed = ($this->purchase_date->diff(now())->m)+($this->purchase_date->diff(now())->y*12);
|
||||
} else {
|
||||
return null;
|
||||
|
|
Loading…
Reference in a new issue