Entries versus Transactions

Some will probably say that the use of three tables to store entries, entry amounts, and transactions is unnecessary. I agree to a certain extent, and for archival purposes there is no need for storage. In fact, you really don't need the generalledgertable at all, because the information it contains could be dynamically built every time it is requested (in fact that's how PBooks originally worked back a few years ago).

However, for many reasons, it is worthwhile to have the general_ledger table:

  • Faster - the ledger can be thought of as a cache to some degree
  • Able to import single-sided transactions into the ledger, and match them with another account for input into the journal

Along these lines, I would like the ability to rebuilt the ledger on demand. PBooks currently has the ability to recalculate the balance for each account and its transactions, but there is no way to automatically post all journal entries to the ledger with a click of a button. Sometime soon though!

P.S. - I just added a column to the generalledger and entryamounts tables called entryamountid. I had at first believed that there was no need for a transaction to have more than one transaction of the same account for the same journal entry. However, for invoices, which may or may not be split into separate journal entries, may have several discounts for different services or jobs. In that case, it clearly makes sense to have a separate transaction for each one.

By on May 29, 2007 5:50 PM