THere are 2 rebate amount against same customer (1000, 2000), with unique number sequence (Voucher NUm are CRB-0000063 & CRB-0000065)
there is another sales order system form where sales order and discounts are there
i am developing inquiry as
for each sales order of customer, its deduction is like
For 1st rebate amount (1000), for 1st voucher CRB-0000063
creating sales order with this voucher
S1 -> customerrebate.amount - salestable.discountAmount //1000-500 =500
S2 -> customerrebate.amount - salestable.discountAmount //500 - 300=200
until it becomes 0
for next rebate amount(2000) , for next voucher CRB-0000065
creating ssals order with next voucher
then next rebate amount will be start whom to deduction from (2000)
like S4 -> customerrebate.amount - salestable.discountAmount //2000 - 100=1900
so on
i have given voucher num into sales order (Which is also repeated for sales order against same cusotmers)
if i have given rebate amount into inquiry table which is also repeted for sales order
can anyone help me. i am stuck on it from a week.
here is in column of rebate amount 3000 (which is Sum of 1s rebate & 2nd rebate amount)
cust rebate form