mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 13:14:07 -08:00
Fixed #4557 - added missing fields in components/consumables list view
This commit is contained in:
parent
28fdbdd5d8
commit
9eef7a94ab
|
@ -23,7 +23,7 @@ class ComponentsTransformer
|
|||
'id' => (int) $component->id,
|
||||
'name' => e($component->name),
|
||||
'image' => ($component->image) ? e(url('/').'/uploads/components/'.e($component->image)) : null,
|
||||
'serial_number' => ($component->serial) ? e($component->serial) : null,
|
||||
'serial' => ($component->serial) ? e($component->serial) : null,
|
||||
'location' => ($component->location) ? [
|
||||
'id' => (int) $component->location->id,
|
||||
'name' => e($component->location->name)
|
||||
|
@ -34,6 +34,10 @@ class ComponentsTransformer
|
|||
'id' => (int) $component->category->id,
|
||||
'name' => e($component->category->name)
|
||||
] : null,
|
||||
'location' => ($component->location) ? [
|
||||
'id' => (int) $component->location->id,
|
||||
'name' => e($component->location->name)
|
||||
] : null,
|
||||
'order_number' => e($component->order_number),
|
||||
'purchase_date' => Helper::getFormattedDateObject($component->purchase_date, 'date'),
|
||||
'purchase_cost' => Helper::formatCurrencyOutput($component->purchase_cost),
|
||||
|
|
|
@ -30,7 +30,7 @@ class ConsumablesTransformer
|
|||
'location' => ($consumable->location) ? ['id' => (int) $consumable->location->id, 'name' => e($consumable->location->name)] : null,
|
||||
'manufacturer' => ($consumable->manufacturer) ? ['id' => (int) $consumable->manufacturer->id, 'name' => e($consumable->manufacturer->name)] : null,
|
||||
'min_amt' => (int) $consumable->min_amt,
|
||||
'model_number' => e($consumable->model_number),
|
||||
'model_number' => ($consumable->model_number!='') ? e($consumable->model_number) : null,
|
||||
'remaining' => $consumable->numRemaining(),
|
||||
'order_number' => e($consumable->order_number),
|
||||
'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost),
|
||||
|
|
|
@ -50,6 +50,12 @@ class ComponentPresenter extends Presenter
|
|||
"title" => trans('general.image'),
|
||||
"visible" => false,
|
||||
"formatter" => 'imageFormatter',
|
||||
],[
|
||||
"field" => "serial",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"title" => trans('admin/hardware/form.serial'),
|
||||
"formatter" => "componentsLinkFormatter"
|
||||
], [
|
||||
"field" => "category",
|
||||
"searchable" => true,
|
||||
|
@ -74,6 +80,12 @@ class ComponentPresenter extends Presenter
|
|||
"sortable" => false,
|
||||
"title" => trans('general.min_amt'),
|
||||
"visible" => true,
|
||||
], [
|
||||
"field" => "location",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"title" => trans('general.location'),
|
||||
"formatter" => "locationsLinkObjFormatter"
|
||||
], [
|
||||
"field" => "order_number",
|
||||
"searchable" => true,
|
||||
|
|
|
@ -56,6 +56,11 @@ class ConsumablePresenter extends Presenter
|
|||
"sortable" => true,
|
||||
"title" => trans('general.category'),
|
||||
"formatter" => "categoriesLinkObjFormatter"
|
||||
],[
|
||||
"field" => "model_number",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"title" => trans('general.model_no'),
|
||||
],[
|
||||
"field" => "item_no",
|
||||
"searchable" => true,
|
||||
|
@ -79,6 +84,19 @@ class ConsumablePresenter extends Presenter
|
|||
"sortable" => false,
|
||||
"title" => trans('general.min_amt'),
|
||||
"visible" => true,
|
||||
], [
|
||||
"field" => "location",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"title" => trans('general.location'),
|
||||
"formatter" => "locationsLinkObjFormatter"
|
||||
], [
|
||||
"field" => "manufacturer",
|
||||
"searchable" => true,
|
||||
"sortable" => true,
|
||||
"title" => trans('general.manufacturer'),
|
||||
"visible" => false,
|
||||
"formatter" => "manufacturersLinkObjFormatter"
|
||||
], [
|
||||
"field" => "order_number",
|
||||
"searchable" => true,
|
||||
|
|
Loading…
Reference in a new issue