trick to disable check-payees per-transaction

15 views
Skip to first unread message

Tavis Ormandy

unread,
Aug 29, 2025, 4:27:15 PMAug 29
to ledge...@googlegroups.com
Just a quick trick I found recently...

I like to use --check-payees, so I have to pre-declare all the payees I
use. This works well for me, it helps catch any typos or unintentionally
using a variant (e.g. "Home Depot" vs "The Home Depot").

The problem is... I buy a coffee somewhere, I know I'm never going back,
I still have to pre-declare "Joes Coffee Shop" or ledger will complain.
That is what I asked for, but it's a hassle, so I have a bunch of
generic payees, like this:

; No need to precisely record purchases with one-off payees.
payee Attraction
payee Bar
alias ^Pub$
payee Bakery
payee Coffee Shop
payee Contractor
payee Confectioner
payee Farmers Market
payee Florist
payee Gas Station
payee Hotel
... etc.

That works okay, but it would be nice to still have the name in there,
in case I try to find it via `ledger reg @foobar`.

I thought maybe I could outsmart ledger like this:

2025/08/28 * Coffee Shop ; payee: Joes Coffee
Expenses:Dining:Coffee $3
Assets:Checking

...but ledger catches that...need to be sneakier :)

I experimented and found this does work:

; Append vendor to any transactions with a vendor tag
= expr "has_tag('vendor')"
; payee:: payee + ": " + tag('vendor')

2025/08/28 * Coffee Shop ; vendor: Joes Coffee
Expenses:Dining:Coffee $3
Assets:Checking

And `ledger reg @Joes` will now correctly list 'Coffee Shop: Joes
Coffee', and --check-payees doesn't complain.

I guess you could argue I'm just defeating some safeguards, but I really
like being able to turn it off per-transaction when I need to... maybe
someone else is interested :)

Tavis.

--
_o) $ lynx lock.cmpxchg8b.com
/\\ _o) _o) $ finger tav...@sdf.org
_\_V _( ) _( ) @taviso

Reply all
Reply to author
Forward
0 new messages