Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 5 tasks
mohammedTBB opened this issue Feb 20, 2024 · 8 comments · May be fixed by #39687
Open
1 of 5 tasks

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

mohammedTBB opened this issue Feb 20, 2024 · 8 comments · May be fixed by #39687
Assignees
Labels
Area: Tax Component: Tax Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.6-p3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@mohammedTBB
Copy link

mohammedTBB commented Feb 20, 2024

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”.
Copy link

m2-assistant bot commented Feb 20, 2024

Hi @mohammedTBB. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented Feb 20, 2024

Hi @engcom-Dash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- 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!

@engcom-Dash
Copy link
Contributor

Hi @mohammedTBB

Thanks for reporting and collaboration.

Verified the issue on magento 2.4 dev instance and the issue is reproducible.

The round is not applied to the price calculation. We are getting wrong order total.

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

Please refer the attached screenshots.

Screenshot 2024-02-21 at 6 40 06 PM Screenshot 2024-02-21 at 7 04 28 PM Screenshot 2024-02-21 at 7 04 38 PM

@engcom-Dash engcom-Dash added Component: Tax Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Tax Reported on 2.4.6-p3 Indicates original Magento version for the Issue report. labels Feb 21, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-11389 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Feb 21, 2024

✅ Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Dash engcom-Dash added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Feb 22, 2024
@mohammedTBB
Copy link
Author

Hi,

Is there any patch available for this error? Any estimated timeline for when the fix might be released?

Thanks and Regards.

@engcom-Hotel engcom-Hotel moved this to Ready for Development in High Priority Backlog Aug 19, 2024
@marctbb
Copy link

marctbb commented Dec 3, 2024

Hello,
Is there any patch available for this error? Any estimated timeline for when the fix might be released? It's important.

Thanks and regards.

@YuriyYavorskiy
Copy link

@magento I am working on this

YuriyYavorskiy added a commit to YuriyYavorskiy/magento2 that referenced this issue Feb 28, 2025
- the mistake was that the amount for non-taxes after the discount came with incorrect rounding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tax Component: Tax Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.6-p3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
5 participants