Next: , Previous: Dealing with Petty Cash, Up: Keeping a ledger


3.7 Working with multiple funds and accounts

There are situations when the accounts you're tracking are different between your clients and the financial institutions where money is kept. An example of this is working as the treasurer for a religious institution. From the secular point of view, you might be working with three different accounts:

From a religious point of view, the community expects to divide its resources into multiple “funds”, from which it makes purchases or reserves resources for later:

The problem with this kind of setup is that when you spend money, it comes from two or more places at once: the account and the fund. And yet, the correlation of amounts between funds and accounts is rarely one-to-one. What if the school fund has ‘$500.00’, but ‘$400.00’ of that comes from Checking, and ‘$100.00’ from Savings?

Traditional finance packages require that the money reside in only one place. But there are really two “views” of the data: from the account point of view and from the fund point of view – yet both sets should reflect the same overall expenses and cash flow. It's simply where the money resides that differs.

This situation can be handled one of two ways. The first is using virtual transactions to represent the fact that money is moving to and from two kind of accounts at the same time:

     2004/03/20 Contributions
         Assets:Checking                    $500.00
         Income:Donations
     
     2004/03/25 Distribution of donations
         [Funds:School]                     $300.00
         [Funds:Building]                   $200.00
         [Assets:Checking]                 $-500.00

The use of square brackets in the second entry ensures that the virtual transactions balance to zero. Now money can be spent directly from a fund at the same time as money is drawn from a physical account:

     2004/03/25 Payment for books (paid from Checking)
         Expenses:Books                    $100.00
         Assets:Checking                  $-100.00
         (Funds:School)                   $-100.00

When reports are generated, by default they'll appear in terms of the funds. In this case, you will likely want to mask out your ‘Assets’ account, because otherwise the balance won't make much sense:

     ledger bal -^Assets

If the --real option is used, the report will be in terms of the real accounts:

     ledger --real bal

If more asset accounts are needed as the source of a transaction, just list them as you would normally, for example:

     2004/03/25 Payment for books (paid from Checking)
         Expenses:Books                    $100.00
         Assets:Checking                   $-50.00
         Liabilities:Credit Card           $-50.00
         (Funds:School)                   $-100.00

The second way of tracking funds is to use entry codes. In this respect the codes become like virtual accounts that embrace the entire set of transactions. Basically, we are associating an entry with a fund by setting its code. Here are two entries that desposit money into, and spend money from, the ‘Funds:School’ fund:

     2004/03/25 (Funds:School) Donations
         Assets:Checking                   $100.00
         Income:Donations
     
     2004/04/25 (Funds:School) Payment for books
         Expenses:Books                     $50.00
         Assets:Checking

Note how the accounts now relate only to the real accounts, and any balance or registers reports will reflect this. That the entries relate to a particular fund is kept only in the code.

How does this become a fund report? By using the --code-as-payee option, you can generate a register report where the payee for each transaction shows the code. Alone, this is not terribly interesting; but when combined with the --by-payee option, you will now see account subtotals for any transactions related to a specific fund. So, to see the current monetary balances of all funds, the command would be:

     ledger --code-as-payee -P reg ^Assets

Or to see a particular funds expenses, the ‘School’ fund in this case:

     ledger --code-as-payee -P reg ^Expenses -- School

Both approaches yield different kinds of flexibility, depending on how you prefer to think of your funds: as virtual accounts, or as tags associated with particular entries. Your own tastes will decide which is best for your situation.