From b0b7cfa9999903d1ac946b7126d8eedddde0cb1d Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 18 May 2016 16:06:29 -0700 Subject: [PATCH] Better handling for show/hide columns in depreciation report --- app/Http/Controllers/ReportsController.php | 2 +- resources/views/reports/depreciation.blade.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index ceca7d1f01..2df5d4b2d7 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -232,7 +232,7 @@ class ReportsController extends Controller { // Grab all the assets - $assets = Asset::with('model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog', 'company', 'depreciation') + $assets = Asset::with('model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog', 'company') ->orderBy('created_at', 'DESC')->get(); return View::make('reports/depreciation', compact('assets')); diff --git a/resources/views/reports/depreciation.blade.php b/resources/views/reports/depreciation.blade.php index 6df80209d5..8607d7da31 100644 --- a/resources/views/reports/depreciation.blade.php +++ b/resources/views/reports/depreciation.blade.php @@ -25,7 +25,8 @@ data-cookie-id-table="depreciationReportTable"> - {{ trans('admin/companies/table.title') }} + {{ trans('admin/companies/table.title') }} + {{ trans('admin/categories/general.category_name') }} {{ trans('admin/hardware/table.asset_tag') }} {{ trans('admin/hardware/table.title') }} @if (\App\Models\Setting::getSettings()->display_asset_name) @@ -48,6 +49,12 @@ @foreach ($assets as $asset) {{ is_null($asset->company) ? '' : $asset->company->name }} + + @if ($asset->model) + {{ $asset->model->category->name }} + @endif + + @if ($asset->deleted_at!='') {{ $asset->asset_tag }} @@ -68,7 +75,7 @@ @if ($asset->model->depreciation) - {{ $asset->model->depreciation->months }} + {{ $asset->model->depreciation->months }} @endif