Skip to content

Instantly share code, notes, and snippets.

@glguy

glguy/balances Secret

Created September 13, 2021 15:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glguy/7859994281df5a3539b6544e14070c5c to your computer and use it in GitHub Desktop.
Save glguy/7859994281df5a3539b6544e14070c5c to your computer and use it in GitHub Desktop.
Multiple payment methods and CSV-driven reconciliation
$ hledger -f example.ledger bal --tree
$110 Assets
$75 Checking:Balance
$35 PayPal:Balance
$-200 Equity:Opening Balances
$90 Expenses:Groceries
--------------------
0
1-1 *
Assets:Checking:Balance $100
Assets:PayPal:Balance $100
Equity:Opening Balances
1-2 * Foodco | Bought groceries
Expenses:Groceries $90
Assets:PayPal:Tx $-65 ; rec: 12345
Assets:Checking:Check $-25 ; rec: 42
1-3 * (bank) Check 42 Cleared
; transaction generated from CSV export
Assets:Checking:Balance $-25
Assets:Checking:Check $25 ; rec: 42
1-4 * (paypal) Foodco | Payment
; transaction generated from CSV export
Assets:PayPal:Balance $-65
Assets:PayPal:Tx $65 ; rec: 12345
# We can see that all the checking and paypal transactions have reconciled
$ hledger -f example.ledger bal Assets:Checking:Check Assets:PayPal:Tx --pivot=rec -E
0 12345
0 42
--------------------
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment