When asset is checked-in the assigned licenses also are taken from the user

This commit is contained in:
Ivan Nieto Vivanco 2024-01-30 19:44:38 -06:00
parent 77fa213ccd
commit 51ae485f20

View file

@ -906,6 +906,13 @@ class AssetsController extends Controller
$originalValues['action_date'] = $checkin_at;
}
if(!empty($asset->licenseseats->all())){
foreach ($asset->licenseseats as $seat){
$seat->assigned_to = null;
$seat->save();
}
}
if ($asset->save()) {
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at, $originalValues));