Add overflow validation for cases/units in inventory batch desktop form
This commit is contained in:
parent
ee1065bfdb
commit
440a88aa0f
|
@ -12,11 +12,21 @@
|
||||||
% if allow_cases:
|
% if allow_cases:
|
||||||
var cases = parseFloat($('#cases').val());
|
var cases = parseFloat($('#cases').val());
|
||||||
if (!isNaN(cases)) {
|
if (!isNaN(cases)) {
|
||||||
|
if (cases > 999999) {
|
||||||
|
alert("Case amount is invalid!");
|
||||||
|
$('#cases').select().focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
% endif
|
% endif
|
||||||
var units = parseFloat($('#units').val());
|
var units = parseFloat($('#units').val());
|
||||||
if (!isNaN(units)) {
|
if (!isNaN(units)) {
|
||||||
|
if (units > 999999) {
|
||||||
|
alert("Unit amount is invalid!");
|
||||||
|
$('#units').select().focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
alert("Please provide case and/or unit quantity");
|
alert("Please provide case and/or unit quantity");
|
||||||
|
|
Loading…
Reference in a new issue