Try ERPNext Buy Support Partners Foundation

Sales Partner's Commission calculation

hello
I want to give the commision to sales partner on profit as describe bellow
eg if sales rate is INR 100 and purchase rate is INR 60 then commision will be based on profit which is INR 40.
in current system i can allocate commsion in whole sales rate. is there any way to achieve this?