Add 'Affiliate Payout' and 'Affiliate Bonus' as records of the tracking_pixel_visit table.
When calculate total commission - paid commissions; disregard 'Affiliate Bonus', because a bonus is not considered as a past payout to be deducted from the total of commissions.
So, to calculate the commissions to pay you have to do:
Commissions to Pay = Total Revenue * Commission-Rate - Past Affiliate PayOuts
If you want to add a bnus of X%, you can calculate it with this formula:
Bonus of X% = X * Commissions to Pay / Commission-Rate
Add
'Affiliate Payout'
and'Affiliate Bonus'
as records of thetracking_pixel_visit
table.When calculate
total commission - paid commissions
; disregard 'Affiliate Bonus', because a bonus is not considered as a past payout to be deducted from the total of commissions.So, to calculate the commissions to pay you have to do:
If you want to add a bnus of
X%
, you can calculate it with this formula: