Using Ledger-cli for business and joint finances
Posted on do 24 juli 2025 in blog
I have been using ledger-cli since 2015. At first only for my personal finances. To make it easier for myself, I use the CSV files I download from the bank and convert these into ledger-cli transaction files.
Later I incorporated my business records as well. I used a script to export the records from my main accounting software (Odoo) and write them out as ledger-cli transactions.
I was looking for a way to give me
- a view of just my business
- a view of just my personal finances
- a combination of both business and personal finances
I realized that much of what I do to make this happen, can be also applied to joint finances.
Simplified setup
My own setup is quite involved with separate files for nearly every account and each split up again by year. I then combine them in separate ledger files that have a lot of include statements.
To explain the basic reasoning for joint personal and business accounts, I'll simplify to a single file for each member of a two head household with a husband and wife.
Proposed names for the data files for DH (husband), DW (wife), DH+DW (joint accounts) and DH-company (DH company accounts):
DH.ledger DW.ledger DH+DW.ledger DH-company.ledger
We can combine these files in different ways using include.
Joint account view with origin
Let's make a joint account view where every set of accounts is prefixed with its origin. This ledger file could be named all.ledger. It could have the following contents:
# all.ledger apply account Dear Husband include DH.ledger end apply account apply account Dear Wife include DW.ledger end apply account apply account Joint Accounts include DH+DW.ledger end apply account apply account Dear Husband Company include DH-company.ledger end apply account
Consolidated joint view
A consolidated joint view. This ledger file could be called joint.ledger. It could have the following contents:
# joint.ledger include DH.ledger include DW.ledger include DH+DW.ledger include DH-company.ledger
The trick here is to use (partially) the same setup of accounts for all parties. This makes consolidating easy. The former ledger file is capable of showing individual contributions of DH, DW, joint accounts and company to income, expenses, assets and debts. The latter ledger file gives you the consolidated numbers for each unique account.
Example reports
Generating reports using either all.ledger or joint.ledger could look like this:
ledger -f joint.ledger bal Assets or Liabilities # household balance ledger -f joint.ledger bal Income or Expenses # household profit and loss ledger -f all.ledger bal Husband and \( Income or Expenses \) # DH profit and loss ledger -f all.ledger bal Wife and \( Assets or Liability \) # DW balance
Working with transit or interim accounts
For correct reports, we need a special way to record the transfer funds of between partners or between a person and their company. In these cases we use a transit account to hold the money. One partner sends money to this transit account while the other moves the money from the transit account to the proper place.
First Example
DH gives € 50 cash to DW.
In husband's ledger DH.ledger this is recorded as:
2025/07/07 * Cash to DW Assets:Cash € -50.00 Assets:Transit
While in wife's ledger DW.ledger:
2025/07/07 * Cash from DH Assets:Cash € 50.00 Assets:Transit
When generating a report using the joint.ledger this transit account Assets:Transit will end up with a net zero balance.
Second example
When both husband and wife are putting in a contribution in the joint account at the bank, we record these transactions.
In husband's ledger DH.ledger:
2025/07/18 * Contribution to joint account Assets:DH Bank € -50.00 Assets:Household Contribution
And in wife's ledger DW.ledger:
2025/07/10 * Contribution to joint account Assets:DW Bank € -50.00 Assets:Household Contribution
In the joint ledger DH+DW.ledger:
2025/07/10 * Contribution from DW Assets:DH+DW Bank € 50.00 Assets:Household Contribution 2025/07/18 * Contribution from DH Assets:DH+DW Bank € 50.00 Assets:Household Contribution
Again, generating a report from joint.ledger will show a zero balance for Assets::Household Contribution. While the command:
ledger -f all.ledger bal Household Contribution
will show how much each partner has contributed into the household.