From 440a88aa0f0d28cc9371b61a13916d9c6d81c8fb Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 27 Jun 2018 14:52:55 -0500 Subject: [PATCH] Add overflow validation for cases/units in inventory batch desktop form --- tailbone/templates/batch/inventory/desktop_form.mako | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tailbone/templates/batch/inventory/desktop_form.mako b/tailbone/templates/batch/inventory/desktop_form.mako index 720084f6..77d573dd 100644 --- a/tailbone/templates/batch/inventory/desktop_form.mako +++ b/tailbone/templates/batch/inventory/desktop_form.mako @@ -12,11 +12,21 @@ % if allow_cases: var cases = parseFloat($('#cases').val()); if (!isNaN(cases)) { + if (cases > 999999) { + alert("Case amount is invalid!"); + $('#cases').select().focus(); + return false; + } return true; } % endif var units = parseFloat($('#units').val()); if (!isNaN(units)) { + if (units > 999999) { + alert("Unit amount is invalid!"); + $('#units').select().focus(); + return false; + } return true; } alert("Please provide case and/or unit quantity");