mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
When asset is checked-in the assigned licenses also are taken from the user
This commit is contained in:
parent
77fa213ccd
commit
51ae485f20
|
@ -906,6 +906,13 @@ class AssetsController extends Controller
|
||||||
$originalValues['action_date'] = $checkin_at;
|
$originalValues['action_date'] = $checkin_at;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($asset->licenseseats->all())){
|
||||||
|
foreach ($asset->licenseseats as $seat){
|
||||||
|
$seat->assigned_to = null;
|
||||||
|
$seat->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($asset->save()) {
|
if ($asset->save()) {
|
||||||
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at, $originalValues));
|
event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at, $originalValues));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue