Salary & Tax calculation issue

How do I apply the payroll multiple tax roles in the payroll module in ERPNEXT. When I put the new role in the income tax slab, it is calculated almost wrongly. It is calculated over the course of the year, paid and remaining, and with the same salary every month, the value of the tax will look different. Is there a solution or another way to apply the tax?

You can create Salary Component for different Tax and put the tax formula in it.

This way you can apply the tax for monthly payroll.

I have the same problem with ERP Next version 14.
I created the tax slabs, when I run payroll for January it gives the expected tax value. But when I run it for February for the same employee with same salary components and values it gives a different tax value. Can’t understand how.

UPDATE: I figured out how the problem occurs. But don’t why it behaves that way or how to get the correct tax value.

Below is my tax slabs (i.e. Sri Lanka)
Screenshot_6-3-2024_93949_hrm-poc.stingray.lk

Hope it is understood the above calculation is not easy to put into a formula.

If I assign monthly salary 100,000.00 for an employee, he must not have any tax as 1,200,000.00 per annum is tax free income. If I give more than that the employee must be subjected to tax based on the slabs above.

When I do run the payroll it calculates the tax accurately for the first month, but not for the second and subsequent months.

After sepnding hours I realized that based on the monthly salary the system calculates the projected annual salary, and then calculates the projected annual tax. Then devide it by 12 to get the monthly salary component. So far so good.

But for the next month the annual tax is devided by 11, and next month 10 and it goes on. There must be somesetting or configuration to prevent this happening,

Can someone point me towards where it is.

Salary slabs do not work for sri lanka.
I used the salary component and salary structure completely ignoring the tax slab.

I have just implemented the Income tax slab for “Egypt”, it works correctly, and also know it will work for you also, i also once stuck in this income tax slab issue

You have to go in backend code (salary_slip.py file), and debug using print statement.
it will take time but by seeing the values you can easily debug.

Also set the Salary Component properly, if u do this correctly the income tax slab works perfectly.

There’s something wrong in the calculation. I didn’t go code level. If we have to go to the code and change something to make it work, then I do not consider it works correctly in the first place. None of us here are here to learn programming I suppose.

Having said that, if you say it works perfectly you have the burden of showing us how. Appreciate your time.

see below are the components…carefully look how to check box is marked
the “Income tax” component, it is marked something else
setup the salary component like this





maybe it helps