mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -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);
|
return new \DateTime($time);
|
||||||
}
|
}
|
||||||
private function calculateDepreciation(){
|
|
||||||
$depreciation_min = 0;
|
private function calculateDepreciation()
|
||||||
|
{
|
||||||
if($this->get_depreciation()->depreciation_type === 'percent') {
|
if($this->get_depreciation()->depreciation_type === 'percent') {
|
||||||
$depreciation_percent= $this->get_depreciation()->depreciation_min / 100;
|
$depreciation_percent= $this->get_depreciation()->depreciation_min / 100;
|
||||||
$depreciation_min= $this->purchase_cost * $depreciation_percent;
|
$depreciation_min= $this->purchase_cost * $depreciation_percent;
|
||||||
return $depreciation_min;
|
return $depreciation_min;
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
$depreciation_min = $this->get_depreciation()->depreciation_min;
|
$depreciation_min = $this->get_depreciation()->depreciation_min;
|
||||||
return $depreciation_min;
|
return $depreciation_min;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue