VAT is 145.38 and Order Total Exclusive of Tax is 907.62.
I am facing same issue in magento 2.1.5 basic installation also.
16% VAT is applied for products and shipping charge.
Apply to Shipping Amount is YES for Coupon code OFFER10
Please check the attached image
Please check this issue ASAP. I cant able to go to live due to this major issue.
Nobody faced this issue before..?? Please check and fix this issue asap.. Or guide me to do a fix
I have the same issue on Magento 2.1.5 :
If I have :
subtotal : 10,00 $ including tax
shipping: 5 $ including tax
tax : 20 %
discount: 15 $
I still have to pay 0.85 $ (tax amount of my shipping fees)
I have the same issue on Magento 2.1.6
Has a fix been pushed for this yet? Can you help @ishakhsuvarov , it is really quite urgent and pressing that this is sorted
@thomasnordkvist, @Pigau, @sudheeshks, any of you guys found a solution?, or have found a temporary workaround/hack?
@gold2040 I am not aware of any solution implemented by now. Did you check if issue exists in the develop
branch?
Please upvote the issue, it may speed up the process.
Thank you.
Related to #10067 ?
@sudheeshks, thank you for your report.
We've created internal ticket(s) MAGETWO-75553 to track progress on the issue.
ill try to give it a go
the issue is related with the setting at Stores > Configuration > Sales > Tax
When do filling in the Tax class for shipping the calculations are correct
**Calculations with shipping 0%**
Product - excl = 1000
Product - Incl = 1160
Shipping - excl = 5
Shipping - incl = 5
Discount - product = 116
Discount - shipping = 0,5
Discount - Total Excl = 100,5 (10% of the Product-excl + 10% Shipping-excl)
Discount - Total Incl = 116,5
Total Excl = 1000 + 5 - 100,5 = 904,5
Total Incl = 1160 + 5 - 116,5 = 1048,5
Total Tax = Total Incl - Total Excl = 144
**Calculations with shipping 16%**
Product - excl = 1000
Product - Incl = 1160
Shipping - excl = 4,31
Shipping - incl = 5
Discount - product = 116
Discount - shipping = 0,5
Discount - Total Excl = 100,43 (10% of the Product-excl + 10% Shipping-excl)
Discount - Total Incl = 116,5
Total Excl = 1000+4,31-100,43 = 903,88
Total Incl = 1160 + 5 - 116,5 = 1048,5
Total Tax = Total Incl - Total Excl = 144,62
in both situations it calculates the TAX correctly (given into account that the discount excl amount has 2 tax classes, 1 for the product and a different one for the shipping part)
When not setting the Tax class for shipping (default option), the function getShippingTaxClass in Magento\Tax\Model\Config will return 0. Because 0 is not a valid tax-class the calculation is doing something that it is not supposed to.
Once you set a value for the shipping tax and you want to reproduce the original problem, the default option follows the last know configuration so it could also be a default db setting problem. (WIP)
Has this been Fixed yet in Latest magento verson ?
Is there already a solution for this? Fix/Patch...
Discount w/ and w/o tax has been buggy since Magento 1 (and it is still Buggy as of Mage 1.9.3.8).
I really had trouble sorting this out a few years back.
This and the no-duplicate issue is blocking me from upgrading to Mage 2.x
Any update on this yet, Please!?
This is quite annoying that how such a critical issue can be opened for 18th months since its reported. Many people are facing issue with Tax calculation and loosing their customer. The same problem is with shopping cart price rules also.
Hi,
I have tried this and it seems to be working.
Magento\SalesRule\Model\Validator::processShippingAmount(Address $address)
from
$shippingAmount = $address->getShippingAmountForDiscount();
if ($shippingAmount !== null) {
$baseShippingAmount = $address->getBaseShippingAmountForDiscount();
} else {
$shippingAmount = $address->getShippingAmount();
$baseShippingAmount = $address->getBaseShippingAmount();
}
to
$shippingAmount = $address->getShippingAmountForDiscount();
if ($shippingAmount !== null) {
$baseShippingAmount = $address->getBaseShippingAmountForDiscount();
} else {
$shippingAmount = $address->getShippingInclTax();
$baseShippingAmount = $address->getBaseShippingInclTax();
}
Thanks!
@magento give me 2.3-develop instance
Hi @marcusirgens. Thank you for your request. I'm working on Magento 2.3-develop instance for you
Hi @marcusirgens, here is your Magento instance.
Admin access: https://i-8964-2-3-develop.instances.magento-community.engineering/admin
Login: admin
Password: 123123q
Instance will be terminated in up to 3 hours.
Confirming this issue is still valid on 2.3-develop.
Expected result:
A discount that also applies to shipping costs will correctly apply:
For a flat rate shipping with a cost of 100 including 25% VAT (20), the shipping price when applying a 50%
cart rule should be 50, with 10 being the tax amount
Actual result
The discount is 60, with 20 being the tax amount.
The change proposed by @bawwwa is close to the solution that I found.
The issue seems to be that in the Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector::processShippingTaxInfo() method, Magento sets the "shipping_amount_for_discount" and "base_shipping_amount_for_discount" values on the total object, whereas in Magento\SalesRule\Model\Validator::processShippingAmount() Magento tries to read those values from the address.
Since the processShippingAmount() method does not receive the total object, I fixed the issue in the caller method, Magento\SalesRule\Model\Quote\Address\Total\ShippingDiscount::collect() by manually copying the values from the total to the address.
I added the lines:
$address->setShippingAmountForDiscount($total->getShippingAmountForDiscount());
$address->setBaseShippingAmountForDiscount($total->getBaseShippingAmountForDiscount());
just before the line
$this->calculator->processShippingAmount($address);
Same issue on 2.3.2 :(
The discount calculation on shipping cost is wrong whit a percent discount.
Ex :
Cart 10€ inluding tax
Delivery 10€ including tax
Tax 20% on products and shipping
Discount 20%
Settings :
Expected result :
Price after discount : 16€
= 20 - 10x0,2 - 10x0,2
[Total] - [Price tax included] x 20% - [Shipping tax included] x 20%
Actual result :
Price after discount : 16,40€
= 20 - 10x0,2 - 8x0,2
[Total] - [Price tax included] x 20% - [Shipping without tax] x 20%
Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
any news on when the fix would be available for ordinary users?
Most helpful comment
The change proposed by @bawwwa is close to the solution that I found.
The issue seems to be that in the Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector::processShippingTaxInfo() method, Magento sets the "shipping_amount_for_discount" and "base_shipping_amount_for_discount" values on the total object, whereas in Magento\SalesRule\Model\Validator::processShippingAmount() Magento tries to read those values from the address.
Since the processShippingAmount() method does not receive the total object, I fixed the issue in the caller method, Magento\SalesRule\Model\Quote\Address\Total\ShippingDiscount::collect() by manually copying the values from the total to the address.
I added the lines:
just before the line
$this->calculator->processShippingAmount($address);