Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 8
CRITICAL: Tax Calculation Flaw in All Versions of Magento
 
primeminister
Jr. Member
 
Total Posts:  4
Joined:  2009-02-26
 

Screemshot is not telling what you anything, so I explain more of this:

When I order two of the same items and want to checkout/pay it the rounding is one cent short compared with the total amount.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ck.sanders
Jr. Member
 
Total Posts:  1
Joined:  2009-03-16
 

I think I have the same problem as primeminister.

If I order the following produtcs:

- 1x product Euro 12,50 including 19% tax.
- 2x product Euro 19,50 including 19% tax.
- 1x shippingcosts Euro 3,95 including 19% tax.

Total is: Euro 55,45 including 19% tax.

Ideal gets all prices without 19% tax:

- 1x product Euro 10,50
- 2x product Euro 16,39
- 1x shipping Euro 3,32
- 1x tax Euro 8,86

Total is: Euro 55,46

Only 1 cent too much, but then Ideal is not working.
Is there a workaround or a fix available??

 
Magento Community Magento Community
Magento Community
Magento Community
 
primeminister
Jr. Member
 
Total Posts:  4
Joined:  2009-02-26
 

I have a similar problem. Most of my products are 14,95 eur each. If I sell 2 identical products in 1order, iDEAL does not accept my order due to a wrong calculation of the VAT (BTW).  If I place a combined order consisting out of two products of 14,95, I get a different amount of VAT and the iDEAL is accepting the order. Clearly a problem with rounding.

Bad order (2 of the same products at 14,95 each)
Subtotaal € 25,13
BTW € 4,77
Totaal € 29,90

Good order (2 different products at 14,95 each)
Subtotaal € 25,12
BTW € 4,78
Totaal € 29,90

As you can see, there is a difference of 1 cent. And that 1 cent is causing the problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
johanschaap
Jr. Member
 
Total Posts:  2
Joined:  2009-03-04
 

Anyone any idea or suggestion? Is this something Magento is going to fix? Or does anyone have a work around? I lost some orders due to this problem so I would love to have it fixed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dakman
Member
 
Avatar
Total Posts:  38
Joined:  2008-07-09
 

Yes we have some of our customization clients complaining about this issue as well ..

See our latest post by our project manager Zack about this issue…

http://www.magentocommerce.com/boards/viewthread/35994/

According to them, Magento is not compliant with sales tax regulation and discounts and taxes are not properly calculated.

There is no question that this is a huge bug as its effecting all Magento stores . I’m confused as to why Magento and the community hasn’t put this to the top of the list. This is related to the core functionality of Magento and not minor bugs relating to new features. All new functionality really shouldn’t be introduced until Magento can get its order calculation right (tax and discounts).. Brick and mortar stores will eventually all be running into this issue and see that their cash register’s numbers don’t match with Magento’s numbers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
johanschaap
Jr. Member
 
Total Posts:  2
Joined:  2009-03-04
 

Any idea how long it usually takes for Magento to respond to these kind of critical failures? Do they monitor this Forum? I’m new here, so I have no idea.

I’m losing orders every week now because of this and I need a solution. Which would be another platform if this is not fixed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dakman
Member
 
Avatar
Total Posts:  38
Joined:  2008-07-09
 

Roy/Yoav has anyone looked into this issue at Varien?  Will it be fixed in 1.3?

If not are there any developers here that would like to work with our team and brainstorm how this can be fixed? Let me know and maybe we can either hop on IRC or skype chat and all work together on fixing this… as this bug is not “potentially” critical it is critical ... virtually all Magento stores have this bug and eventually it may cause significant losses to store owners… This bug is at the core of Magento’s tax and discount calculation process and almost a rework of those calculation modules may be necessary…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Oswin
Jr. Member
 
Total Posts:  3
Joined:  2009-04-02
 

I have a workaround to this issue that I applied to my store and so far so good.

What I did was remove the round process when calculating the tax per each item on the shopping cart.

So at the end it will sum all taxes from each items with no rounding, and at the end it will round the total tax, but no rounding on individual taxes per items.

I did some testings and compare with a spreadsheet and everything so far so good.

The change I made was on: 

app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php

in function calcTaxAmount() :

I modified the following lines:

$this->setTaxAmount($store->roundPrice($rowTotal * $taxPercent));
$this->setBaseTaxAmount($store->roundPrice($rowBaseTotal * $taxPercent));

for:

$this->setTaxAmount($rowTotal * $taxPercent);
$this->setBaseTaxAmount($rowBaseTotal * $taxPercent);

Let me know your comments, so far I haven’t had any unexpected negative impact anywhere else, but any feedback is well appreciated.

Oswin.

Farrita Handcrafted Jewelry
http://www.farrita.com

powered by Magento wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
pishkus
Jr. Member
 
Total Posts:  10
Joined:  2008-07-23
Kaunas, Lithuania
 

Have you tried using a discount coupon (e.g. 10% off)?
When I use a discount coupon I still sometimes get 1 cent difference… :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Oswin
Jr. Member
 
Total Posts:  3
Joined:  2009-04-02
 

Then I believe you will need to also change these lines in that same function:

$this->setTaxBeforeDiscount($store->roundPrice($rowTotal * $taxPercent));
$this->setBaseTaxBeforeDiscount($store->roundPrice($rowBaseTotal * $taxPercent));

for

$this->setTaxBeforeDiscount($rowTotal * $taxPercent);
$this->setBaseTaxBeforeDiscount($rowBaseTotal * $taxPercent);

However I havent tried that yet, but I will do some testing with discounts.

Oswin.

Handcrafted Jewelry
http://www.farrita.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiaraweb
Guru
 
Avatar
Total Posts:  721
Joined:  2008-03-21
Aviano ~ Italy
 
Oswin - 03 April 2009 04:57 AM

Then I believe you will need to also change these lines in that same function:


$this->setTaxBeforeDiscount($store->roundPrice($rowTotal * $taxPercent));
$this->setBaseTaxBeforeDiscount($store->roundPrice($rowBaseTotal * $taxPercent));


for

$this->setTaxBeforeDiscount($rowTotal * $taxPercent);
$this->setBaseTaxBeforeDiscount($rowBaseTotal * $taxPercent);


However I havent tried that yet, but I will do some testing with discounts.

I changed like you wrote, but for me the problem still persist.

I’ve seen that I have this trouble with 1 cent of difference when in the cart is applied a discount like 5%, 15%, 25% (I have discounts based on the nr. of items the cart), no difference when discount applied is 10%, 12%, 20%, 22%

then it seems that the problem exists when you have a “5” in % discount

Maybe a stupid idea, but I changed all my catalog discounts and coupon code like this

5.02% instead of 5%
15.02% instead 15%
25.02% instead 25%

discounts are a little bit better for customers, but it is not a great problem for me

Now all the rows in cart are ok, subtotal - discount + tax are ever right

 
Magento Community Magento Community
Magento Community
Magento Community
 
onepack
Sr. Member
 
Total Posts:  98
Joined:  2008-06-02
Amsterdam
 

There was a bug registered : Issue #6858

But it’s closed 2008-09-05 00:29:59 because the Magento team said they could not reproduse this issue.

I’m running version 1.3.0 and have this bug as we speak.
I added a price rule of 10% discount on the cart total and sinse then this problem occured.

This is what I get with a test order and what will make all Ideal payments crash:
Subtotaal € 3,36
BTW € 0,64
Verzending & afhandeling € 0,00
Korting € 0,34
Eindtotaal € 3,59
Totaal betaald € 0,00
Totaal teruggestort € 0,00
Saldo € 3,60

Saldo and End Total differ 1 cent and this sould not be. Because of this I cannot use shop cart discount functionallity

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiaraweb
Guru
 
Avatar
Total Posts:  721
Joined:  2008-03-21
Aviano ~ Italy
 

Try to apply a discount with tax based on %
Then if you have like in Italy a tax that it is 20% you can set the system like this:

To give 10% of discount create a discount of 12% but applied to total amount without tax

In admin configuration:
APPLY DISCOUNT ON PRICE INCLUDE TAX -> NO
ADD TAX AFTER DISCOUNT -> NO

CREATE A DISCOUNT AT 12% and APPLY DISCOUNT ON PRICE WITHOUT TAX

The total is the same (12% on amount without tax is the same of 10% of the discount applied to total amount with tax)

In this way you can use discount without tax (the error of magento is here, when the tax is added after discount)

I Resolved and I’m so happy!

 
Magento Community Magento Community
Magento Community
Magento Community
 
onepack
Sr. Member
 
Total Posts:  98
Joined:  2008-06-02
Amsterdam
 

Thank You Chiaraweb!!

I will give it a try after I got the website up and running again.. my latest upgrade to 1.3.1 went completely wrong. Before this never happened this bad..

Greetings,

OnePack

 
Magento Community Magento Community
Magento Community
Magento Community
 
hydra
Guru
 
Avatar
Total Posts:  378
Joined:  2008-08-26
Amsterdam
 

Bump.
-
Unbelievable how the dev team can completely ignore the forums lately.
I guess they are only there for the paying customers nowadays.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 8