> There is a ticket out there on this -
>
https://bitbucket.org/chris1610/satchmo/issue/1341/l10nutilsmoneyfmt-rounding-errors
> If this fixes your issues, let me know.
> -Chris
no, this is not my issue. There might be a formatting problem as well in
the rendering part, but my issue here is at the .balance() level
A bill that totals 1.001 should be billed for 1.00, but since trunc_decimal
rounds up, it get's rounded to 1.01, so the payment processes 1.00 (it gets
sent 1.001, and it rounds it down to 1.00) and the order presents an
outstanding balance of 0.01.
In order to make this round down up to 0.0049 and up at 0.005, I
changed roundfactor
= "0.01" for roundfactor = "0.005" in trunc_decimal. So far, this seems to
have worked.
The only difficulty I'm having now is that I need to show details on every
tax amount, and using
{% for tax in order.taxes.all %}
<li>{{ tax.description }}: {{ tax.tax|currency }}</li>
{% endfor %}
<li>{# this would be the replacement of the <li> up there #}
{% trans "Tax" %} +
{{ order.tax|currency }}
</li>
will show numbers that don't add up in some situations (when every tax ends
up being x.xx4 and the sum ends up being y.yy8, the individual taxes will
get rounded down, and the tax total will get rounded up).
I don't know an elegant way to fix this. My client proposed we show the
rounding in the last tax, if necessary, but I can't figure out how to do
that from the template, I'm hacking a little on the order_details inclusion
tag so it generates a list of taxes with the last item modified.
Anyone can think of a cleaner way to address this?
--
"The whole of Japan is pure invention. There is no such country, there are
no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.