Two examples where this is useful:
1. I tend to have a lot of files generated elsewhere and converted
from OFX/CSV. If you moved money from a checking account to savings,
and are also auto-converting both accounts with a OFX/CSV -> Ledger
tool, you'd end up with two nearly identical entries like this, one
from each converted file.
2012/01/01 Transfer from Checking to Savings
Assets:Savings $100
Assets:Checking
Having two records of the same transaction would cause your accounts
not to balance. One response would be to delete one of the
transactions, but that's a manual step that would need to be done
every time, or automatically deleted (which could be failure prone).
Using the Transfer account pattern, you'd tweak your CSV > ledger
conversion to generate the following records:
2012/01/01 Transfer from Checking to Savings
; Generated from Checking account CSV > ledger
Transfers:Checking_Savings $100
Assets:Checking
2012/01/01 Transfer from Checking to Savings
; Generated from Savings account CSV > ledger
Assets:Savings $100
Transfers:Checking_Savings
This has several upsides
- No manual tweaking after a CSV > ledger conversion.
- You can immediately know where any transfer went wrong (and which
account didn't register it)
- When everything has cleared, the balance in the Transfer account is
zero so it doesn't appear in any balance reports
2. As a business, you can get paid in many different ways, and there
often is a gap between recieving a check or credit card payment. In
my case, I do the following to track payments through the entire
process:
2012/01/01 Invoice
Company:Assets:Accounts Receivable $200
Customer:Invoice:Labor -$200
2012/01/01 Check #1000
Company:Assets:Accounts Receivable -$200
Company:Assets:Checking Deposits $200
Customer:Equity -$200
Customer:Payments:Check $200
2012/01/02 Deposit Checks at Bank
Company:Accounts:Checking $200
Company:Assets:Checking Deposits - $200
In this example, I'm using the Transfer pattern twice, once to
maintain a list of Accounts Receivable, and another time to balance
Checks after their received, but before they've cleared the bank.
As with before, once everything has been paid in full, these accounts
balance to zero, so they don't clutter the final output of balance
queries.
I hope someone else finds this useful - it's a very simple pattern
that has greatly helped me develop better, easier to work with Ledger
workflows.
- Zack
I've had that problem too, and worked around manually. Thanks for pointing out this clever trick!
> In this example, I'm using the Transfer pattern twice, once to
> maintain a list of Accounts Receivable, and another time to balance
> Checks after their received, but before they've cleared the bank.
I don't quite get the utility of the second use - those transactions look a little over-complex for my needs - but I
like the flexibility that we have to describe workflows that help us.
"Patterns" is a welcome term and topic in *ledger-land.