Skip to content

A free open source IT asset/license management system

Better handling for show/hide columns in depreciation report

snipeb0b7cfa99999
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">
<thead>
<tr role="row">
- <th class="col-sm-1">{{ trans('admin/companies/table.title') }}</th>
+ <th class="col-sm-1" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
+ <th class="col-sm-1" data-visible="false">{{ trans('admin/categories/general.category_name') }}</th>
<th class="col-sm-1">{{ trans('admin/hardware/table.asset_tag') }}</th>
<th class="col-sm-1">{{ trans('admin/hardware/table.title') }}</th>
@if (\App\Models\Setting::getSettings()->display_asset_name)
@@ -48,6 +49,12 @@
@foreach ($assets as $asset)
<tr>
<td>{{ is_null($asset->company) ? '' : $asset->company->name }}</td>
+ <td>
+ @if ($asset->model)
+ {{ $asset->model->category->name }}
+ @endif
+
+ </td>
<td>
@if ($asset->deleted_at!='')
<del>{{ $asset->asset_tag }}</del>
@@ -68,7 +75,7 @@
</td>
<td>
@if ($asset->model->depreciation)
- {{ $asset->model->depreciation->months }}
+ {{ $asset->model->depreciation->months }}
@endif
</td>
<td>