In addition to what @trustedcomputer mentioned/linked, here are some areas that need improvement.
As mentioned, the feature request for allowing multiple income tax slabs would be great. I think this can further be enhanced as to how we “assign” the tax slab. I think it would be helpful to be able to use the tax slab like we use variables/components. We don’t want to “blindly” apply the tax to “gross income”. There are other tax jurisdictions or tax authorities that have more complex computations. If we could “call” or “assign” the tax slab inside a formula, that would give great flexibility.
I also think the limitation of only two types of Salary Components is not sufficient. Consider Employer Contributions and Employer Taxes. While we can use the existing system for these types of components, it’s not straightforward. See this thread for reference. You can also search “employer contributions” for others.
In the above mentioned “mega thread”, I think we can confirm there is a bug in the use of condition + formula. If they are not intented to work together, when filling one out, the other should be visibly disabled or there should be a note stating that they can’t be used together. We should be able to use both condition and formula, but it does not work.
Also discussed in the “mega thread”… Year To Date Gross Pay calculation is a sticking point. I understand it’s a catch-22, how do we generate formulas considering YTD_gross_pay, when the current period’s pay is not submitted yet. Saving the Salary Slip then Submitting the Salary Slip changes the values. As mentioned this makes it impossible to verify the amounts before submitting. This also makes “testing” salary components difficult. There are two built-in tests, but they are inadequet and behave differently.
- In Salary Structure Assignment there is a feature in the actions menu “Preview Salary Slip”. This only generates a preview of the first salary slip for the year. This is not useful to test components that rely on YTD numbers.
- In Salary Structure, there is a feature in the actions menu, “Preview Salary Slip”. This generates a preview for the next (or current) pay period. This is great if the YTD_gross is within the range I’d like to test.
What’s really needed is a fully capable test where the user can input fictitious numbers for ‘pay_period/date’, ‘ytd_gross’, etc, to accurately test the Salary Components. We tried creating such a test, but with the validations used in HRMS, we haven’t been able to replicate the behavior.
In the USA, there are many tax jurisdictions, employee benefit types, etc. I think we should start by perfecting Federal Income tax, as that’s the low hanging fruit. Take a look at the W4 Form that employees fill out to determine their tax withholdings. How nice would it be to have a form in HRMS that captures the values and builds a Salary Component Deduction. I’ve built something outside of ERPNext that considers these values, and builds a complex formula using other Salary Components, including statistical components. Again, it’s not easy to test them (without going through a long process of running a test payroll run).
Better documentation on how Salary Components work, and how/when YTD values are calculated, would be a great help. Some of this seems mysterious, especially using conditions + formulas.
Other areas where I’ve struggled are related to the limitations within the formula. We can’t use important functions like MIN, MAX, and more. I’m sure blocking their use is for security reasons, but it is severely limiting (makes for much more complex formulas).