diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 8e9c395d0c..1816fc9f63 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -550,7 +550,8 @@ class AssetsController extends Controller $asset->depreciate = '0'; $asset->status_id = $request->get('status_id', 0); $asset->warranty_months = $request->get('warranty_months', null); - $asset->purchase_cost = $request->get('purchase_cost'); // this is the API's store method, so I don't know that I want to do this? Confusing. FIXME (or not?!) + $asset->purchase_cost = $request->get('purchase_cost'); + $asset->asset_eol_date = $request->get('asset_eol_date', $asset->present()->eol_date()); $asset->purchase_date = $request->get('purchase_date', null); $asset->assigned_to = $request->get('assigned_to', null); $asset->supplier_id = $request->get('supplier_id'); @@ -558,6 +559,7 @@ class AssetsController extends Controller $asset->rtd_location_id = $request->get('rtd_location_id', null); $asset->location_id = $request->get('rtd_location_id', null); + /** * this is here just legacy reasons. Api\AssetController * used image_source once to allow encoded image uploads. diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index b385222bd3..2a93845507 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -140,9 +140,9 @@ class AssetsController extends Controller $asset->depreciate = '0'; $asset->status_id = request('status_id'); $asset->warranty_months = request('warranty_months', null); - $asset->purchase_cost = $request->get('purchase_cost'); + $asset->purchase_cost = request('purchase_cost'); $asset->purchase_date = request('purchase_date', null); - $asset->asset_eol_date = request('asset_eol_date', null); + $asset->asset_eol_date = request('asset_eol_date', $asset->present()->eol_date()); $asset->assigned_to = request('assigned_to', null); $asset->supplier_id = request('supplier_id', null); $asset->requestable = request('requestable', 0);