On 2015-09-08 07:27:47 +0000, Guillaume Chéreau said:
> Maybe my way of putting an adjustment transaction at the top of each
> year is bad practice? But in that case how is the correct way to do it?
Below I explain how I do it (pasting from one of the commits in my repo).
The TLDR is that you generate an equity report at the end of each year.
"Keep a folder for each year. Each folder is completely independent,
and contains the files for a single year. Then, there is a main.ledger
file in the top folder, which is the file that is normally used in ledger
commands. So, the overall structure is as follows:
./main.ledger
./2014/journal.ledger
./2014/equity.ledger
./2014/accounts.ledger
./2014/payees.ledger
./2014/tags.ledger
./2014/budget.ledger
./2014/...
./2015/journal.ledger
./2015/equity.ledger
./2015/accounts.ledger
./2015/payees.ledger
./2015/tags.ledger
./2015/budget.ledger
./2015/...
The content of main.ledger is just:
; -*- ledger -*-
include 2015/journal.ledger
That is, main.ledger includes the latest journal (of course, this
must be updated once a year).
2015/journal.ledger starts as follows:
; To make this folder completely self-contained, comment out
; the first include below and uncomment the second one.
include ../2014/journal.ledger
;include equity.ledger
; Include this year's additional files
include accounts.ledger
include budget.ledger
...
That is, each YYYY/journal.ledger starts by including the previous
year's journal.
An important file is equity.ledger. To get the equity report for
a given year (say, 2015), use:
ledger -f 2014/journal.ledger --effective -y '%Y/%m/%d' equity
>2015/equity.ledger
Note that you get the equity for a given year from the journal
of the previous year. The --effective option is necessary if
there are transactions across different years (e.g., with actual
date '2014/12/31' and effective date '2015/1/1'), otherwise the
balances won't match, for example, your bank statement.
To archive or throw away files, say, before 2010, just open
2011/journal.ledger and replace the include of the previous year's
ledger with the include of equity.ledger (see above). You might
have to add the accounts appearing in equity.ledger to the current
accounts."
A last important note: it is imperative that you *never* use the same
account in both real and virtual transactions, otherwise you will get
an error upon trying to generate an equity report. This has been
previously discussed in this list, but I don't recall the title of the
thread(s).
Enjoy,
Life