I'm running a Magento instance of 2.3.6-p1 using PHP 7.3 and having issues with Magento not calculating the discounts correctly.
How I tested
- Set discounts to be applied before tax in the admin
- Set up a cart price rule for 15% ( Apply Percent of product price discount)
- Add multiple of products into your basket and apply the coupon code
- List item
Below is a screenshot from the Magento admin with the incorrect values highlighted
Below is a table with what I believe to be is the correct logic and highlighted cells where I believe Magento is wrong
Below is a screenshot of how tax is setup in the admin
If I update the "Tax Calculation Method Based On" in the admin from "Total" to "Row Total" in Grand total inc tax is still 1p out
If I update the "Tax Calculation Method Based On" in the admin from "Total" to "Unit Price" the Grand total is correct (£53.25) but as you can see in the screenshot below the discount and taxes are all different even when the product prices are the same
Has anyone had any issues like this before and can advise of a fix?