Well, you are right, I have already corrected this rounding error, which was a result of wrong VAT calculation methods. Since I have done a lot of changes in the core of Satchmo I cannot be 100% sure that the problems lies within its percent tax module alone or it's rather a more complex thing, but the way taxes were calculated for each newly created order and cart is disturbing. If we take the general case of 20% VAT, the price of single unit with tax is the original price, multiplied by 1.2 and then rounded to 2 decimal places. So far so good. But the way of calculating the tax of a line of units or the whole order follows exactly the same logic - it sums up all the prices first and then multiplies the sum by 1.2 and then rounds the result, when in fact the way to do it is to calculate each single unit taxed price separately, round it and then sum up all taxed prices. So that's where the difference comes from. E.g: a product costs $1.88, it's single taxed price is 2.256, rounded to 2.26. But if we have two products 2 x 2.256 = 4.512 and 2 x 2.26 = 4.52. It took me a while to fix it, this definitely needs serious improvements! The function 'by_orderitem' of the processor of the tax percent module illustrates this behaviour.
On Wednesday, February 13, 2013 6:03:39 PM UTC, Toni Mueller wrote: > > > Hi Stanislav, > > On Sun, Jan 13, 2013 at 07:20:17AM -0800, Stanislav Mihaylov wrote: > > The generated invoices from the 'Product Orders' section have the full > due > > amount calculated for the customer: > > > > *Subtotal: �30.57* > > *Shipment charge: �5.00* > > *Tax: �6.11* > > *Total: �41.68* > > *Payments Made - �0.00* > > *Balance Due �41.69* > > I hope you didn't take this example from a real-life shop? > > Otherwise, it would illustrate a disturbing rounding error in Satchmo. > > > Kind regards, > --Toni++ > > -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To unsubscribe from this group and stop receiving emails from it, send an email to satchmo-users+unsubscr...@googlegroups.com. To post to this group, send email to satchmo-users@googlegroups.com. Visit this group at http://groups.google.com/group/satchmo-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.