hledger add, balance assertions and multiple journals

13 views
Skip to first unread message

Alex Johnstone

unread,
Aug 20, 2021, 4:55:57 AMAug 20
to hledger
Hello,

I keep a separate journal for each account, and then have a single master that includes them all. 

When I go to use `hledger add -f creditcard.journal` it fails on balance assertions. However, running hledger check (on master journal) there's no issues. I guess as I've specified a specific file, hledger doesn't know about the transactions from the other journals that would balance this account (e.g. credit card payments). 

I can add --ignore-assertions to overcome this but was wondering if there was a better way to do this? (aside from changing how I manage my journal files). 

thanks,
Alex

Simon Michael

unread,
Aug 20, 2021, 4:12:29 PMAug 20
to hledger
I think -I/--ignore-assertions is the right solution in this situation.

If you did want to check assertions before (and while ?) running hledger add, I think you can do it by mentioning all files, with the one you want to add to listed first:

hledger add -f creditcard.journal checking.journal savings.journal ...

(not -f creditcard.journal -f master.journal, which would read creditcard.journal rwice).

Alex Johnstone

unread,
Aug 26, 2021, 8:04:40 AMAug 26
to hledger
okay thanks. I'll probably stick with -I, as I run hledger check after doing all the accounts anyway.
Reply all
Reply to author
Forward
0 new messages