-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Event: distributed-cdDistributed Contribution DayDistributed Contribution DayFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 release
Description
Setting up tax a rule and applying 100% discount in the shopping cart results in a negative grand total.
Preconditions
- Magento 2.1.7
Steps to reproduce
Admin setup
- Create product A with price = 2 762,71
- Create product B with price = 2 542,37
- Setup tax rule 18%
- Create coupon code that adds 100% discount.
Front-End
- Add both products to the cart with qty = 2
- Apply coupon code
Expected result
- Grand total (without shipping yet calculated) = 0
Actual result
- Grand total is -0,01
Calculating by hand
Product | Qty | Price | Row total | Row Tax |
---|---|---|---|---|
A | 2 | 2762,71 | 5525,42 | 994,5756 |
B | 2 | 2542,37 | 5084,74 | 915,2532 |
Total | Expected Amount |
---|---|
subtotal | 10610,16 |
tax | 1909,8288 |
How Magento calculates it
Putting a debugger at Magento\Quote\Model\Quote\Address\Total\Grand we could see:
Tax amount is rounded and it makes the total sum to be 10610,16 + 1909,83 - 12520 = -0,01
korostiikorostii
Metadata
Metadata
Assignees
Labels
Event: distributed-cdDistributed Contribution DayDistributed Contribution DayFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 release