What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi all.. I've seen some things... But this one is new. This is the OrderConfirmationMail, 3 items of
Hi all..
I've seen some things... But this one is new.
This is the OrderConfirmationMail, 3 items of the same type.
I directly access the items within the orderEntity and access all of them with the same method. Can anyone explain, why they are varying? 🙄
I wouldn't expect that the calculation varies at the same calculation (in every case +19%)
Comments
-
Spryker has a pretty uncommon summing, where it tries to distribute the tax evenly and keeps a rest if that is not possible, which gets added add the end. I don’t remember if the rest was distributed among items as well.
But the sum should be correct.
It’s just a blind guess as the whole calculation stack is pretty complex and hard to diagnose without debugging through it.
0 -
That's indeed uncommon, but would explain it. Thank you!
0 -
@ULL0N440J the reasons most likely are following:
1. Tax distribution is needed, to handle returns/refunds properly. If one item out of 3 is returned, you would want to refund 1/3 of a tax as well
2. The difference you see is explained correctly by Alberto, the reason is - the so-called “missing cent” issue, when you try to divide let’s say 10$ between 3 items, you will get 0.33 after rounding and 0.01 will be missing, so you gonna get total mis-match. That’s why the left-over will be either distributed also evenly, until total matches0 -
you can check
TaxFacade::getAccruedTaxAmountFromGrossPrice()
for more insights
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 74 Spryker News
- 911 Developer Corner
- 771 Spryker Development
- 87 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 25 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random