From a77b8c202316780fcec0614fd60dea293dca5630 Mon Sep 17 00:00:00 2001 From: Minaev Dmitriy Date: Sun, 26 Aug 2018 18:47:35 +0300 Subject: [PATCH] Codestyle fix --- app/Models/Depreciable.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/Models/Depreciable.php b/app/Models/Depreciable.php index bcdd599040..1ed80fdcb2 100644 --- a/app/Models/Depreciable.php +++ b/app/Models/Depreciable.php @@ -52,10 +52,6 @@ class Depreciable extends SnipeModel $depreciation = 0; $setting = Setting::first(); switch($setting->depreciation_method) { - case 'defalut': - $depreciation = $this->getLinearDepreciatedValue(); - break; - case 'half_1': $depreciation = $this->getHalfYearDepreciatedValue(true); break; @@ -63,6 +59,9 @@ class Depreciable extends SnipeModel case 'half_2': $depreciation = $this->getHalfYearDepreciatedValue(false); break; + + default: + $depreciation = $this->getLinearDepreciatedValue(); } return $depreciation; } @@ -99,10 +98,8 @@ class Depreciable extends SnipeModel if( $onlyHalfFirstYear ) { $yearsPast -= 0.5; } - else { - if( !$this->is_first_half_of_year($purchase_date) ) { - $yearsPast -= 0.5; - } + else if( !$this->is_first_half_of_year($purchase_date) ) { + $yearsPast -= 0.5; } if( !$this->is_first_half_of_year($current_date) ) { $yearsPast += 0.5;