Add overflow validation for cases/units in inventory batch desktop form

This commit is contained in:
Lance Edgar 2018-06-27 14:52:55 -05:00
parent ee1065bfdb
commit 440a88aa0f

View file

@ -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");