From e4140f4c48905f74adfffd5696836be2faed3f34 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 27 Oct 2016 14:20:55 -0700 Subject: [PATCH 1/2] Fixes #2817 - adds EOL to custom report --- app/Http/Controllers/ReportsController.php | 8 +++++++- resources/views/reports/custom.blade.php | 20 ++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index b3fb6606b6..ada1231bf0 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -538,6 +538,9 @@ class ReportsController extends Controller if (( e(Input::get('purchase_cost')) == '1' ) && ( e(Input::get('depreciation')) != '1' )) { $header[] = 'Purchase Cost'; } + if (e(Input::get('eol')) == '1') { + $header[] = 'EOL'; + } if (e(Input::get('order')) == '1') { $header[] = 'Order Number'; } @@ -613,6 +616,9 @@ class ReportsController extends Controller if (e(Input::get('purchase_cost')) == '1' && ( e(Input::get('depreciation')) != '1' )) { $row[] = '"' . Helper::formatCurrencyOutput($asset->purchase_cost) . '"'; } + if (e(Input::get('eol')) == '1') { + $row[] = '"' .($asset->eol_date()) ? $asset->eol_date() : ''. '"'; + } if (e(Input::get('order')) == '1') { if ($asset->order_number) { $row[] = e($asset->order_number); @@ -621,7 +627,7 @@ class ReportsController extends Controller } } if (e(Input::get('supplier')) == '1') { - if ($asset->supplier_id) { + if ($asset->supplier) { $row[] = '"' .e($asset->supplier->name) . '"'; } else { $row[] = ''; diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index bd854e1e16..397df1d4a0 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -41,20 +41,6 @@ -
- -
- -
- -
-
+
+ +