Added default location/address to custom report

This commit is contained in:
snipe 2018-04-05 17:33:25 -07:00
parent c1838a60df
commit 2253439940
2 changed files with 47 additions and 7 deletions

View file

@ -503,6 +503,19 @@ class ReportsController extends Controller
$header[] = trans('general.zip'); $header[] = trans('general.zip');
} }
if ($request->has('rtd_location')) {
$header[] = trans('admin/hardware/form.default_location');
}
if ($request->has('rtd_location_address')) {
$header[] = trans('general.address');
$header[] = trans('general.address');
$header[] = trans('general.city');
$header[] = trans('general.state');
$header[] = trans('general.country');
$header[] = trans('general.zip');
}
if ($request->has('assigned_to')) { if ($request->has('assigned_to')) {
$header[] = trans('admin/hardware/table.checkoutto'); $header[] = trans('admin/hardware/table.checkoutto');
$header[] = trans('general.type'); $header[] = trans('general.type');
@ -671,12 +684,25 @@ class ReportsController extends Controller
} }
if ($request->has('location_address')) { if ($request->has('location_address')) {
$row[] = ($asset->location) ? $asset->location->address : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->address : '';
$row[] = ($asset->location) ? $asset->location->address2 : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->address2 : '';
$row[] = ($asset->location) ? $asset->location->city : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->city : '';
$row[] = ($asset->location) ? $asset->location->state : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->state : '';
$row[] = ($asset->location) ? $asset->location->country : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->country : '';
$row[] = ($asset->location) ? $asset->location->zip : ''; $row[] = ($asset->defaultLoc) ? $asset->defaultLoc->zip : '';
}
if ($request->has('rtd_location')) {
$row[] = ($asset->location) ? $asset->defaultLoc->present()->name() : '';
}
if ($request->has('rtd_location_address')) {
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->address : '';
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->address2 : '';
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->city : '';
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->state : '';
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->country : '';
$row[] = ($asset->defaultLoc) ? $asset->defaultLoc->zip : '';
} }

View file

@ -118,9 +118,23 @@
<div class="checkbox col-md-12"> <div class="checkbox col-md-12">
<label> <label>
{{ Form::checkbox('location_address', '1', '1', ['class' => 'minimal']) }} {{ Form::checkbox('location_address', '1', '1', ['class' => 'minimal']) }}
{{ trans('general.address') }} - {{ trans('general.address') }}
</label> </label>
</div> </div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('rtd_location', '1', '1', ['class' => 'minimal']) }}
{{ trans('admin/hardware/form.default_location') }}
</label>
</div>
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('rtd_location_address', '1', '1', ['class' => 'minimal']) }}
- {{ trans('general.address') }}
</label>
</div>
<div class="checkbox col-md-12"> <div class="checkbox col-md-12">
<label> <label>
{{ Form::checkbox('assigned_to', '1', '1', ['class' => 'minimal']) }} {{ Form::checkbox('assigned_to', '1', '1', ['class' => 'minimal']) }}