Fixed #4557 - added missing fields in components/consumables list view

This commit is contained in:
snipe 2017-12-05 00:40:30 -08:00
parent 28fdbdd5d8
commit 9eef7a94ab
4 changed files with 36 additions and 2 deletions

View file

@ -23,7 +23,7 @@ class ComponentsTransformer
'id' => (int) $component->id, 'id' => (int) $component->id,
'name' => e($component->name), 'name' => e($component->name),
'image' => ($component->image) ? e(url('/').'/uploads/components/'.e($component->image)) : null, '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) ? [ 'location' => ($component->location) ? [
'id' => (int) $component->location->id, 'id' => (int) $component->location->id,
'name' => e($component->location->name) 'name' => e($component->location->name)
@ -34,6 +34,10 @@ class ComponentsTransformer
'id' => (int) $component->category->id, 'id' => (int) $component->category->id,
'name' => e($component->category->name) 'name' => e($component->category->name)
] : null, ] : null,
'location' => ($component->location) ? [
'id' => (int) $component->location->id,
'name' => e($component->location->name)
] : null,
'order_number' => e($component->order_number), 'order_number' => e($component->order_number),
'purchase_date' => Helper::getFormattedDateObject($component->purchase_date, 'date'), 'purchase_date' => Helper::getFormattedDateObject($component->purchase_date, 'date'),
'purchase_cost' => Helper::formatCurrencyOutput($component->purchase_cost), 'purchase_cost' => Helper::formatCurrencyOutput($component->purchase_cost),

View file

@ -30,7 +30,7 @@ class ConsumablesTransformer
'location' => ($consumable->location) ? ['id' => (int) $consumable->location->id, 'name' => e($consumable->location->name)] : null, '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, 'manufacturer' => ($consumable->manufacturer) ? ['id' => (int) $consumable->manufacturer->id, 'name' => e($consumable->manufacturer->name)] : null,
'min_amt' => (int) $consumable->min_amt, '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(), 'remaining' => $consumable->numRemaining(),
'order_number' => e($consumable->order_number), 'order_number' => e($consumable->order_number),
'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost), 'purchase_cost' => Helper::formatCurrencyOutput($consumable->purchase_cost),

View file

@ -50,6 +50,12 @@ class ComponentPresenter extends Presenter
"title" => trans('general.image'), "title" => trans('general.image'),
"visible" => false, "visible" => false,
"formatter" => 'imageFormatter', "formatter" => 'imageFormatter',
],[
"field" => "serial",
"searchable" => true,
"sortable" => true,
"title" => trans('admin/hardware/form.serial'),
"formatter" => "componentsLinkFormatter"
], [ ], [
"field" => "category", "field" => "category",
"searchable" => true, "searchable" => true,
@ -74,6 +80,12 @@ class ComponentPresenter extends Presenter
"sortable" => false, "sortable" => false,
"title" => trans('general.min_amt'), "title" => trans('general.min_amt'),
"visible" => true, "visible" => true,
], [
"field" => "location",
"searchable" => true,
"sortable" => true,
"title" => trans('general.location'),
"formatter" => "locationsLinkObjFormatter"
], [ ], [
"field" => "order_number", "field" => "order_number",
"searchable" => true, "searchable" => true,

View file

@ -56,6 +56,11 @@ class ConsumablePresenter extends Presenter
"sortable" => true, "sortable" => true,
"title" => trans('general.category'), "title" => trans('general.category'),
"formatter" => "categoriesLinkObjFormatter" "formatter" => "categoriesLinkObjFormatter"
],[
"field" => "model_number",
"searchable" => true,
"sortable" => true,
"title" => trans('general.model_no'),
],[ ],[
"field" => "item_no", "field" => "item_no",
"searchable" => true, "searchable" => true,
@ -79,6 +84,19 @@ class ConsumablePresenter extends Presenter
"sortable" => false, "sortable" => false,
"title" => trans('general.min_amt'), "title" => trans('general.min_amt'),
"visible" => true, "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", "field" => "order_number",
"searchable" => true, "searchable" => true,