From f2ddc7b0ae202f61e75beef0a4e492c24131c7cb Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 7 Jul 2016 02:07:21 -0700 Subject: [PATCH] Added purchase cost and purchase date to listing --- app/Http/Controllers/AssetsController.php | 8 ++++++-- resources/views/hardware/index.blade.php | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 73dc288c17..da87b92c2a 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1437,10 +1437,12 @@ class AssetsController extends Controller 'image', 'status_label', 'assigned_to', - 'created_at' + 'created_at', + 'purchase_date', + 'purchase_cost' ]; - $all_custom_fields=CustomField::all(); //used as a 'cache' of custom fields throughout this page load + $all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load foreach ($all_custom_fields as $field) { $allowed_columns[]=$field->db_column_name(); @@ -1518,6 +1520,8 @@ class AssetsController extends Controller 'category' => (($asset->model) && ($asset->model->category)) ?(string)link_to('/admin/settings/categories/'.$asset->model->category->id.'/view', e($asset->model->category->name)) : '', 'manufacturer' => (($asset->model) && ($asset->model->manufacturer)) ? (string)link_to('/admin/settings/manufacturers/'.$asset->model->manufacturer->id.'/view', e($asset->model->manufacturer->name)) : '', 'eol' => ($asset->eol_date()) ? $asset->eol_date() : '', + 'purchase_cost' => ($asset->purchase_cost) ? number_format($asset->purchase_cost, 2) : '', + 'purchase_date' => ($asset->purchase_date) ? $asset->purchase_date : '', 'notes' => e($asset->notes), 'order_number' => ($asset->order_number!='') ? ''.e($asset->order_number).'' : '', 'last_checkout' => ($asset->last_checkout!='') ? e($asset->last_checkout) : '', diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index 14b5a1a9fa..95a71c8b8e 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -76,8 +76,8 @@ @endif {{ trans('general.id') }} {{ trans('general.company') }} - {{ trans('admin/hardware/table.image') }} - {{ trans('admin/hardware/form.name') }} + {{ trans('admin/hardware/table.image') }} + {{ trans('admin/hardware/form.name') }} {{ trans('admin/hardware/table.asset_tag') }} {{ trans('admin/hardware/table.serial') }} {{ trans('admin/hardware/form.model') }} @@ -87,7 +87,9 @@ {{ trans('admin/hardware/table.location') }} {{ trans('general.category') }} {{ trans('general.manufacturer') }} - {{ trans('general.eol') }} + {{ trans('admin/hardware/form.cost') }} + {{ trans('admin/hardware/form.date') }} + {{ trans('general.eol') }} {{ trans('general.notes') }} {{ trans('admin/hardware/form.order') }} {{ trans('admin/hardware/table.checkout_date') }}