magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.49k stars 9.29k forks source link

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

Open mohammedTBB opened 7 months ago

mohammedTBB commented 7 months ago

Preconditions and environment

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

m2-assistant[bot] commented 7 months ago

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:

m2-assistant[bot] commented 7 months ago

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: :point_down:


engcom-Dash commented 7 months ago

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
github-jira-sync-bot commented 7 months ago

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

m2-assistant[bot] commented 7 months ago

:white_check_mark: 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.

mohammedTBB commented 2 months ago

Hi,

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

Thanks and Regards.