Commision Payroll

Hi,

I wondering how i can add commision in sallary generate tools ? is there any hooks or configuration that i can code thats will not affec the erpnext core?

Because i dont want to edit erpnext basic, because it will be bad when we do update

THanks
Bobby

You should add a custom field for commission in Salary Slip form. And write a method in your app which will calculate the commission. Then in hooks.py, specify the doc_events for “Salary Slip” validate method, mention the path of newly created function there.

Hi,

is there any example for adding hooks?..it will be very helpful if there was an example

thanks

Check https://github.com/frappe/erpnext/blob/develop/erpnext/hooks.py#L41

Hi Nabin,

Thanks for the example, but one more question, this hook just add some calculaation or i will ovveride the original method with the one i created?

Thanks,
Bobby

Replied via https://discuss.frappe.io/t/where-i-can-found-list-of-available-hooks/4114