Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-04-06 15:13:13 -07:00
commit 3d26fbd82f
2 changed files with 10 additions and 0 deletions

View file

@ -77,6 +77,15 @@ class AccessoryCheckoutController extends Controller
'note' => $request->input('note'),
]);
$available= new Accessory();
if($available->numRemaining()<=0){
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkout.unavailable'));
}
DB::table('accessories_users')->where('assigned_to', '=', $accessory->assigned_to)->where('accessory_id', '=', $accessory->id)->first();
event(new CheckoutableCheckedOut($accessory, $user, Auth::user(), $request->input('note')));

View file

@ -24,6 +24,7 @@ return array(
'checkout' => array(
'error' => 'Accessory was not checked out, please try again',
'success' => 'Accessory checked out successfully.',
'unavailable' => 'Accessory is not available for checkout. Check quantity available',
'user_does_not_exist' => 'That user is invalid. Please try again.'
),