hledger
hledger copied to clipboard
Set subaccount balances to zero on inclusive assignments of zero
Implementation and sample behavioral tests for https://github.com/simonmichael/hledger/issues/1689
Hi! As a hledger user, I wanted to add my input and note that I'm strongly against this change.
- This is a breaking change, modifying the history of existing journals. If we want the functionality showed in the first post, it should be new operator. I particularly dislike making a specific number (
0
) a magic value. - I use subaccounts for budgeting, which raises instances where the behavior described in #1689 is not what I want. Consider the following balances:
assets:checking 10foo
assets:checking:clothes 200foo
assets:checking:food -200foo
hledger balance --tree checking
will show a total balance of 10foo.
Let's say I look at my bank statement and discover that the checking account balance is in fact 0foo. I will write a balance assignment to correct the value in hledger:
2021-10-16
assets:checking ==* 0foo
equity:reconciliation
In my opinion, the expected behavior is to generate posting in the top-level account to adjust the balance and not touch the subaccounts:
2021-10-16
assets:checking -10foo ==* 0foo
equity:reconciliation
I do not want to loose the sub-account balances, which show that I overspent on food instead of buying clothes.