Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    1

    Lightbulb design patterns (ACCOUNTING RUNNING BALANCE)

    If we have coloums

    trans_id =200
    date =2/2/2012
    document = invoice#199
    account_id =200099
    opening_bal=120
    debit_amount =100
    credit_amount =null
    running_bal=220
    closing_bal=220

    But let suppose before date =2/2/2012 for account_id =200099, we had an invoice#68 with orignal amount=10, was edited/alter to new amount=5 then up above transaction will be changed to

    trans_id =200
    date =2/2/2012
    document = invoice#199
    account_id =200099
    opening_bal=115
    debit_amount =100
    credit_amount =null
    running_bal=215
    closing_bal=215

    what would be database design patterns for managaing/handling the running balance logic in accounting applications?

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    You could consider removing the running_balance from the table and derive this value (as well as the closing_balance) when needed.

    Or you could bring the totals forward every time a previous entry is edited making it necessary to recalculate.

    I'd probably use option 1 but i don't know your entire requirement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •