Merge pull request #10209 from Godmartinz/feature/sc-1474/sync-parent-asset-location-with-children-assets

Fixes Bug: When parent asset is assigned to other location, children assets loca…
This commit is contained in:
snipe 2021-10-28 16:49:44 -07:00 committed by GitHub
commit 3088230236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,8 @@ trait CheckInOutRequest
switch (request('checkout_to_type')) {
case 'location':
$asset->location_id = $target->id;
Asset::where('assigned_type', 'App\Models\Asset')->where('assigned_to', $asset->id)
->update(['location_id' => $asset->location_id]);
break;
case 'asset':
$asset->location_id = $target->rtd_location_id;