mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
cleaned up calculateDepreciation method
This commit is contained in:
parent
5bb47e290f
commit
ffaacc04ef
|
@ -188,16 +188,16 @@ class Depreciable extends SnipeModel
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue