Codestyle fix

This commit is contained in:
Minaev Dmitriy 2018-08-26 18:47:35 +03:00
parent 40dd34b5bf
commit a77b8c2023

View file

@ -52,10 +52,6 @@ class Depreciable extends SnipeModel
$depreciation = 0; $depreciation = 0;
$setting = Setting::first(); $setting = Setting::first();
switch($setting->depreciation_method) { switch($setting->depreciation_method) {
case 'defalut':
$depreciation = $this->getLinearDepreciatedValue();
break;
case 'half_1': case 'half_1':
$depreciation = $this->getHalfYearDepreciatedValue(true); $depreciation = $this->getHalfYearDepreciatedValue(true);
break; break;
@ -63,6 +59,9 @@ class Depreciable extends SnipeModel
case 'half_2': case 'half_2':
$depreciation = $this->getHalfYearDepreciatedValue(false); $depreciation = $this->getHalfYearDepreciatedValue(false);
break; break;
default:
$depreciation = $this->getLinearDepreciatedValue();
} }
return $depreciation; return $depreciation;
} }
@ -99,11 +98,9 @@ class Depreciable extends SnipeModel
if( $onlyHalfFirstYear ) { if( $onlyHalfFirstYear ) {
$yearsPast -= 0.5; $yearsPast -= 0.5;
} }
else { else if( !$this->is_first_half_of_year($purchase_date) ) {
if( !$this->is_first_half_of_year($purchase_date) ) {
$yearsPast -= 0.5; $yearsPast -= 0.5;
} }
}
if( !$this->is_first_half_of_year($current_date) ) { if( !$this->is_first_half_of_year($current_date) ) {
$yearsPast += 0.5; $yearsPast += 0.5;
} }