I’m trying to get payment slip working. I have created all the necessary parts needed to create a Salary Slip: employee, timesheet, salary structure, salary components and so on.
In the Salary Slip page, under Earnings & Deductions, I’m seeing 2 issues:
Basic component will ignore all formulas in Salary Component Basic. It will be Total Working Hours * Hour Rate regardless of what’s in the formula mentioned above. Please see screen capture.
The reason we need to use formula for Basic is because we have 9-hours shifts. Any more work hours after that will be calculated as Overtime. Hence, we need to subtract what’s been clocked by - 9, and then times the hourly rate to get the Basic wage.
First of all, you have to create a Componants which you refer in formula. let say if you are putting Total Working Hours so you have to pull the total hours by refering some component or some doctype field which is correct here. please check the if condition in the formula field.
also in Basic Componant you are directly entering a amount so you don’t need to checked amount based on formula
First thing I noticed is you put your overtime formula on 3 lines. in my years creating salary structures and calculating net pay and creating salary slip on ERPNext, putting conditions/formula on separate lines has never worked and I do wonder why this is so. All your formula should be on line 1. to Determine which aspect of the formula should apply, use the “and” “or” functions to combine and/or separate parameters.
The reason why the Number in Basic Salary Component is not used might be, could be, because Salary Structure has already “remembered” the first version of the formula, so any further changes in Salary Component will not be used. Am I correct?
I deleted all Salary Component, Salary Structure and start over again. This time Salary Slip used the Basic and Overtime Salary Components’ formula properly.
Now I need to figure out how to add a Custom Field for Overtime Hour Rate and use this in Overtime’s formula.