hledger

Date
Tags finance, hledger, howto
Deprecated By personal-finance
Target Audience Mostly me, & possibly personal finance nerds.
Epistemic Status Documents how I used to do things, doesn't attempt to speak more generally than that.
Attention Conservation Notice You may get something out of this if you're rethinking how you manage your finances.

Since about June 2016 I have been using hledger to track my fin­ances. How I do so has evolved, this memo doc­u­ments the cur­rent pro­cess.

Pros:

Cons:

Journal Files

My journal files are shared with sync­thing, so I can add trans­ac­tions from any ma­chine.

I have a few files:

Ac­counts

I have a number of ac­counts, some few of which are ac­tual ac­counts (in bold), but most of which are “vir­tual” ac­counts (in it­alic), which I use to get better in­sights into the flow of my money.

Trans­ac­tions

Trans­ac­tions are of the form:

$MONTH/$DAY $PAYEE
    $POST­ING­S...

Trans­ac­tions purely between vir­tual ac­counts get a ! between the date and the de­scrip­tion. Trans­ac­tions re­con­ciled at the end of the month get a *.

Budgeting

The “ac­cum” and “month” vir­tual ac­counts are the most im­port­ant, as they give me a con­stant aware­ness of how much I have spent on a par­tic­ular class of thing. I don’t often ex­ceed my budget, be­cause when I go to spend some budgeted money there’s now a little voice in the back of my mind which asks “can you ac­tu­ally af­ford this?”.

There are five “month” ac­counts which get set to a fixed value at the start of each month:

And there are two “ac­cum” ac­counts which get a fixed amount trans­ferred to them at the start of each month (ac­cu­mu­lating un­spent money):

Fore­casting

I use a re­l­at­ively simple fore­casting pro­cess. For every month up until the end of the year (or maybe until the middle of the next year, if we’re near the end of this one), I add trans­ac­tions:

This gives me a reas­on­ably ac­cur­ate, per­haps slightly pess­im­istic, fore­cast of my fin­ances. The con­fid­ence threshold for in­cluding ex­penses is lower than for in­cluding in­come, which is pess­im­istic; but I as­sume I will never over­spend my budget, which is typ­ical but not cer­tain.

An Ex­ample Month

Here is the sort of thing that will go in a monthly entry. Of course some things, like rent and tu­ition, will be more or less fre­quent than oth­ers:

10/01 Budget & Saving
    ac­cum:fun           £25
    ac­cum:other         £75
    month:­food        £200
    month:­google apps   £2.75
    month:­house­hold    £25
    month:servers      £39.50
    saved:in­vest      £400
    un­al­loc­ated

10/01 Linode
    ex­penses:servers  $20 @@ £18
    ex­penses:servers          £1.25
    month:servers

10/01 OVH
    ex­penses:servers  EUR 20.39 @@ £18.05
    ex­penses:servers                £1.25
    month:servers

10/02 Arch Hurd Google Apps
    ex­penses:­google apps  £2.75
    month:­google apps

10/06 Dad money
    un­al­loc­ated  £650
    in­come:dad

10/07 Hol­gate rent
    ex­penses:rent  £1045
    saved:rent

10/24 Dentist
    ex­penses:other  £18.80
    un­al­loc­ated

10/31 Tu­ition
    ex­penses:tu­ition  £1398
    saved:tu­ition

Most months are the same, so adding these sets of trans­ac­tions for every month re­maining in the year takes very little time.

Start/End of X Pro­cedure

Year

  1. Zero all ac­counts by trans­fer­ring everything into equity.
  2. Re­name the cur­rent journal file from “cur­rent.­journal” to “$YEAR.­journal”
  3. Take the “fu­ture.­journal” and re­name to “cur­rent.­journ­al”.
  4. Add fore­casting trans­ac­tions for the new year
  5. Ini­tialise all ac­counts on the first of January by trans­fer­ring from equity.

If starting a new journal file, this is the tem­plate:

alias cur­rent = as­set­s:cash:sant­and­er­:­cur­rent
alias budget  = cur­rent:­month
alias saved   = cur­rent:saved
alias accum   = cur­rent:accum
alias un­al­loc­ated = cur­rent:un­al­loc­ated

* $YEAR
Y$YEAR
** $YEAR-01 January
** $YEAR-02 Feb­ruary
** $YEAR-03 March
** $YEAR-04 April
** $YEAR-05 May
** $YEAR-06 June
** $YEAR-07 July
** $YEAR-08 Au­gust
** $YEAR-09 September
** $YEAR-10 Oc­tober
** $YEAR-11 November
** $YEAR-12 December

Here are ex­ample equity trans­ac­tions:

01/01 ! Start-of-year (as­sets)
    as­set­s:cash:hand                £77.81
    as­set­s:reim­burse­ment­s:nathan     £9.98
    saved:rainyday                  £74.90
    saved:rent                    £1800
    saved:tu­ition                 £2060
    un­al­loc­ated                    £904.92
    equity:­car­ried for­ward

01/01 ! Start-of-year (li­ab­il­it­ies)
    li­ab­il­it­ies:over­draft   -£2000
    li­ab­il­it­ies:slc        -£28510.01
    li­ab­il­it­ies:teasoc         -£1
    equity:li­ab­il­ities

Month

  1. Re­con­cile the trans­ac­tions of the month just ended:
    • For every trans­ac­tion in the on­line bank state­ment, find the cor­res­ponding journal trans­ac­tion and mark it.
      • If there are trans­ac­tions missing from the journal, add and mark them.
      • If there are trans­ac­tions missing from the bank state­ment, the bank is being slow; add posting dates and re­con­cile as they come in.
      • If the bank bal­ance is below the as­set­s:cash:sant­and­er­:­cur­rent bal­ance, even dis­carding un­cleared trans­ac­tions, (a) figure out what happened and (b) if im­possible, add a trans­ac­tion to ex­penses:­ad­just­ment
    • Count the bal­ance in my wallet and mark all as­set­s:cash:hand trans­ac­tions.
      • If the wallet bal­ance is below the as­set­s:cash:hand bal­ance, add a trans­ac­tion to ex­penses:­ad­just­ment
  2. Zero the monthly budget by adding trans­ac­tions to the month just star­ted:
    • Transfer “month” ac­counts into un­al­loc­ated
    • If there was an over­spend, zero by trans­fer­ring from un­al­loc­ated
  3. De­lete the pess­im­istic budget-spending trans­ac­tion of the month just star­ted.
  4. Com­ment all trans­ac­tions in the month just started other than the budget set-up.
    • Un­com­ment these as they hap­pen. From now, the bal­ance re­ported for the cur­rent month is the cur­rent ac­tual bal­ance.

Here are ex­ample en­d-of-­month trans­ac­tions:

03/31 * Wallet ad­just­ment
    ex­penses:­ad­just­ment  £14.98
    as­set­s:cash:hand

04/01 ! Re­maining budget
    month:­food        £24.70
    month:fun        £112
    month:­house­hold   -£9.12
    month:servers     -£2.01
    month:anything

04/01 ! Budget over­spend
    month:anything  £125.57
    un­al­loc­ated

Ideally, there should be no trans­ac­tion ad­justing the bal­ance.