Hi, I need some advice in building a stored procedure which will calculate commission for salesman.. Below are the rules:
We have different categories of salesman who receives commission, they have a fixed amount of commission (100% commission):
Bqt: Bouquet
Opt: Option
VENDEUR SR :Bqt:3,000 Opt:1,200
SUPERVISOR :Bqt:3,500 Opt:1,500
HEADS: Bqt: 5,800 Opt:2,500
VAD : Bqt:7,000 Opt:3,000
VAD TL: Bqt:10,000 Opt:4,000
Now in bouquet there is 1 bouquet names access... below are the rules for this:
E.g: If Supervisor sold 90%bouquet and 90% option, and out of the 90% bouquet, he sold like 45% access, he will have a commission of 26%, else if he sells less access and more of other bouquets, he gets a commission of 65%
Now, if these sales are not escalated within 7 days, these sales are non-valid... That is only sales validated within 7 days are valid, and commission is received upon.. If it is validated after 7 days, no commission is given to the salesperson.
Can anyone please tell me how to write this script??
Thank you