Saurabh
Saurabh
This is more complicated than I thought lol
But here are 3 scenarios for a Customer who pays 900 only instead of 1000 because of 100 discount coupon.
Scenario A : Admin bears 100% of coupon (P100)
Admin Commission = 1000*0.15 which is 150
Admin Coupon Cost = 100
Admin Net Earnings = +50
Store Commission = 850
Store Coupon Cost = 0
Store Net Earnings = +850
Scenario B: Store bears 100% Commission
Admin Commission = 1000*0.15 which is 150
Admin Coupon Cost = 0
Admin Net Earnings = +150
Store Commission = 1000 * 0.85 which is 850
Store Coupon Cost = 100
Store Net Earnings = 750 (which will match all amounts : Admin 150, Customer 100 and Store 750)
Scenario C: Bears Admin 40% | Store 60%
Admin Commission = 960*0.15 which is 144 (Explanation below)
Admin Coupon Cost = Already Deducted
Admin Net Earnings = 144
Store Commission = 960 * 0.85 which is 816 (Explanation Below)
Store Coupon Cost = 60
Store Net Earnings = 816 - 60 = 756
Thus 144 admin + 756 store + customer 100 = 1000
Admin Commission Explanation, why I only put 960 as base to take commission? Because he gave out 40 for the coupon.
Store Commission Explanation, why take 0.85 from 960? Because Admin gave out 40 coupon which then needs to be take out from the computation.
So to answer the question.
Admin Commission Earnings = 144
Restaurant Payout amount = 756
Let me know if im wrong lol