-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
(WIP) Initial Work to per-currency rounding feature. #1478
base: main
Are you sure you want to change the base?
Conversation
Don't know if this also solve add comma to currencies and cart resetting for guests users when logged in? |
I assume the first part is this issue: #1344, which is separate from the intentions of this PR. But as I previously explained, the cart issue will remain a problem until we rewrite the behavior of the cart module |
VALUES | ||
(1,'US Dollar','USD',1,1.000000,'${{price}}','1','2022-12-01 12:00:00','2022-12-01 12:00:00'); | ||
(1,'US Dollar','USD',1,1.000000,'${{price}}','1','1','2022-12-01 12:00:00','2022-12-01 12:00:00'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USD should be rounded to 0.01
(2,'Euro','EUR',0,0.600000,'€{{price}}','1','2022-12-01 12:00:00','2022-12-01 12:00:00'), | ||
(3,'Pound Sterling','GBP',0,0.600000,'{{price}} ₤','1','2022-12-01 12:00:00','2022-12-01 12:00:00'); | ||
(1,'US Dollar','USD',1,1.000000,'${{price}}','1','1','2022-12-01 12:00:00','2022-12-01 12:00:00'), | ||
(2,'Euro','EUR',0,0.600000,'€{{price}}','1','1','2022-12-01 12:00:00','2022-12-01 12:00:00'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
and for pounds
If we want to add an test case we should add:
https://en.wikipedia.org/wiki/Hungarian_forint
As it should rounded to "whole" forint..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a remainder of before I cut a step in the calculations. It should be 0.01 ofc, but as I said, before the cart rewrite, I'm not touching this feature, as the cart / order currently calculate VAT in the template, instead of the business logic. This means f.Ex that the calculations would need to be changed in every theme.
This should also fix #1344 because of the format changes when it's done. |
Does it actually? That issue said it only happens in some places, suggesting it's a front-end issue where the proper money formatting isn't being applied |
b08f65b
to
b94d932
Compare
This implements a "rounding precision" for currencies that don't round to two decimals. (Specifically, CHF)
In the field "Rounding precision", you can set the next decimal the program should round to.
Currently, only rounding down works, but implementing "bank" rounding is also on the to-do list.
I've decided to pause working on this and instead clean up the cart / order button functionality before, as currently, rounding not only happens in
ServiceInvoiceItem.php
(in the functiongetTotalWithTax
), but also in the twig template of the checkout process.It's important to have a set of core functionalities to process business logic, and the checkout process needs rewriting to make use of that. Before that isn't done, rounding isn't a pressing issue.