Description
Preconditions (*)
- Vanilla Magento Community 2.4.3-p1 with Sample Data
- The following settings are applied:
tax/cart_display/subtotal =>3
tax/cart_display/price =>3
tax/calculation/apply_after_discount => 1
Steps to reproduce (*)
- Set Default Tax applied to products with Tax Class “Taxable Goods“ to 20%
- Create a test product with a Price of 100$ and Tax Class “Taxable Goods”
- Create Cart Price Rule with Coupon “Fix5” which provides a discount of 5%
- Go to the storefront and add the Test product to the shopping cart
- Proceed to the Payment Method Step
- Verify the totals
Expected result (*)
Totals
Cart Subtotal Excl. Tax: $100.00
Cart Subtotal Incl. Tax: $119.00
Discount (fix5): -$5.00
Shipping Flat Rate - Fixed: $5.00
Tax: $19.00
Order Total: $119.00
Quote Item Data
select sku, name, qty, base_price, tax_amount, base_price_incl_tax, base_row_total, base_row_total_incl_tax
from quote_item
where quote_id = 3;
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
|sku |name |qty |base_price|tax_amount|base_price_incl_tax|base_row_total|base_row_total_incl_tax|
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
|Sample_100_dollar_product|Sample 100$ product|1.0000|100.0000 |19.0000 |119.0000 |100.0000 |119.0000 |
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
Actual result (*)
Totals
Cart Subtotal Excl. Tax: $100.00
Cart Subtotal Incl. Tax: $120.00
Discount (fix5): -$5.00
Shipping Flat Rate - Fixed: $5.00
Tax: $19.00 Order
Total: $119.00
Quote Item Data
select sku, name, qty, base_price, tax_amount, base_price_incl_tax, base_row_total, base_row_total_incl_tax
from quote_item
where quote_id = 3;
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
|sku |name |qty |base_price|tax_amount|base_price_incl_tax|base_row_total|base_row_total_incl_tax|
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
|Sample_100_dollar_product|Sample 100$ product|1.0000|100.0000 |19.0000 |120.0000 |100.0000 |120.0000 |
+-------------------------+-------------------+------+----------+----------+-------------------+--------------+-----------------------+
Cart Subtotal Incl. Tax is not correlating to the subtotal and final tax.
Reference
According to the following documentation, the actual tax amount is expected to be added to the subtotal instead of the original: https://docs.magento.com/user-guide/configuration/sales/tax.html
The place to fix the issue in the source code:
The following code:
$rowTotalInclTax = $rowTotal + $rowTaxBeforeDiscount;
Should be:
$rowTotalInclTax = $rowTotal + $rowTax;
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.