From 059126f642d34f9dc64e29c5910d9a270721192b Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Mon, 23 Jul 2018 09:47:21 -0400 Subject: [PATCH] Checkout update locationid (#5919) * Fix missing punctuation. Bad merge. * If we're checking out to an location, use it's id instead of location_id --- app/Http/Controllers/UsersController.php | 2 +- app/Models/Asset.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index c8e580273a..7afebbb946 100755 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -250,7 +250,7 @@ class UsersController extends Controller } catch (ModelNotFoundException $e) { return redirect()->route('users.index') - ->with('error', trans('admin/users/message.user_not_found', compact('id'))) + ->with('error', trans('admin/users/message.user_not_found', compact('id'))); } diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 891cfbb41a..631cf4a289 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -228,6 +228,9 @@ class Asset extends Depreciable if($target->location) { $this->location_id = $target->location->id; } + if($target instanceof Location) { + $this->location_id = $target->id; + } } /**