Skip to content

Commit

Permalink
Merge pull request #734 from snipe/depreciation_fix2
Browse files Browse the repository at this point in the history
Fix to issue with depreciation not returning correct value
  • Loading branch information
snipe committed Apr 8, 2015
2 parents 30966b1 + 551b5c4 commit 9de083a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/Depreciable.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getDepreciatedValue()
}

// fraction of value left
$months_remaining = $this->time_until_depreciated()->m + $this->time_until_depreciated()->y; //UGlY
$months_remaining = $this->time_until_depreciated()->m + 12*$this->time_until_depreciated()->y; //UGlY
$current_value = round(($months_remaining/ $this->get_depreciation()->months) * $this->purchase_cost, 2);

if ($current_value < 0) {
Expand Down

0 comments on commit 9de083a

Please sign in to comment.