frappe / hrms

Open Source HR and Payroll Software
https://frappe.io/hr
GNU General Public License v3.0
1.39k stars 728 forks source link

Leave Without Pay calculation is incorrect if back dated salaries are prepared #901

Closed sjain17 closed 1 year ago

sjain17 commented 1 year ago

Information about bug

I am doing a migration for payroll from April 23 to Aug 23. The calculation of leave without pay is incorrect in the below case -

  1. The employee's attendance is having 3 leave without pay in the month of Aug 2023 and 2 LWP in Jul 23.
  2. Prepare salary via payroll entry for Aug 2023, and keep the salary in draft. The salary is showing 3 LWP which is correct.
  3. Now prepare salary via payroll entry for July 2023, and keep the salary in draft. The salary is showing 2 LWP which is correct.
  4. Now prepare salary via payroll entry for Jun 2023, and keep the salary in draft. The system is showing the 5 LWP in the month of June 2023; however, the employee was present for all 30 days.

I believe if the salary slip calculation is incorrect as it is considering all Aug, and Jul LWP in the month of Jun as well which is incorrect. It should be followed in the next month and not in the previous month if even the salary is not submitted.

Module

HR, Payroll

Version

ERPNext: v14.39.0 (HEAD) Frappe Framework: v14.50.0 (HEAD) Frappe HR: v14.10.6 (HEAD) India Compliance: v14.16.2 (HEAD) Payments: v0.0.1 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No error, calculation mistake only.

Code of Conduct

ruchamahabal commented 1 year ago

@sjain17 Please share screenshots for:

sjain17 commented 1 year ago

Here are some screenshots as per above. However, I have blurred the confidential information. WhatsApp Image 2023-09-22 at 12 01 00 PM WhatsApp Image 2023-09-22 at 12 01 00 PM (1) WhatsApp Image 2023-09-22 at 12 01 01 PM WhatsApp Image 2023-09-22 at 12 01 01 PM (1) WhatsApp Image 2023-09-22 at 12 01 02 PM

sjain17 commented 1 year ago

WhatsApp Image 2023-09-22 at 12 01 01 PM (2)

sjain17 commented 1 year ago

Any luck in replicating the issue?

sjain17 commented 1 year ago

Is there any update on the issue?

ruchamahabal commented 1 year ago

@sjain17 If the employee has a relieving date set, then this could be fixed with https://github.com/frappe/hrms/pull/926 After that fix, cannot reproduce it. This fix was released in 14.12.1

Update to the latest instance and try again

sjain17 commented 1 year ago

@ruchamahabal If the employee doesn't have a relieving date then?

ruchamahabal commented 1 year ago

Try updating your instance and check first.

We are unable to reproduce this at our end. Also, check if your custom app is affecting this logic, I can see some custom fields in the payment days tab.

sjain17 commented 1 year ago

Sure, let me try updating the HRMS.

ruchamahabal commented 1 year ago

Closing as not reproducible anymore