Simplifying multiple year files, closing/opening balances

62 views
Skip to first unread message

Simon Michael

unread,
Dec 28, 2023, 1:44:01 PM12/28/23
to hledger
I have some ideas for making life easier with multiple files and close:


1. Use balance assignments to set opening balances (of assets/liabilities).

Pro: They don't care about the previous balances, so you can include previous year files or not, and they do not require end-of-year closing transactions setting the balances to zero. And you don't have to update them if you fixed a balance in a previous year file.

Con: This gives up some error checking: it does not enforce that these opening balances match the previous year file's closing balances, and will not complain if those change.


2. Optionally, assert balances at end of year. (Instead of zeroing them. Made possible by 1.)

Pro: Catches any disturbances in old data. Documents the year end balances. Can be visually compared with opening balances in the next year file.

Con: You have to update them if txns/balances change (eg from fixing errors or improving bookkeeping entries). This can be very tedious when you have many years / many accounts (eg lot subaccounts) / much refactoring.


The above seem quite doable with current hledger. Is anyone out there doing 1 ? I've always resisted it but I'm going to give it a try. But we could also add this enhancement:


3. "All or nothing" balance assignments. These are a hybrid of current balance assertions and balance assignments: they accept either a zero balance, in which case they act like an assignment (posting the full target amount to reach the target balance), or a balance matching the target, in which case they act

Pro: Like 1, they make previous year files optional and end-of-year closing transactions unnecessary. But also, they provide pretty good error detection. There are probably some possible scenarios which they would not catch, but in combination with 2 those seem rather unlikely.

Con: Another feature, more syntax, another incompatibility with Ledger/Beancount.

Current syntax idea: add ! after the usual balance assignment notation. (So it could be any of: =!, ==!, =*!, ==*!).


Thoughts ?

Simon Michael

unread,
Dec 28, 2023, 1:48:08 PM12/28/23
to hledger
I lost some text there. Reposting the whole thing:


I have some ideas for making life easier with multiple files and close:


1. Use balance assignments to set opening balances (of assets/liabilities).

Pro: They don't care about the previous balances, so you can include previous year files or not, and they do not require end-of-year closing transactions setting the balances to zero. And you don't have to update them if you fixed a balance in a previous year file.

Con: This gives up some error checking: it does not enforce that these opening balances match the previous year file's closing balances, and will not complain if those change.


2. Optionally, assert balances at end of year. (Instead of zeroing them. Made possible by 1.)

Pro: Catches any disturbances in old data. Documents the year end balances. Can be visually compared with opening balances in the next year file.

Con: You have to update them if txns/balances change (eg from fixing errors or improving bookkeeping entries). This can be very tedious when you have many years / many accounts (eg lot subaccounts) / much refactoring.


The above seem quite doable with current hledger. Is anyone out there doing 1 ? I've always resisted it but I'm going to give it a try. But we could also add this enhancement:


3. "All or nothing" balance assignments. These are a hybrid of current balance assertions and balance assignments: they accept either

- a zero balance, in which case they act like an assignment (posting the full target amount to reach the target balance),

- or a balance matching the target balance, in which case they act like an assertion (posting zero)

Chris Ryan

unread,
Dec 28, 2023, 1:51:36 PM12/28/23
to hle...@googlegroups.com
If one maintains just a single, running .journal file, does one ever need to do any closing, retaining of earnings, setting of new balances, and such? If that was all rendered irrelevant, I'd be much in favor of the one-file approach.

Thanks.

--
Chris Ryan
rya...@fastmail.co.uk
> --
> You received this message because you are subscribed to the Google
> Groups "hledger" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hledger+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hledger/E070EF88-C9A4-4EE7-8B58-1AB613E2CA3A%40joyful.com.

Simon Michael

unread,
Dec 28, 2023, 1:52:29 PM12/28/23
to hledger

No you really don't.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hledger/29c4b903-5dae-4b87-952a-ad26787c6ac8%40app.fastmail.com.

Chris Ryan

unread,
Dec 28, 2023, 10:21:12 PM12/28/23
to hle...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages