Added purchase cost and purchase date to listing

This commit is contained in:
snipe 2016-07-07 02:07:21 -07:00
parent 01b01c6479
commit f2ddc7b0ae
2 changed files with 11 additions and 5 deletions

View file

@ -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!='') ? '<a href="'.config('app.url').'/hardware?order_number='.e($asset->order_number).'">'.e($asset->order_number).'</a>' : '',
'last_checkout' => ($asset->last_checkout!='') ? e($asset->last_checkout) : '',

View file

@ -76,8 +76,8 @@
@endif
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-field="companyName" data-searchable="true" data-sortable="true" data-switchable="true" data-visible="false">{{ trans('general.company') }}</th>
<th data-sortable="true" data-field="image" data-visible="false">{{ trans('admin/hardware/table.image') }}</th>
<th data-sortable="true" data-field="name" data-visible="false">{{ trans('admin/hardware/form.name') }}</th>
<th data-sortable="true" data-field="image" data-visible="false">{{ trans('admin/hardware/table.image') }}</th>
<th data-sortable="true" data-field="name" data-visible="false">{{ trans('admin/hardware/form.name') }}</th>
<th data-sortable="true" data-field="asset_tag">{{ trans('admin/hardware/table.asset_tag') }}</th>
<th data-sortable="true" data-field="serial">{{ trans('admin/hardware/table.serial') }}</th>
<th data-sortable="true" data-field="model">{{ trans('admin/hardware/form.model') }}</th>
@ -87,7 +87,9 @@
<th data-sortable="true" data-field="location" data-searchable="true">{{ trans('admin/hardware/table.location') }}</th>
<th data-sortable="true" data-field="category" data-searchable="true">{{ trans('general.category') }}</th>
<th data-sortable="true" data-field="manufacturer" data-searchable="true" data-visible="false">{{ trans('general.manufacturer') }}</th>
<th data-sortable="false" data-field="eol" data-searchable="true">{{ trans('general.eol') }}</th>
<th data-sortable="true" data-field="purchase_cost" data-searchable="true" data-visible="false">{{ trans('admin/hardware/form.cost') }}</th>
<th data-sortable="true" data-field="purchase_date" data-searchable="true" data-visible="false">{{ trans('admin/hardware/form.date') }}</th>
<th data-sortable="false" data-field="eol" data-searchable="true">{{ trans('general.eol') }}</th>
<th data-sortable="true" data-searchable="true" data-field="notes">{{ trans('general.notes') }}</th>
<th data-sortable="true" data-searchable="true" data-field="order_number">{{ trans('admin/hardware/form.order') }}</th>
<th data-sortable="true" data-searchable="true" data-field="last_checkout">{{ trans('admin/hardware/table.checkout_date') }}</th>