Validate if the license seat is not checked out, it can't be checked in

This commit is contained in:
Ivan Nieto Vivanco 2023-02-27 18:57:38 -06:00
parent 23fe11c71e
commit 9d94bd6567

View file

@ -59,6 +59,12 @@ class LicenseCheckinController extends Controller
}
$license = License::find($licenseSeat->license_id);
// LicenseSeat is not assigned, it can't be checked in
if (is_null($licenseSeat->assignedTo) && is_null($licenseSeat->asset_id)) {
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.checkin.error'));
}
$this->authorize('checkout', $license);
if (! $license->reassignable) {