Commit 219d67a9 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: prevent rounding issues

parent 8650a476
...@@ -11,7 +11,8 @@ expected_price = context.Entity_getOutstandingAmountList( ...@@ -11,7 +11,8 @@ expected_price = context.Entity_getOutstandingAmountList(
group_by_node=True group_by_node=True
)[0].total_price )[0].total_price
if total_price != expected_price: precision = outstanding_amount.getPriceCurrencyValue().getQuantityPrecision()
if round(total_price, precision) != round(expected_price, precision):
return context.Base_renderForm(dialog_id, Base_translateString('Total Amount does not match'), level='error') return context.Base_renderForm(dialog_id, Base_translateString('Total Amount does not match'), level='error')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment