Improve parsing of purchase order quantities

This commit is contained in:
Lance Edgar 2022-08-30 11:28:16 -05:00
parent ef045607d9
commit 731c2168b0

View file

@ -390,7 +390,7 @@ class OrderingBatchView(PurchasingBatchView):
if cases_ordered == '':
cases_ordered = 0
else:
cases_ordered = int(cases_ordered)
cases_ordered = int(float(cases_ordered))
if cases_ordered >= 100000: # TODO: really this depends on underlying column
return {'error': "Invalid value for cases ordered: {}".format(cases_ordered)}
@ -401,7 +401,7 @@ class OrderingBatchView(PurchasingBatchView):
if units_ordered == '':
units_ordered = 0
else:
units_ordered = int(units_ordered)
units_ordered = int(float(units_ordered))
if units_ordered >= 100000: # TODO: really this depends on underlying column
return {'error': "Invalid value for units ordered: {}".format(units_ordered)}