3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 20:35:31 +00:00

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));