A
aw
Background
- We obtain order request from customer & then we will find our suppliers
for EXACT QTY delivery.
- In this case, we need total Two (2) suppliers to cover this request.
- So we arise PC050 from supplier A & PC051 from supplier B to cover
customer Z's order SC001.
- As a result, No inventory will keep for all our business.
- After that two invoices will arise and bill our customer Z
(IV-888 & IV-777, 2 invoices due to date of delivery are different)
- This is the whole "1 set" of data after all of the above data being entered.
- So, Sales contract, Purchase contract & invoice should have a special
relationship at a whole.
TABLE 1 (sales contract detail)
SALES CONTRACT NO PRODUCT QTY UNIT PRICE
------------------- ------- ----- ----------
SC001 AC 5000 $30
SC001 AC 3000 $35
SC001 AD 10000 $20
TABLE 2 (purchase contract detail)
PURCHASE CONTRACT NO PRODUCT QTY UNIT COST
-------------------- ------- ----- ----------
PC050 AC 4000 $20
PC050 AC 1500 $25
PC050 AD 8000 $10
PC051 AC 1000 $22
PC051 AC 1500 $27
PC051 AD 2000 $12
TABLE 3 (invoice detail)
INVOICE NO PRODUCT QTY SELLING PRICE
-------------------- ------- ----- -------------
IV-888 AC 4000 $30
IV-888 AD 10000 $20
IV-777 AC 1000 $30
IV-777 AC 3000 $35
Relationship need to establish
==============================
1. "SALE CONTRACT NO" ---- "PURCHASE CONTRACT NO" is "1 to many"
(eg. SC001 are covered by PC050 plus PC051)
2. "SALE CONTRACT NO" ---- "INVOICE NO" is "1 to many"
(eg. SC001 are covered by IV-888 plus IV-777)
Actually I copy the field "SALES CONTRACT NO" from table 1 to table 2 &
table 3 as foreign key.
It works fine for relationship b/w "tabe 1 with table 2" & "table 1 with
table 3" but
cannot get the relatiohsip b/w "TABLE 3 with TABLE 2".
- We obtain order request from customer & then we will find our suppliers
for EXACT QTY delivery.
- In this case, we need total Two (2) suppliers to cover this request.
- So we arise PC050 from supplier A & PC051 from supplier B to cover
customer Z's order SC001.
- As a result, No inventory will keep for all our business.
- After that two invoices will arise and bill our customer Z
(IV-888 & IV-777, 2 invoices due to date of delivery are different)
- This is the whole "1 set" of data after all of the above data being entered.
- So, Sales contract, Purchase contract & invoice should have a special
relationship at a whole.
TABLE 1 (sales contract detail)
SALES CONTRACT NO PRODUCT QTY UNIT PRICE
------------------- ------- ----- ----------
SC001 AC 5000 $30
SC001 AC 3000 $35
SC001 AD 10000 $20
TABLE 2 (purchase contract detail)
PURCHASE CONTRACT NO PRODUCT QTY UNIT COST
-------------------- ------- ----- ----------
PC050 AC 4000 $20
PC050 AC 1500 $25
PC050 AD 8000 $10
PC051 AC 1000 $22
PC051 AC 1500 $27
PC051 AD 2000 $12
TABLE 3 (invoice detail)
INVOICE NO PRODUCT QTY SELLING PRICE
-------------------- ------- ----- -------------
IV-888 AC 4000 $30
IV-888 AD 10000 $20
IV-777 AC 1000 $30
IV-777 AC 3000 $35
Relationship need to establish
==============================
1. "SALE CONTRACT NO" ---- "PURCHASE CONTRACT NO" is "1 to many"
(eg. SC001 are covered by PC050 plus PC051)
2. "SALE CONTRACT NO" ---- "INVOICE NO" is "1 to many"
(eg. SC001 are covered by IV-888 plus IV-777)
Actually I copy the field "SALES CONTRACT NO" from table 1 to table 2 &
table 3 as foreign key.
It works fine for relationship b/w "tabe 1 with table 2" & "table 1 with
table 3" but
cannot get the relatiohsip b/w "TABLE 3 with TABLE 2".