Tags: ledger

RSS - Atom - Subscribe via email

Keeping (financial) score with Ledger

| finance

I’ve used Ledger CLI to keep track of my finances since 2005, when I moved to Canada. I like the plain-text approach, and its support for virtual envelopes means that I can reconcile both my bank account balances and my virtual allocations to different categories. Here’s how we use those virtual envelopes to manage our finances separately.

Every month, I have an entry that moves things from my buffer of living expenses to various categories, including an allocation for household expenses. W- doesn’t ask for a lot, so I take care to be frugal with the difference between that and the cost of, say, living on my own. The way we handle it is that I cover a fixed amount, and this is credited by whatever I pay for groceries. Since our grocery total is usually less than the amount I budget for household expenses, any difference just stays on the tab. I used to write him cheques to even it out, but lately I just pay for the occasional additional large expense.

Here’s a sample envelope allocation:

2014.10.01 * Budget
  [Envelopes:Household]  $500
  ;; More lines go here

Here’s one of the envelope rules set up. This one encourages me to classify expenses properly. All expenses are taken out of my “Play” envelope.

= /^Expenses/ 
  (Envelopes:Play)  -1.0

This one reimburses the “Play” envelope for household expenses, moving the amount from the “Household” envelope into the “Play” one.

= /^Expenses:House$/
  (Envelopes:Play)   1.0
  (Envelopes:Household)  -1.0

I have a regular set of expenses that simulate the household expenses coming out of my budget. For example, here’s the one for October.

2014.10.1 * House
  Assets:Household  $-500

And this is what a grocery transaction looks like:

2014.09.28 * No Frills
  Assets:Household:Groceries  $70.45
  Liabilities:MBNA:September  $-70.45

Then ledger bal Assets:Household will tell me if I owe him money (negative balance) or not. If I pay for something large (ex: plane tickets, plumbing), the regular household expense budget gradually reduces that balance.

I picked up the trick of adding a month label to my credit card transactions from W-, who also uses Ledger to track his transactions. It lets me doublecheck the balance of a statement and see if the previous statement has been properly cleared.

It’s a bit of a weird use of the assets category, but it works out for me mentally.

Using Ledger to track it in this way lets me keep track of our grocery expenses and the difference between what I’ve actually paid and what I’ve budgeted for. If I end up spending more than I expected, I can move virtual money from more discretionary envelopes, so my budget always stays balanced.

Ledger’s a powerful tool. Pretty geeky, but maybe more descriptions of workflow might help people who are figuring things out!

View or add comments

Check out these getting started guides – suggest more!

Posted: - Modified: | learning, sketches, tips

I’ve been making little one-page guides to help people learn about topics. It turns out they’re fun to make. =) Click on the images for larger versions. Feel free to print out/share!

How can you get started with visual note-taking?


Getting started with mind-mapping

2013-11-14 Getting started with mind-mapping

Getting started with bulk cooking

2013-11-12 Get started with bulk cooking

Getting started with Ledger

2013-11-12 Get started with Ledger

There’s this one about Emacs too, of course. =)

What else should I write/draw from a beginner’s point of view?  Comment and suggest!

Want to give it a try? Think about something you’ve learned, and draw a one-page beginner’s guide for it. (I’d love to see it!)

View or add comments

Emacs: Recording ledger entries with org-capture-templates

Posted: - Modified: | emacs
Updated 2014-05-26: Thanks to Greg for the updated link to https://github.com/ledger/ledger/wiki !

I use John Wiegley’s ledger program to keep track of my personal finances. It’s quick, it’s light, and it lets me slice-and-dice my data however I want. I enjoy opening my ledger file and adding transactions to it. (Particularly if it involves income!) Yes, I’m that kind of weird.

I wanted to make it even easier to add entries. Instead of using C-x C-f to find the file, using ESC > to go to the end of the buffer, and typing in the transactions, I decided to add some of my common transactions to org-capture-templates. Here’s the relevant snippet:

(setq org-capture-templates
      (append '(("l" "Ledger entries")
                ("lm" "MBNA" plain
                 (file "~/personal/ledger")
                 "%(org-read-date) %^{Payee}
  Expenses:%^{Account}  %^{Amount}
                ("lc" "Cash" plain
                (file "~/personal/ledger")
	        "%(org-read-date) * %^{Payee}
  Expenses:%^{Account}  %^{Amount}

I’ve bound org-capture to C-c r using (global-set-key (kbd "C-c r") 'org-capture), so now I can use C-c r l m to create an entry for my MBNA Mastercard. This keyboard shortcut might not seem short to you, but if you think about it as C-c remember ledger Mastercard, it makes perfect sense. =) (Besides, org-capture prompts me just in case I forget.)

Hooray for org-capture!

View or add comments

I so rock =)

| wickedcoolemacs, writing

I have about 41 pages for my current chapter on taking notes in Emacs, and I still have to write the introduction and wrap-up sections. This means that I’ll need to do some more editing. It’s clearly time to apply another piece of advice from the wonderful book How to Write Fast (While Writing Well), by David Fryxell: don’t over-write, because the time you waste writing more than necessary and then editing down to the required length could be spent writing about something else!

I also rock because I’m getting the hang of writing macros for OpenOffice.org. Basic is not my favorite language and OpenOffice.org macro programming is sufficiently obscure that it’s hard to find examples of what I want to do. OOoMacros.org helped me learn enough to write a few more functions to make my writing life better. I wrote two new functions today: one to mark up wingdings in my code, and another to mark up the source code examples. Both save me lots of tedious work. The wingding function replaced all instances of (1), ;; (1), (2), ;; (2), until (9) and ;; (9) with the corresponding wingding. The example function marked up everything enclosed in <example>..</example> tags, formatting the first and last lines in a different style and using a single-line code style for short examples. Between that and the two functions I’d previously written to format about 80% of my command and keyboard shortcuts, editing is just so much better.

It seems that most people don’t tinker with their tools. I like doing so. I like getting to know what I can do with a tool and how far I can push it. This can be frustrating sometimes (I spent all afternoon trying to get Emacs to play nicely with other weblogs!), but most of the time, it’s both fun and useful. Not only am I saving myself time, I’m also exercising my brain and opening opportunities for other hacks down the line. This is good.

Oh! And W- is giving Ledger a try. The tool he’d been using to keep track of finances dropped some more of his data recently. Because it’s all magic inside, he couldn’t figure out what happened. I’d been going on about how awesome Ledger is, this command-line double-entry accounting tool that provides no bells or whistles but with which I can do all sorts of crazy things. He described how he wanted to budget, and I showed him how to do it. No screencast, but I do plan to review the audio and create some supporting materials for my upcoming article on Ledger and Gnuplot.

Life is good. =)

View or add comments

In other news…

Posted: - Modified: | finance

I’m back on the wagon of tracking every expense. There’s a certain
satisfaction in knowing that every cent is accounted for. This time,
I’m using John Wiegley‘s excellent
Ledger command-line accounting
tool. It works with plain text, of course.

I’ve just figured out how to do my fancy earmarked accounting thing.
I’ve partially sorted out my cashflow, but I’m not sure how much I’m
supposed to receive over the next few months or what’ll happen when I
start working. For peace of mind, I’ve earmarked enough money to cover
tuition, rent, and food.

I want the earmarked money to be tracked separately from my real
savings so that I know how much money I can actually touch, but I want
to leave it in my regular high-interest savings account so that I can
earn interest on the whole amount. So I need two reports: one showing
what I can consider free and clear, and another that reconciles with
the account summary from the bank (includes earmarked accounts).

Here’s the transaction setting up earmarked rent:

10.28 Earmarked for rent
   [Savings:Earmarked:Rent]      $4365

and every so often, I’ll post transactions that look like this:

11.02 * PCFinancial ; Transfer for rent payment
   Assets:Savings:PCFinancial     $-485
   Assets:Checking:PCFinancial    $485
   [Assets:Savings:PCFinancial]   $485
   [Assets:Checking:PCFinancial]  $-485
   ; Automatically transfer rent money from Savings to Checking ($485)
   ; This is still part of my earmarked savings until it goes out of Checking
   ; So ledger -s -c bal shouldn't show it as part of my real checking account
   ; or my savings account, but as part of Savings:Earmarked
   ; but ledger -R -s -c bal should show an increase in checking and a decrease in savings
11.05 ! University of Toronto
   Assets:Checking:PCFinancial    $-485
   Expenses:Rent                  $485
   [Savings:Earmarked:Rent]      $-485
   [Assets:Checking:PCFinancial]  $485
   ; Now decrement my earmarked savings
   ; And make sure that Checking reflects actual balance
   ; And that savings is unchanged from before with virtual transactions

The ! signifies a pending transaction that has not yet been cleared,
while * signifies a cleared transaction. ledger can do
partially-cleared transactions too. This is pretty nifty.

Makes me want to have more to track…

On Technorati: ,

Random Emacs symbol: shell-script-mode – Command: Major mode for editing shell scripts.

View or add comments