Merge pull request #14192 from inietov/fixes/api_issue_checkin_licenses

Fixed #14183  API /hardware/:id/checkin doesn't return Licenses
This commit is contained in:
snipe 2024-02-21 11:35:06 +00:00 committed by GitHub
commit 54552fc95c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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