diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index a189357183..b88bac9df1 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -70,7 +70,8 @@ class AssetsController extends Controller 'created_at', 'updated_at', 'purchase_date', - 'purchase_cost' + 'purchase_cost', + 'warranty_months', ]; $filter = array(); diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index a650eaf16d..801b439bc3 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -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'), diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index a4ffbd664f..1f71f7de33 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -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,