alexander1113
Programmer
Dear DB Administrator Experts,
I am trying to design a database for a sales company who represent multiple suppliers and I am in stuck in how to go about the following scenario. An order is placed, and there is an amount paid on that order. From that amount paid on the order, our sales company gets a commission piece off it and from that commission we get, it gets split between either one sales rep or multiple sales reps. So for example, let's say someone places an order off Supplier A for 1000 dollars. Supplier A gets that order and we know that they have to pay us 10% for that order. So we get a check for 100 dollars. Now from that 100 dollars, it's split in between the sales rep or reps and the sales company. so it could go for something like, .8 for in house, .1 for salesrep A, .1 for sales rep B. So now I'm trying to interpret this in the tables, and i got the two tables:
INVOICE:
ordernum -- ordernumber
invoice_num --invoice number for check amt sent
status
amt_paid -- amount of check
INVOICE DETAILS:
ordernum
invoice
commission_percentage --percentage rep gets ex. .1, .2
rep_id -- sales rep number
date_of_pay -- date paid
comments
amt_paid --how much paid based on the commission perc.
Now with invoice details table there will be duplicates because like i stated before, there will be multiple reps perhaps paid on one invoice, aside from rep_id # 00 which is in house. Now is there anything I'm doing wrong or is this design efficient. If you need more information , please ask. Thank you ahead of time.
Alex
I am trying to design a database for a sales company who represent multiple suppliers and I am in stuck in how to go about the following scenario. An order is placed, and there is an amount paid on that order. From that amount paid on the order, our sales company gets a commission piece off it and from that commission we get, it gets split between either one sales rep or multiple sales reps. So for example, let's say someone places an order off Supplier A for 1000 dollars. Supplier A gets that order and we know that they have to pay us 10% for that order. So we get a check for 100 dollars. Now from that 100 dollars, it's split in between the sales rep or reps and the sales company. so it could go for something like, .8 for in house, .1 for salesrep A, .1 for sales rep B. So now I'm trying to interpret this in the tables, and i got the two tables:
INVOICE:
ordernum -- ordernumber
invoice_num --invoice number for check amt sent
status
amt_paid -- amount of check
INVOICE DETAILS:
ordernum
invoice
commission_percentage --percentage rep gets ex. .1, .2
rep_id -- sales rep number
date_of_pay -- date paid
comments
amt_paid --how much paid based on the commission perc.
Now with invoice details table there will be duplicates because like i stated before, there will be multiple reps perhaps paid on one invoice, aside from rep_id # 00 which is in house. Now is there anything I'm doing wrong or is this design efficient. If you need more information , please ask. Thank you ahead of time.
Alex