Merge pull request #14188 from spencerrlongg/bug/14146

Fixes Default Location Being Set During Asset Creation and Checkout
This commit is contained in:
snipe 2024-02-10 11:47:46 +00:00 committed by GitHub
commit 111daffc17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -146,7 +146,8 @@ class AssetsController extends Controller
$asset->next_audit_date = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
}
if ($asset->assigned_to == '') {
// Set location_id to rtd_location_id ONLY if the asset isn't being checked out
if (!request('assigned_user') && !request('assigned_asset') && !request('assigned_location')) {
$asset->location_id = $request->input('rtd_location_id', null);
}