hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Set subaccount balances to zero on inclusive assignments of zero

Open la-wu opened this issue 2 years ago • 1 comments

Implementation and sample behavioral tests for https://github.com/simonmichael/hledger/issues/1689

la-wu avatar Sep 28 '21 16:09 la-wu

Hi! As a hledger user, I wanted to add my input and note that I'm strongly against this change.

  1. 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.
  2. 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.

wgslr avatar Oct 16 '21 19:10 wgslr