Added warranty and expiration to list view

This commit is contained in:
snipe 2017-10-31 07:05:15 -07:00
parent 32b2f77ad9
commit 37868cd70e
3 changed files with 16 additions and 2 deletions

View file

@ -70,7 +70,8 @@ class AssetsController extends Controller
'created_at',
'updated_at',
'purchase_date',
'purchase_cost'
'purchase_cost',
'warranty_months',
];
$filter = array();

View file

@ -64,7 +64,7 @@ class AssetsTransformer
] : null,
'image' => ($asset->getImageUrl()) ? $asset->getImageUrl() : null,
'assigned_to' => $this->transformAssignedTo($asset),
'warranty' => ($asset->warranty_months > 0) ? e($asset->warranty_months . ' ' . trans('admin/hardware/form.months')) : null,
'warranty_months' => ($asset->warranty_months > 0) ? e($asset->warranty_months . ' ' . trans('admin/hardware/form.months')) : null,
'warranty_expires' => ($asset->warranty_months > 0) ? Helper::getFormattedDateObject($asset->warranty_expires, 'date') : null,
'created_at' => Helper::getFormattedDateObject($asset->created_at, 'datetime'),
'updated_at' => Helper::getFormattedDateObject($asset->updated_at, 'datetime'),

View file

@ -148,6 +148,19 @@ class AssetPresenter extends Presenter
"title" => trans('general.order_number'),
'formatter' => "orderNumberObjFilterFormatter"
], [
"field" => "warranty_months",
"searchable" => true,
"sortable" => true,
"visible" => false,
"title" => trans('admin/hardware/form.warranty')
],[
"field" => "warranty_expires",
"searchable" => false,
"sortable" => false,
"visible" => false,
"title" => 'Warranty Expires',
"formatter" => "dateDisplayFormatter"
],[
"field" => "notes",
"searchable" => true,
"sortable" => true,