It looks like you're calculating the correct value being stored in the DB,
and only getting the error on output. Each currency value gets passed
through the "currency" template tag, which is where the problem likely is.
It also deals with machine specific locale settings, which will vary per
machine - also making it a likely candidate for the error.

Here's the source for it -
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/templatetags/shop_tags.py#L17-L41

Have you consistently defined (and installed) the correct locale? (defined
with the SHOP_CURRENCY_LOCALE setting).

Can you debug what happens in the "currency" template tag on your deployed
machine? That might entail adding some logging to it, making a copy of it
in your own project, printing out values while manually running it in a
terminal, whatever works for you.





On Sat, May 23, 2015 at 3:26 AM, vikraw <[email protected]> wrote:

> Hi
>
> Almost near launching a site. But running into Price rounding issues today
> when I fab deployed to AWS ec2 instance. Never had those issues before on
> ec2.
> My Development environment is working great with no issues.
>
> However on deployed machine -Prices are getting rounded off in various
> places ex: 249 was rounded off to 250 in cart.html, as well as HTML
> invoice, PDF invoice.
> Unit Price was displaying correctly as 249 But "Total Price" was showing
> 250
>
> Also, facing rounding off issues in PDF invoice and View Invoice in
> browser.
>
> The amounts are accurate in email invoice though. Even the amounts sent to
> payment gateway are correct. When the account user goes to history of
> orders, the amounts are correctly displayed in the columns. Only issues are
> cart, html invoice, pdf templates.
>
> I have a tax_handler where i calculate tax as follows - TAX_RATE = 0.05
>  tax_total = Decimal(amount_to_tax) * Decimal(str(settings.TAX_RATE))
>
> See attached files - 366.45 is the correct amount being shown in
> Order-History page, but invoice is generated or 370.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Stephen McDonald
http://jupo.org

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to