• I know of two basic strategies. The difference between the two is whether you apply a specific payment to a specific bill, or if it just gets applied to "the balance".

    In scenario #1 (i.e. correlate the bill to any adjustments to the bill), you'd have an "invoice" table (for things needing to be paid), an payment/adjustments table and a mapping table that relates the payment/adjustment to the bill or bills that it relates to. So:

    Invoices -->>---PaymentsApplied------<<------PaymentsAdjustments

    (the arrows point toward the MANY side of the relation).

    In this case - it also allows you to determine how much of each payment goes against each invoice (and you'd need logic to make sure that sum(detail)=Total payment).

    Scenario #2 involves a single table. With an invoiceID, a transaction type, and an amount. Payments get recorded as negatives, invoices as positive.

    The fun part is - the answer to getting a balance is the same in both cases. Just run a total (where invoices are positive and payments are negative) and voila - your balance. If payments can be recorded at any time - I'd keep it dynamic (don't record and store the balance anywhere).

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?