Improve parsing of purchase order quantities
This commit is contained in:
parent
ef045607d9
commit
731c2168b0
|
@ -390,7 +390,7 @@ class OrderingBatchView(PurchasingBatchView):
|
||||||
if cases_ordered == '':
|
if cases_ordered == '':
|
||||||
cases_ordered = 0
|
cases_ordered = 0
|
||||||
else:
|
else:
|
||||||
cases_ordered = int(cases_ordered)
|
cases_ordered = int(float(cases_ordered))
|
||||||
if cases_ordered >= 100000: # TODO: really this depends on underlying column
|
if cases_ordered >= 100000: # TODO: really this depends on underlying column
|
||||||
return {'error': "Invalid value for cases ordered: {}".format(cases_ordered)}
|
return {'error': "Invalid value for cases ordered: {}".format(cases_ordered)}
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ class OrderingBatchView(PurchasingBatchView):
|
||||||
if units_ordered == '':
|
if units_ordered == '':
|
||||||
units_ordered = 0
|
units_ordered = 0
|
||||||
else:
|
else:
|
||||||
units_ordered = int(units_ordered)
|
units_ordered = int(float(units_ordered))
|
||||||
if units_ordered >= 100000: # TODO: really this depends on underlying column
|
if units_ordered >= 100000: # TODO: really this depends on underlying column
|
||||||
return {'error': "Invalid value for units ordered: {}".format(units_ordered)}
|
return {'error': "Invalid value for units ordered: {}".format(units_ordered)}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue