From c7125c39375b101f852930536dabcc079f2d5e88 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 16 Jul 2020 16:34:39 -0700 Subject: [PATCH 1/2] Set location_id to rtd_location_id on asset creation --- app/Http/Controllers/Api/AssetsController.php | 1 + app/Http/Controllers/AssetsController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index bc18e852d5..91e22e780f 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -453,6 +453,7 @@ class AssetsController extends Controller $asset->supplier_id = $request->get('supplier_id', 0); $asset->requestable = $request->get('requestable', 0); $asset->rtd_location_id = $request->get('rtd_location_id', null); + $asset->location_id = $request->get('rtd_location_id', null); // Update custom fields in the database. // Validation for these fields is handled through the AssetRequest form request diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 8a146e8709..26c9fdd35c 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -137,6 +137,7 @@ class AssetsController extends Controller $asset->supplier_id = request('supplier_id', 0); $asset->requestable = request('requestable', 0); $asset->rtd_location_id = request('rtd_location_id', null); + $asset->location_id = request('rtd_location_id', null); if ($asset->assigned_to=='') { $asset->location_id = $request->input('rtd_location_id', null); From 897757bd0461cefd2e82aba344d416ed6843c49c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 16 Jul 2020 17:43:44 -0700 Subject: [PATCH 2/2] Removed added line for location --- app/Http/Controllers/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 26c9fdd35c..f7d8603d90 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -137,7 +137,7 @@ class AssetsController extends Controller $asset->supplier_id = request('supplier_id', 0); $asset->requestable = request('requestable', 0); $asset->rtd_location_id = request('rtd_location_id', null); - $asset->location_id = request('rtd_location_id', null); + if ($asset->assigned_to=='') { $asset->location_id = $request->input('rtd_location_id', null);