Skip to content

A free open source IT asset/license management system

Update the location ID if there is an rtd_location given

snipec06539dee3cf
diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php
index 7daea872c0..dd7a845bf9 100755
--- a/app/Http/Controllers/AssetsController.php
+++ b/app/Http/Controllers/AssetsController.php
@@ -289,6 +289,11 @@ class AssetsController extends Controller
$asset->requestable = $request->has('requestable');
$asset->rtd_location_id = $request->input('rtd_location_id', null);
+ if ($asset->assigned_to=='') {
+ $asset->location_id = $request->input('rtd_location_id', null);
+ }
+
+
if ($request->has('image_delete')) {
unlink(public_path().'/uploads/assets/'.$asset->image);
$asset->image = '';