A User's view of Hledger

Learning about hledger

Forgetting how to use cash

Like many people in the U.S., I use very little cash. In fact, I went for a few weeks without even a single dollar bill in my wallet. I’m not recommending this as a general practice — who knows what emergency situation might arise — but it’s to illustrate how seldom I need to use actual currency.

Other countries have similar situations. For example, on a recent trip to Iceland, we spent 4 days without even seeing any Icelandic krónur, let alone needing to use any.

France was a slightly different story. We knew ahead of time that we would need some Euros at restaurants. While service is included in the price of a meal, it’s customary to leave one or two Euros in cash on the table. However, the vast majority of our expenses were paid by card.

So what does this have to do with hledger?

I use cash so seldom that I recently had to pause and think how to record a transaction. Let me explain. My hledger custom is to record cash as spent the moment it is withdrawn from a bank or ATM. Yes, I could track all the cash expenses, but for me it is a lot of effort for little reward.

Sometimes, though, if a cash purchase is large enough, I exceptionally want to track it in hledger.

For example, I recently gave a cash tip at a U.S. restaurant. I wanted to record the cash expense. However, when I had withdrawn the cash, I had recorded it as already spent. As previously noted, my cash expenses are few, and much more rare are the times that I want to record a specific cash purchase. Therefore, I found myself at a momentary loss as to how to do this.

Then I remembered that I have to basically reverse the “cash was already considered spent the moment it came out of the ATM.” Here is the basic idea of how I did this.

Cash from an ATM would look like:

2025-07-01 ATM withdrawal
    expenses:cash                  $60.00
    assets:BigBank:checking       $-60.00

In order to show that some of the above cash was spent not as “expenses:cash” but under another category, I did the following transaction:

2025-07-03 Indian Restaurant
    expenses:cash                            $-20.00  ; cash tip
    expenses:dining out                       $20.00

By way of explanation, the expenses:cash was recorded as negative ($-20.00). This was in order to reverse $20.00 of the previous ATM withdrawal that said that all the cash had been spent. Then I recorded $20.00 under expenses:dining out.