Felix Crux

Technology & Miscellanea

Tags: ,

Sometimes you have to pay for something for which you will be reimbursed later, whether it’s a business travel expense or just spotting a friend some cash. Ledger makes it easy to not just track these expenses, but to know whether they’ve been paid back yet or not.

(This post is part of a series describing how I use the Ledger accounting system. For an introduction to ledger and this series, or to see all the entries, have a look at the first post).

The first issue is how to record the transaction. It’s not an expense, but money did leave your accounts. Traditionally I believe it is credited to an “Accounts Receivable” account, but I find it a bit ridiculous to call my personal reimbursement claims by that name, so I just go with “Assets:Reimbursement”, like this:

2016-10-13 Somebody You're Lending Money To
  Assets:Reimbursement  $20.00
  Liabilities:Credit Card

Having it under “Assets” makes it clear that this is not money you’ve spent; it still counts towards your total worth.

When you’re paid back, you just add another transaction moving the money back from the Reimbursements account to wherever it landed.

While this works fine for infrequent or small numbers of transactions, it can get messy when you have many such transactions. Maybe some are paid back all in one go while others are still open. What we want is a way of specifying whether a particular expense has been paid back yet or not.

To track this, I make use of ledger’s “cleared” and “uncleared” flags for transactions. In between the transaction date and the payee name, you can put a * (for cleared) or a ! (for pending). Simply mark unpaid transactions with !, and change it to a * when they are paid back:

2016-10-13 ! Mr. Slow-To-Repay
  Assets:Reimbursement  $20.00
  Liabilities:Credit Card

2016-10-19 * Ms. Quick-To-Refund
  Assets:Reimbursement  $40.00

2016-10-20 * Ms. Quick-To-Refund
  Assets:Reimbursement  $10.00

2016-10-21 Ms. Quick-To-Refund
  Assets:SomeBank:Chequing  $50.00

Now, we can list our unpaid reimbursable expenses with the command:

$ ledger register Assets:Reimbursement --pending --limit 'amount > 0'
16-Oct-13 Mr. Slow-To-Repay     Assets:Reimbursement         $20.00       $20.00

The --pending flag shows entries explicitly marked as pending, while --uncleared also includes ones that are not marked either way. To see repaid transactions you'd use --cleared.

This may be an abuse of the “cleared” status, but I personally don’t have much use for what I assume is its original purpose (tracking cheques), and, after all, the manual does say that the cleared status “can mean whatever the user wants it to mean”.

blog comments powered by Disqus