OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
865 stars 435 forks source link

Magento 1.x Quote vs Order tax rounding issue #389

Open seansan opened 6 years ago

seansan commented 6 years ago

Hi, we are seeing a Quote vs Order tax rounding issue (1.9.3.x) and though I'd report it here.

In short, when we apply discounts for the following order

May be related to here https://github.com/magento/magento2/issues/446

Problem is that 1 API uses quote to start a process in our ios app. And later tries to link this back to the order. But this never succeeds, because there is a 1 cent difference

Was this issue adressed before? I read a lot about rounding issues but nothing specific to this case other then Kristoffs post above

tomekjordan commented 6 years ago

Hi. I saw similar things when I used bundles and discounts, when I used Paypal with discounts, when I used points rewards extensions discounts in shopping cart. I see many times subtotal differes than row total - no matter what tax calculation method I use. The best so far is row total, while by unit makes this even worse (but should be the best method to calculate)

Looks like this is still a problem - in many cases - at least in 1.9.3.x

kanevbg commented 5 years ago

It seems I am hitting this same thing

rafaelpatro commented 4 years ago

Same to me.

The issue is related to this method I guess: https://github.com/OpenMage/magento-lts/blob/8763054a06260e0198dbe97768803cc6f5bf9adc/app/code/core/Mage/Core/Model/Store.php#L995

roundPrice is widely applied https://github.com/OpenMage/magento-lts/blob/77a837aba9166502378d3bb64920ccf5e862b95e/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php#L49

Maybe truncating could be a solution:

    public function roundPrice($price)
    {
        return intval($price * 100) / 100;
    }
ADDISON74 commented 2 years ago

This issue was reported 5 years ago and updated in 2019. What can we do with it? Create a PR if it confirms?