Is there a way to show the destination account in a register report? I'm working with ledger, so a ledger answer is preferred. But if there's a way to do this in hledger, I'd appreciaate that too.
The base register report shows up like so
$ hledger register checking
2008/01/01 income assets:bank:checking $1 $1
2008/06/01 gift assets:bank:checking $1 $2
2008/06/02 save assets:bank:checking $-1 $1
2008/12/31 pay off assets:bank:checking $-1 0
What I am interested in is the account the commodity flows towards from assets:bank:checking. i.e. something like this
The problem with this is it lumps all the balances of the related accounts in the running balance. I would like to keep the running balance as the balance of the account in the filter, but also show which related account is concerned in a transaction
(ignore the || in front; that's Vim's quickfix list quirk)
In this reg report, nothing flows from Assets:Cash to Assets:Checking. The only "relation" is cos they're part of the same posting for opening balances.
Writing this up though, I realize if I break up the opening balances posting, like below, it plays more nicely with the -r flag
Tackler does that by default (if you select multiple accounts for the register reports). However the journal format is not 1:1 compatible with ledger / hledger.
I didn’t understand this, could you break down your thinking for me ?
Oh I see. You are running hledger register checking -r and you're not expecting to see Assets:Cash mentioned, because we humans know that the flow wasn't between cash and checking. But hledger and ledger don''t know that, they're just performing a symmetric mathematical operation.
So yes, being part of the same journal entry/transaction is the relation understood by -r/--related. I think you found the right solution: use separate entries to represent the situation more precisely.
I have the same issue, in transitioning to ledger from a similar system that includes this information in the format, and came to the same conclusion. However, I would like to support some of my own tools that expect to have this information for multiple postings within a single transaction. I have come up with two other options to try:
Redefine posting order, pairing the first debits with the first credits in order, with the elided or bucket account paired with whatever is left at the end. I could optionally group postings into individual subtransactions in the main transaction, instead of separated into debit and credit groups. Ledger would ignore this context, but my tools could use it.
1a. Another redefinition would be to share all debits e venly with each credit, or vice versa. This could make amounts more complicated, but if only listing accounts, you would have all those on the other side of the T instead of only one pairing.
I can specifically mark the information for my tools in the ledger file, either preprocessing before piping to ledger or using comments.
A good thing about ledger is that if the pure format doesn't include something you need, there are ways to add it.