Monday, July 25, 2005

I have progressed quite a lot over the last two weekends. As always, the most important thing in the beginning is getting the concepts right! Since I don't have much technical knowledge of bookkeeping, and started out with a hazy knowledge of double-entry bookkeeping I got a lot of the database modeling wrong when starting out.

I figured the concepts out (reinventing the wheel no doubt) and translated them into computerse. A quick summary.

As a shorthand, I use money for the concept of value. Money can also be shares, for example, but since we can assign everything a monetary value, money is a good shorthand for this.

For bookkeeping purposes, money is like energy: it gets destroyed nor created, it just moves around. Every object or concept in this world has got an account associated with it, which has debit and credit side. When you spend money, it is an entry at the debit side, when you earn money it is an entry at the credit side. The account balance is the difference between credit and debit. Because money is never destroyed, any change in the balance of an account must be balanced by another account.

Each person has assets, and liabilities. Examples of assets are bank accounts, shares, houses, etc. Examples of liabilities are loans, mortgages, credit cards, etc. Each asset and liabiliy has, as previous stated, an account. The person's net value is the difference between the balance of assets and liabilities. Each person has income which are a set of accounts that increase her net value, and expenses, a set of accounts that decrease her net value.

The debit side of the income accounts represent her income, the credit side represents money she will get in due course (this is a handy concept later for interest calculations and projections). Quite often the debit side is unknown, so the debit stays zero. The credit side of the expense accounts represents her spending. I haven't found a good concept for what the debit side represents. Money that will be spend in due course? I'll think about it.

A movement of money that changes her net value is a transaction. A movement of money that leaves her net value unchanges is a transfer.

These concepts make understandable: income balances are negative, and expense balances are positive. A creddit card is a liability, so using it increases a credit card's balance. Suddenly my bank statements became a lot clearer. I bet 90% of the readers will shake their head and mutter that all this is obvious. Well perhaps, but it cost me some thinking to get this sorted out clearly, and in such a way that I can represent it in a database.

No comments: