0

I think I've found magento bug and I just want to know if I'm right here:

Order: subtotal(without tax) € 35,72

discount - € 0,71

Shipping cost: € 6,00

Subtotal excldued tax € 41,05 (should be 41.01)

VAT 6.0% (6%) € 2,10

VAT 21.0% (21%) € 1,26

VAT TOTAL: € 3,36

GRAND TOTAL € 44,41 (should be 44.37)

41.05 had 4 cents added extra... those 4 cents is the difference between tax value 2,14euro (before discount) 2,10euro (after discount).

3
  • there has been a lot of rumble about tax calculation being wrong in the past, but I'm not sure if it has carried on with the newer versions. Aug 20 '14 at 12:14
  • we are using magento 1.9.0.1 and php 5.3.3 Aug 20 '14 at 12:48
  • Supposed to be fixed starting v1.8, but I'm in the don't trust, verify mode on this one. They'll get it right sometime, maybe next version has been the mantra for some time. Aug 20 '14 at 15:23
1

I am not sure if this would help you somehow, but I think that you can calculate with these two files, or modify the functions:

Tax subtotals file calculation is done here:

magento\app\code\core\Mage\Tax\Model\Sales\Total\Quote\Subtotal.php

public function collect(Mage_Sales_Model_Quote_Address $address)
    {

There you have round functions used:

Further magento takes these functions from this file:

\magento\app\code\core\Mage\Tax\Model\Calculation.php

Check these functions:

public function round($price)
    {
        return Mage::app()->getStore()->roundPrice($price);
    }

    /**
     * Round price up
     *
     * @param   float $price
     * @return  float
     */
    public function roundUp($price)
    {
        return ceil($price * 100) / 100;
    }

    /**
     * Round price down
     *
     * @param   float $price
     * @return  float
     */
    public function roundDown($price)
    {
        return floor($price * 100) / 100;
    }

I am not sure if this is the right answer, but hopefully this can get you somewhere. Because magento pricing is quite complex.

3
  • 1
    I've already tried it and I've also talked to few magento developers and they all say that tax calculations is buggy... and I have to change the calculations settings and update product prices Aug 20 '14 at 12:49
  • I am not sure if its buggy, because by default magento go till 4 digits rounding. Why dont you install a fresh magento with just tax rules and check if its working there, may be that could help you. Aug 20 '14 at 12:56
  • 1
    I've just confirmed that is is a bug related to this specified pricing and tax configuration we do have :( Aug 20 '14 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.