Add depreciation name and months to depreciation report

This commit is contained in:
snipe 2016-05-18 15:59:54 -07:00
parent 0568e979e8
commit 7ee13113e0
2 changed files with 13 additions and 1 deletions

View file

@ -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'));

View file

@ -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!='')