Transactions
The double-entry system of accounting dates back over 400 years, to an Italian named Fra. Luca Pacioli (who recently had a PC accounting package named after him). The key idea was to keep track of where money comes from and where it goes. Double-entry must rate as one of the most powerful notations ever, the business equivalent of Newton’s achievements in physics. What follows is a formal notation and set of rules to encapsulate double-entry. As with physics, it’s best just to work through a few examples rather than analyze the concepts too early.
A transaction is a financial event. It occurs at a certain point in time, affects two or more accounts, and the effect of those accounts sums to zero. The use of the term transaction in the database world was borrowed from accountants, who got there first by a few centuries. The key concept is that the whole thing has to happen at once or not at all; if only part of a transaction takes place, your system goes out of whack. Conceptually you can lay one out on the page like the following table.
Date: |
01/01/1998 |
Comment: |
Start the company |
Cash |
+10 000 |
Share Capital |
-10 000 |
A set of accounts (or
BookSet
)
is basically a list of such transactions. An account is a way of
categorizing money, but it has no precise economic meaning;
fortunately, it soon becomes obvious what an account means in
practice.
Here’s what happens when you go out and buy something for cash.
Date: |
07/03/1998 |
Comment: |
Buy computer manuals |
Cash |
Get Python Programming On Win32 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.