Fixed #12854: Allow checkout of available components down to zero stock

This commit is contained in:
Kevin Köllmann 2023-04-17 11:30:37 +02:00
parent 144a6f28ec
commit 04f3c4bf69
No known key found for this signature in database
GPG key ID: 2E33D0B3082ACD03

View file

@ -64,8 +64,8 @@ class ComponentCheckoutController extends Controller
$max_to_checkout = $component->numRemaining();
// Make sure there is at least one available to checkout
if ($max_to_checkout <= $request->get('assigned_qty')) {
// Make sure there are at least the requested number of components available to checkout
if ($max_to_checkout < $request->get('assigned_qty')) {
return redirect()->back()->withInput()->with('error', trans('admin/components/message.checkout.unavailable', ['remaining' => $max_to_checkout, 'requested' => $request->get('assigned_qty')]));
}