mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
when parent asset is assigned to other location, children assets location are updated as well.
This commit is contained in:
parent
365349fd91
commit
9ae7d0b23a
|
@ -39,6 +39,8 @@ trait CheckInOutRequest
|
||||||
switch (request('checkout_to_type')) {
|
switch (request('checkout_to_type')) {
|
||||||
case 'location':
|
case 'location':
|
||||||
$asset->location_id = $target->id;
|
$asset->location_id = $target->id;
|
||||||
|
Asset::where('assigned_type', 'App\Models\Asset')->where('assigned_to', $asset->id)
|
||||||
|
->update(['location_id' => $asset->location_id]);
|
||||||
break;
|
break;
|
||||||
case 'asset':
|
case 'asset':
|
||||||
$asset->location_id = $target->rtd_location_id;
|
$asset->location_id = $target->rtd_location_id;
|
||||||
|
|
Loading…
Reference in a new issue