ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Help Required in Preparation of salary component/salary structure



I am facing issue in preparation of salary for leave without pay i have tried all the things but still i m unable to create it,
I have applied lwp for a particular employee still when i m creating salary full month salary is being creating,
several time i have created salary structure is there issue with salary structure that i created Kindly help me to resolve this

or the issue is on salary structure


I think “depends on payment days” is unchecked for salary components.

Go to salary components list and select a particular salary component> and then check/tick mark depends on payments days checkbox.

Hope this helps.


I have done this but still facing same issue


Did you try creating a Payroll Entry? If you are running the Preview Salary Slip option from Salary Slip, there was an issue with Preview last I tried it as well, but the Payroll entry or Salary Slip works well.




There are 2 aspects that you need to keep in mind for LWF, 1 is the attendance and 2 is leave application.

  1. Check whether you have updated the attendance of that employee. If he has been marked absent (let say for 2 days) then payment days considering June month would be 28 days (30 - 2). If you have checked “Depends on payment days”, then it will calculate salary as per payment days i.e. 28 days.

  2. In case of leave application, if a specific leave type is checked “Leave without pay” then an employee applying for that leave will not be paid and while generating salary slip those days (for which the leaves have been applied) will be marked as “LWF”. In other words, payment days would reduce and salary would be processed for only those days.

Hope this helps.



I have tried that too but in salary slip its showing LWP 11 days that i have applied but it is not calculating deductions accordingly


I have updated attendance and applied LWP, it showing working days after LWP, or payment days but not calculating salary accordingly

her you can see that payment days are 20 but salary is calculating for full month
it should be 20days salary


what is the exact salary assigned? Well I needed to show the actual leave without pay deduction so I created a separate component where I calculate salary of leaves so the earning part is complete salary and leave without pay are deducted from my component


as i mentioned gross salary is 25k
she must get 20 days salary 16129
that is 25000/31*20


Have you done any customisations?


Maybe this feature is not available anymore in latest update? As there used to be an option of ‘depends on lwp’ but I always update my v11 and now there is no more such option. Maybe you have to create a separate deduction component for leave without pay.


I have made a filed of month days which have total days of month without weekends and additional holidays


when used this formula it showing following error while creating Payroll entry


where i supposed to define month days


In my situation I needed month days but you can use working days or payment days. Actually when such situation arise that we have eid holidays so the working days are very less and hence the per day leave deduction is very high. So in my company the standard is that per day leave calculation will be based on only all the month days including holidays.
For that I updated salary slip and added a new field of month days and calculated the days of month through python library numpy.



So the option of “Depends on Lwp” is now “Depends on payment days”. It is just a terminology change.