-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Rounding in auto posting to the nearest cent, to calculate VAT #1092
Comments
Prior art
I would have expected the following to have worked:
|
Is a directive a more natural way to support this use case? The source for hledger's TransactionModifers supports multiplication with a single constant amount, not the evaluation of an expression tree. Altering TransactionModifiers and journal file parsing and more parsing to support even simple expressions is not trivial, and may not be worth the trade-off to complexity / maintainability, just for this use case. Instead, a
|
Thanks @georghendrik. As discussed on IRC, I think this sounds useful enough to be worth doing. A possible quick solution: add simple syntax to the auto posting rules, eg A possible more thorough solution: revive and finish #934 (general amount expressions). Make sure it works in auto posting rules also. Add support for named functions. Add one or more rounding functions. (Top of head "comprehensive" rounding options: round/roundup/rounddown/roundpos/roundneg(N,PLACES) - round N to PLACES decimal places, respectively to the nearest using digit "5" as the cutoff, away from zero, towards zero, in the positive direction, in the negative direction). I don't know where are the beancount rounding discussions I was thinking of, but I remember some talk of other rounding strategies used in the financial world. |
I'm also looking forward for this feature because it screws up my tax reporting as freelancer. |
What are you suggesting?
Hledger support for rounding of auto-posting amounts to the nearest cent.
How would that be useful?
Hledger's current auto-posting / transaction modifiers may assist in automatically calculating VAT and other taxes. However, hledger keeps all decimals for the calculated auto-posting VAT amounts, while e.g. Dutch and German tax law requires rounding of the VAT amounts for every transaction.
The following example.journal may help to illustrate this:
The text was updated successfully, but these errors were encountered: