Skip to content

Wrong Order total, the round is not applied to the price calculation. #38455

Open
@mohammedTBB

Description

@mohammedTBB

Preconditions and environment

  • Magento version: 2.4.6-p3
  • Php version: 8.1
  • Tax Rate configuration (22%)
    taxrate-config
  • Tax configuration
    tax-config
  • Discount configuration (10%)
    discount-config
  • product 1 (hat)
    special price 733.61
  • product 2 (jacket)
    special price 569.67

Steps to reproduce

Two ways to reproduce the error:
Method 1:
1- add product 1 * 3 to the cart
2- add product 2 * 2 to the cart
3- go to the checkout
4- apply the discount and use the country for the tax to be applied
5- create order

Method 2:
1- add product 2 * 2 to the cart
2- add product 1 * 3 to the cart
3- go to the checkout
4- apply the discount and use the country for the tax to be applied
5- create order

Expected result

The function round should be applied when calculating the price_after_discount, discount_amount and taxes amount.
the actual total of the order should be 3667,52.

Actual result

Magento not doing the round function when calculating price_after_discount, discount_amount and taxes amount for the second product added to the cart.
resulting in total 3667,51 when reproducing the error using method 1 and 3667,5 when reproducing the error using method 2.

hat-jacket

jacket-hat

Additional information

Here is the calculation that magento do, column (B+C) for first order, column (D+E) for the second order.
the cells with background yellow where magento miscalculate the price (possibly by not rounding the price).
the correct total is the result of the column (B+E) which are the correct calculations and matches the manual calculations.
calculations

Release note

No response

Triage and priority

  • 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”.

Metadata

Metadata

Labels

Area: TaxComponent: TaxIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.6-p3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions