Merge pull request #12855 from koelle25/fixes/last_component_checkout

Allow checkout of available components down to zero stock (fixes #12854)
This commit is contained in:
snipe 2023-04-17 09:49:14 -07:00 committed by GitHub
commit b22cad9ced
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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