Transactions
Specific Transfers
There is sometimes a need to identify transfers from a specific account (Checking) to another specific account (Liabilities:Credit Card). That is, we are looking for transactions of type:
2022-12-23 Transfer
Assets:Bank:Checking -100 EUR
Liabilities:Credit Card 100 EUR
It is a seemingly simple report, yet it is not so simple to produce. To achieve this, we need to to run two reports, for each of the accounts.
ledger print --raw Checking | ledger -f - --permissive reg Liabilities:Something
In case you get errors in transactions with balance assertions, the first command can be run separately to create an intermediary file.
ledger print --raw Checking > temp.ledger
Then comment-out the balance assertions and run the second report on this file.
ledger -f temp.ledger --permissive reg Liabilities:Something
This illustrates the general concept. The queries can be enhanced with the amount specifications, i.e. the amount on the Checking account is negative while the amount on the Liabilities account is positive, to indicate the direction of the money flow.