From 115d6e29df06c350f470e7f205a2918158010f58 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 26 Mar 2018 15:59:09 -0700 Subject: [PATCH] Added location address to custom asset report export --- app/Http/Controllers/ReportsController.php | 18 ++++++++++++++++++ resources/views/reports/custom.blade.php | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index e8ef1f3962..e0a1f5aa58 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -494,6 +494,14 @@ class ReportsController extends Controller if ($request->has('location')) { $header[] = trans('admin/hardware/table.location'); } + if ($request->has('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')) { $header[] = trans('admin/hardware/table.checkoutto'); @@ -662,6 +670,16 @@ class ReportsController extends Controller $row[] = ($asset->location) ? $asset->location->present()->name() : ''; } + if ($request->has('location_address')) { + $row[] = ($asset->location) ? $asset->location->address : ''; + $row[] = ($asset->location) ? $asset->location->address2 : ''; + $row[] = ($asset->location) ? $asset->location->city : ''; + $row[] = ($asset->location) ? $asset->location->state : ''; + $row[] = ($asset->location) ? $asset->location->country : ''; + $row[] = ($asset->location) ? $asset->location->zip : ''; + } + + if ($request->has('assigned_to')) { $row[] = ($asset->checkedOutToUser() && $asset->assigned) ? e($asset->assigned->getFullNameAttribute()) : ($asset->assigned ? e($asset->assigned->display_name) : ''); $row[] = ($asset->checkedOutToUser() && $asset->assigned) ? 'user' : e($asset->assignedType()); diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index 2e311b8bfa..1b9817fce4 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -115,6 +115,12 @@ {{ trans('general.location') }} +
+ +