"sj" <se*********@gmail.comwrote in
news:11**********************@p79g2000cwp.googlegr oups.com:
I need to write an application to perform Quotations, and
confrimed Quotations information can later extracted and print
a Delivery Order, and finally an Invoice. Note that,
ammendments maybe made at different stages (meaning quantity
may varies, further discount exercised during invoicing, etc).
What is best way to build this type of task? Do I keep all
these document information in 1 table or is it better for me
to maintain the 3 or table (one for each document)? Is so how
do I extract information from one table to another?
Anyone have experience in this?
You have three types of documents (entities) You should have
three or more tables. Example Invoices may have several invoice
lines for different items, all with one invoice header. The same
is true of Orders. You should also think of a separate table to
store customer info.
Linking multiple tables is done by defining relationships
between the controlling fields in the various tables. Each table
should have a primary key ( a field which uniquely identifies
every row in the table). For customers this would be the
Customer_ID. when a customer requests a quotation, you store the
Customer_ID as a foreign key in the quotation table. You then
use the relation between the Quotation table and the Customer
table to give the correct Customer name, Customer address, and
other info particular to the specified customer. You don't need
to 'extract' info from one table to the other, except for the
key, you just 'relate' the data instead.
Again the invoice_line table is related to the invoice table
through the key invoice_number (or Invoice_ID). The invoice may
be related directly to the customer table via the Customer_ID or
indirectly through an intermediate relation to Orders on
Order_ID and then to the customer_ID in the orders table
see
http://en.wikipedia.org/wiki/Entity-relationship_model.
Another thing to do is examine the samples and templates that
came with the program.
--
Bob Quintal
PA is y I've altered my email address.
--
Posted via a free Usenet account from
http://www.teranews.com