Subject Re: [firebird-support] Auditable Invoice Number
Author Stephen Davey
CM,

If you wish to use a generator to provide a contiguous number series for invoices here are some thoughts

The invoice will require two tables (a) the invoice header table and (b) the invoice line items table.

The unique id for the header table will be the invoice number. The unique id for the line items table will
be a combination of invoice number and sequence/line number of the invoice item

At the time of storing the line item data you will need to know the invoice number.

So,

Step 1, use a stored procedure to insert the invoice header record and return the invoice number to the
application.

Step 2 , you then use the returned invoice number when storing line item transactions.

If in the same tables you will also store credit note transactions then just use the same generator and method.

From this it is simple to generate reports such as sales journals etc ..

Stephen




----- Original Message -----
From: chee hee
To: firebird-support@yahoogroups.com
Sent: Tuesday, November 28, 2006 1:38 PM
Subject: [firebird-support] Auditable Invoice Number


Hi All,

I am thinking to use a generator for invoice number in my application.
Any idea/code on how to generate auditable invoice number, meaning we CANNOT have a break in invoice number in invoice table.
Thanks.

regards,
CM

Send instant messages to your online friends http://uk.messenger.yahoo.com

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]