Record Monthly Sales by an Employee/Sales Person/User


I’m trying to get the monthly sales made by an Employee/Sales Person/User through his userid/email. I then want to use that data in a doctype and Salary Structure to create a formula for the generation of Salaries for an Employee segment (eg. Employee Grade) based on custom rules based on his monthly sale

If the monthly sales are> 30,000 for an employee, Salary = 10,000.
If the monthly sales are> 70,000 for an employee, Salary = 20,000 + 50% of Salary
If the monthly sales are> 1,00,000 for an employee, Salary = 30,000 + 45% of Salary

Is that somehow possible in ERPNext? I’m trying but I haven’t been able to figure it out yet. Any guidance on what could be done? I really need this feature.

Thanks in advance!

I can help you with this part.

Every Invoice has a table called Sales Team. You’ll need to ensure that Employee features in that Table. In that way you can get the confirmed invoices by querying that particular table. Later using this list of submitted invoices, you can get the total sales (just add up the net total or whatever total you wish to consider)

Also what version of erpnext are you using ?


Thanks for your kind response. I’m using Version 11 (Would like to go to 12 but no official OVAs are available yet).

I’ve tried that and I was able to get total sales by an employee using a report. But I wish to use that total sales amount (say 50,000) in a Doctype and salary structure formula.


I would advise you to stick to Version 11 till Version 12 is actually stable.

I don’t know about Salary Structure but how about you tell how you want to use that data in your custom doctype. I may be able to help you there.


This feature is not readily available in ERPNext. You can add incentive using “Additional Salary Component” feature. You will have to create Additional Salary at the month end, so that it’s added in the Employee’s Salary Slip for that month.