You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a short term for "multiple files used to cover different time periods" (as distinct from multiple files split up in some other way, like by account). I'll call them "periodic files" unless we find something better.
We need language to distinguish between
opening and closing an account (beginning and ending its lifetime; like beancount's open and close directives)
starting and ending a periodic journal file (eg setting year-start balances, asserting year-end balances, etc)
From here I'll try to use these four terms (open, close, start, end) as above, where possible. Though, "open"/"close" are pretty baked in to the close command right now.
Can we simplify the process of starting a new file ?
We want to represent correct asset/liability (and possibly equity) balances at all times:
from the start of the earliest periodic file, reflecting the existing balances when we started bookkeeping
through the transitions from one periodic file to the next
when processing just one of the files
or when processing several or all of them in sequence.
The current common method, start/end transactions (A)
assume all balances are initially zero
in a special starting balances transaction, post the exact starting balances
and immediately assert those same balances, verifying them (and 1).
If you combine multiple periodic files, all but the earliest starting balances are redundant and excessive. So we also
At the end of each periodic file except the latest, in a special ending balances transaction, post the negative of the ending balances. This cancels out the redundant starting balances transaction which will follow in the next file.
We balance these starting/ending balances with an equity account, call it equity:start. If migrating equity balances along from one file to the next: we must always exclude equity:start, otherwise it would accumulate redundantly and cause an incorrect equity balance.
We also need to
exclude the ending balances transaction when we want to see end of year balances in past years (otherwise they all appear zero)
and may want to
exclude starting/ending transactions from register reports.
An alternate method, balance assignments (B)
In a starting balances transaction, assign (set) the balances to the correct starting balances. This doesn't require initially zero balances; it posts whatever amounts are necessary to reach the correct starting balances.
At the end of each periodic file except the latest, assert the ending balances (without changing them), to provide some error checking. The asserted ending balances and the assigned starting balances in the next file could also be visually compared.
A possible future method, smarter balance assignments (C)
Use a new kind of balance assignment that succeeds only if the existing balance is either exactly zero or exactly the correct balance already. This would provide more error checking than B.
New directives (D)
A new directive, like start-balances, would be more semantically correct (in the real world, there are no transactions when you end a data file and start a new one) and could improve usability.
There could be a corresponding, usable end-balances directive.
These could perhaps detect more errors than the previous methods, eg enforcing "no postings are allowed after a file's end-balances or before a file's start-balances".
(Though, most likely these would mainly be syntactic sugar for transactions, since we understand how those work, and other semantics would require many things be resolved, such as how sequencing works.)
More on this below.
Which method is best ?
My rationale for B or C was that they would be easier to use than A, requiring less busywork when you need to change old balances/accounts/journal entries (to fix mistakes, or improve your bookkeeping, eg) and propagate the effect of those changes through subsequent files. (This is especially noticeable if you track lots of accounts and gets worse over time as you accumulate more files.)
B/C also have this advantage over A: they let you select non-contiguous periodic files, so eg you could process just 2020 and 2024 and still see correct balances in those years.
But B/C have a problem. Assuming the starting balance assignments are balanced transactions (1.1), the balancing equity:start account accumulates excessively with each new file, because there's no corresponding ending balances transaction to prevent it.
To avoid this, we could use unbalanced postings to assign starting balances (1.2). But this violates the Accounting Equation so we would then no longer be able to achieve A+L+E = 0 in reports.
This could be avoided by having the earliest starting balance transaction be balanced, and the ones in later files unbalanced (1.3). But this does not fit the goal of being able to freely choose one, a subset, or all of the files.
Requirements
To review: We'd like to have
correct balances always
flexibility in choosing one or more files to process
good error checking
preservation of the accounting equation
minimal interference with reports, ideally
Method A (posting starting balances and zeroing out ending balances in each file) achieves 1-4. Is it the only way ? Is there really no other solution ?
What other improvements could be made to close ?
Proposals
Try to move towards "start"/"end" terminology for file-start/file-end balances, leaving "open"/"close" more free for account opening/closing
Change the defailt "equity:opening/closing balances" account name to "equity:start"
Change the default close --close description to "end balances"
Change the default close --open description to "start balances"
By default, close just assets and liabilities, not equity
If the user includes equity (eg with close type:ALE), still exclude equity:start (or their chosen --close-acct)
Improve docs and examples
Have close add the start: tags, with the new file's base name as the value, automatically
Provide an easier way to ignore all start/end balances transactions but the first. Just do that always ? Just in the bs/bse reports ?
Make is report always ignore retain: transactions ?
Make --infer-equity also do what close --retain does, so it can infer both conversion equity postings and a final retained earnings equity transaction. If needed, also make these available separately as --infer-conversion-equity and --infer-retained-equity. It should be easy to check the accounting equation at any time with bse --infer-equity or possibly just bse
Make sure --infer-equity also works with close, reducing the number of commands in the multi-year example from 4 to 2. Adding conversion equity postings to transactions would require overwriting the journal file, but perhaps it could add them as a new transaction instead ?
Add a -w/--write flag that appends to or creates both files, reducing the number of commands for a full close and migration to 1
Here are a few thoughts aimed at better user experience around starting new files periodically, eg each year. Discussion welcome.
Some context
Terminology
We need a short term for "multiple files used to cover different time periods" (as distinct from multiple files split up in some other way, like by account). I'll call them "periodic files" unless we find something better.
We need language to distinguish between
From here I'll try to use these four terms (open, close, start, end) as above, where possible. Though, "open"/"close" are pretty baked in to the
closecommand right now.Can we simplify the process of starting a new file ?
We want to represent correct asset/liability (and possibly equity) balances at all times:
The current common method, start/end transactions (A)
If you combine multiple periodic files, all but the earliest starting balances are redundant and excessive. So we also
We balance these starting/ending balances with an equity account, call it equity:start. If migrating equity balances along from one file to the next: we must always exclude equity:start, otherwise it would accumulate redundantly and cause an incorrect equity balance.
We also need to
and may want to
An alternate method, balance assignments (B)
A possible future method, smarter balance assignments (C)
New directives (D)
start-balances, would be more semantically correct (in the real world, there are no transactions when you end a data file and start a new one) and could improve usability.end-balancesdirective.Which method is best ?
My rationale for B or C was that they would be easier to use than A, requiring less busywork when you need to change old balances/accounts/journal entries (to fix mistakes, or improve your bookkeeping, eg) and propagate the effect of those changes through subsequent files. (This is especially noticeable if you track lots of accounts and gets worse over time as you accumulate more files.)
B/C also have this advantage over A: they let you select non-contiguous periodic files, so eg you could process just 2020 and 2024 and still see correct balances in those years.
But B/C have a problem. Assuming the starting balance assignments are balanced transactions (1.1), the balancing equity:start account accumulates excessively with each new file, because there's no corresponding ending balances transaction to prevent it.
To avoid this, we could use unbalanced postings to assign starting balances (1.2). But this violates the Accounting Equation so we would then no longer be able to achieve A+L+E = 0 in reports.
This could be avoided by having the earliest starting balance transaction be balanced, and the ones in later files unbalanced (1.3). But this does not fit the goal of being able to freely choose one, a subset, or all of the files.
Requirements
To review: We'd like to have
Method A (posting starting balances and zeroing out ending balances in each file) achieves 1-4. Is it the only way ? Is there really no other solution ?
What other improvements could be made to
close?Proposals
close --closedescription to "end balances"close --opendescription to "start balances"closejust assets and liabilities, not equityclose type:ALE), still excludeequity:start(or their chosen--close-acct)bse --infer-equityor possibly justbse