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:
@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user