Skip to content

Commit

Permalink
cleaned up calculateDepreciation method
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Jul 17, 2024
1 parent 5bb47e2 commit ffaacc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Models/Depreciable.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,16 @@ protected function getDateTime($time = null)
{
return new \DateTime($time);
}
private function calculateDepreciation(){
$depreciation_min = 0;

private function calculateDepreciation()
{
if($this->get_depreciation()->depreciation_type === 'percent') {
$depreciation_percent= $this->get_depreciation()->depreciation_min / 100;
$depreciation_min= $this->purchase_cost * $depreciation_percent;
return $depreciation_min;
}
else{
$depreciation_min = $this->get_depreciation()->depreciation_min;
return $depreciation_min;
}

$depreciation_min = $this->get_depreciation()->depreciation_min;
return $depreciation_min;
}
}

0 comments on commit ffaacc0

Please sign in to comment.