diff --git a/app/models/Asset.php b/app/models/Asset.php index 31765690c7..a750980550 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -21,7 +21,7 @@ class Asset extends Elegant { public function depreciate() { $depreciation_id = Model::find($this->model_id)->depreciation_id; - if (isset($depreciation_id)) { + if ($depreciation_id) { $depreciation_term = Depreciation::find($depreciation_id)->months; if($depreciation_term>0) { diff --git a/app/views/backend/reports/index.blade.php b/app/views/backend/reports/index.blade.php index 7b3615ed1c..8c64de28ad 100644 --- a/app/views/backend/reports/index.blade.php +++ b/app/views/backend/reports/index.blade.php @@ -19,7 +19,7 @@ Depreciation Report @@ -66,9 +66,17 @@ Depreciation Report @endif {{ $asset->purchase_date }} + + @if ($asset->purchase_cost > 0) ${{ number_format($asset->purchase_cost) }} ${{ number_format($asset->depreciate()) }} -${{ number_format(($asset->purchase_cost - $asset->depreciate())) }} + @else + + + + @endif + @endforeach