Skip to content

A free open source IT asset/license management system

Add depreciation name and months to depreciation report

snipe7ee13113e0e5
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index 2df5d4b2d7..ceca7d1f01 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')
+ $assets = Asset::with('model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog', 'company', 'depreciation')
->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 79a5b6654b..6df80209d5 100644
--- a/resources/views/reports/depreciation.blade.php
+++ b/resources/views/reports/depreciation.blade.php
@@ -32,6 +32,8 @@
<th class="col-sm-1">{{ trans('general.name') }}</th>
@endif
<th class="col-sm-1">{{ trans('admin/hardware/table.serial') }}</th>
+ <th class="col-sm-1">{{ trans('admin/depreciations/general.depreciation_name') }}</th>
+ <th class="col-sm-1">{{ trans('admin/depreciations/general.number_of_months') }}</th>
<th class="col-sm-1">{{ trans('admin/hardware/table.checkoutto') }}</th>
<th class="col-sm-1">{{ trans('admin/hardware/table.location') }}</th>
<th class="col-sm-1">{{ trans('admin/hardware/table.purchase_date') }}</th>
@@ -59,6 +61,16 @@
<td>{{ $asset->name }}</td>
@endif
<td>{{ $asset->serial }}</td>
+ <td>
+ @if ($asset->model->depreciation)
+ {{ $asset->model->depreciation->name }}
+ @endif
+ </td>
+ <td>
+ @if ($asset->model->depreciation)
+ {{ $asset->model->depreciation->months }}
+ @endif
+ </td>
<td>
@if ($asset->assigneduser)
@if ($asset->assigneduser->deleted_at!='')