Subject RE: [IBO] Correct Transaction Handling
Author Alan McDonald
> Could you elaborate how totals are never stored in the database?
> Where are they stored then? I am thinking each account's first ledger
> entry could represent past archived transactions from past periods.
> No?

the running totals are only ever delivered out of the SP. Do a loop thru the
records being delivered in the same order each time (datestamp or PK
ascending) accummulating the running total and creating a return value on
the fly.
The opening and closing account balances for each period are maintained in a
separate table. When you close a period which is an administration task, the
closing balance of the transactions in question are total and those totals
are posted.

> > And make a "rollover" procedure where previous period
> > accounting transactions are parked away from the "current" set.
> How parked? In another table? Database? What if a user wants to
> "void" a check from last period? I assume a period could be as little
> as a single month. Right?

Parked in another table is the best (another db is not practical) but I can
imagine a design with appropriate flags on the records which would prevent
you accessing records which are not in the "current" period.
All transactions in the previous (closed) periods are generally locked. You
can enter a reversing transaction but doing so into a closed period will
require special user access/rights. How tough do you want to be or how
closely does you system need to be auditable to the highest standard.
A period is a single calendar month usually.

> How if it is "rolled over?"

Not sure what you mean here?