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
870 stars 436 forks source link

Twice tax in Grand Total #80

Closed idziakjakub closed 8 years ago

idziakjakub commented 8 years ago

After upgrade Magento from 1.9.2.2 to 1.9.2.4 I have doubled tax amount in Quote.

I have found solution for this issue: http://stackoverflow.com/questions/17590364/magento-applying-tax-vat-twice/35870460#35870460

The problem occurs when you have additional totals in project. The problem can be solved by adding correct dependencies on tax subtotal, so Magento keep the correct order.

tmotyl commented 8 years ago

+1

tmotyl commented 8 years ago

fixed in https://github.com/OpenMage/magento-lts/commit/b9726b9997e2bece26d37d91c92f32fbb18aebb4

hannes011 commented 4 years ago

This is a major change which is causing troubles for the calculation of shipping rate! Is "shipping" really needed as prerequisite for subtotal? A: shipping is not included within subtotal B: some shipping methods calculate there rate based on subtotal

This change led to strange behavior: once the totals are already calculated and stored/cached then the subtotal doesn't include tax anymore (as expected) BUT when totals will be collected first time the "shipping" total is executed before "tax_subtotal", so the subtotal still contains tax, which leads to inconsistency... image

FYI @tmotyl @sreichel @idziakjakub

Schrank commented 4 years ago

I saw it and maybe this is important for this: https://blog.fabian-blechschmidt.de/mage_weee-and-why-it-is-important-for-tax-calculation/ (didn't dig into it)

Schrank commented 4 years ago

Maybe you want to include https://github.com/ikonoshirt/TopologicalSearch into OpenMage, happy if you do! <3

hannes011 commented 4 years ago

Simple fix would be just this I guess:

--- a/app/code/core/Mage/Tax/etc/config.xml
+++ b/app/code/core/Mage/Tax/etc/config.xml
@@ -162,7 +162,7 @@
                 <totals>
                     <tax_subtotal>
                         <class>tax/sales_total_quote_subtotal</class>
-                        <after>subtotal,nominal,shipping,freeshipping</after>
+                        <after>subtotal,nominal,freeshipping</after>
                         <before>tax,discount</before>
                     </tax_subtotal>
                     <tax_shipping>

image

henrykbrzoska commented 4 years ago

Isn't it dependent on the principles of calculating tax(country of taxation)?

lemundo-team commented 4 years ago

Hi @henrykbrzoska it's actually only on the base principle that subtotal does not contain shipping but shipping may be based on subtotal

lemundo-team commented 4 years ago

@tmotyl @sreichel @idziakjakub we have provided a pull request to solve this issue but it needs to be reviewed: #1104

doejoe13 commented 4 years ago

Hello, got exactly same issue after upgrade from 1.7. Using owebia/magento1-module-advanced-shipping for shipping, rates calculated on weight. Fix suggested by @hannes011 is not working for me. Neither solution from https://community.magento.com/t5/Magento-1-x-Technical-Issues/After-upgrading-from-1-9-3-7-to-1-9-3-9-issue-regarding-shipping/m-p/112864#M9109

doejoe13 commented 4 years ago

My issue was caused by connect20/flywebdesign_paypalfee extension. After removed it, everything is OK.