I've got the following tables:

    * transactions
    * invoice_header
    * invoice_details
    * payment_header
    * payment_details

I create invoices based on the transactions that haven't been paid.  
"Paid" is defined as follows:  sum(payment_details.namount) >= 
transaction.amount , where the sum is done on matching trans_id keys.  
I've got a field called "iPaid" in the invoice_header table that is set 
to 1 (true) when all of its detail records have been paid.  This allows 
me to quickly query for all of the UNPAID invoices rather than scanning 
through and comparing the SUM(payment_details.namount) to 
transaction.namount every time.  Eventually I'll put a trigger into the 
payment_details table to achieve this, but for now, it'll be in VFP 
bizobj/dataobj code every time a payment is applied.

My question is this:  say I create an invoice ("0001") for your unpaid 
transactions, and 30 days later, when it's time to invoice again, you 
haven't paid them yet.  As the application developer, do you create a 
new invoice ("0002") for the current AND past charges, or just create an 
invoice for the current charges (so that you then have 2 invoices in 
either case), or do you simply open up the existing invoice, tack on the 
current charges, and thus keep the same ("0001") invoice?  My concern 
about having a 2nd invoice is due to my having the iPaid field in the 
invoice_header table, as I described above.  2 invoices for the same 
transactions would prove to be a problem when reconciling the payment data.

How would you proceed?

tia!

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to