frappe / hrms

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

Attendance is applied twice for same employee and same day #1086

Closed sjain17 closed 10 months ago

sjain17 commented 10 months ago

Information about bug

The system is creating multiple attendances for the same day / same employee but different shifts. The attendance is prepared via Employee Checkin and using mark auto attendance.

See attached screenshot. Screenshot 2023-11-20 at 6 11 51 PM Screenshot 2023-11-20 at 6 09 56 PM Screenshot 2023-11-20 at 6 05 49 PM

Module

HR

Version

ERPNext: v14.48.1 (HEAD) Frappe Framework: v14.55.0 (HEAD) Frappe HR: v14.16.1 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No response

Code of Conduct

ruchamahabal commented 10 months ago

Its not a bug its a feature

https://github.com/frappe/erpnext/pull/29955

ruchamahabal commented 10 months ago

Dont assign multiple shifts to the employee on the same day if you dont want to use this feature

sjain17 commented 10 months ago

@ruchamahabal I don't think it is a feature. Also, accidentally if someone is assigned with two shifts then the system should not apply present for same day twice. I can understand its a user mistake of assigning two shifts to a single employee but as a product it looks like a bug to the end user and the system should restrict the same.

ruchamahabal commented 10 months ago

If you don't want to use this feature, you can restrict this by a simple server script validation for now. We will add a feature flag to disable this feature later. The feature is being used by many customers currently

sjain17 commented 10 months ago

I can do the server script to stop this but I believe nobody wants confusing attendance and specially if the number of days in a month is 30 and you get 43 attendance is very much like a bug.

ruchamahabal commented 10 months ago

30 and you get 43 attendance is very much like a bug.

As per standard HR policies, if you work multiple shifts a day, you get paid more so this is via a valid use case. But we understand it does not fit your case.

We will add a feature flag to disable this feature later

As I said we will address this by introducing a feature flag to allow disabling this. We are not denying that we won't do anything about this.

sjain17 commented 10 months ago

As per standard HR policies, if you work multiple shifts a day, you get paid more so this is via a valid use case. But we understand it does not fit your case.

It can't fit into anybody's case. Even if you're working in two shifts the employee will be paid Overtime but not the attendance twice.

ruchamahabal commented 10 months ago

It can't fit into anybody's case. Even if you're working two shifts the employee will be paid Overtime but not the attendance twice.

We have government companies who asked for this feature (and are using it) where employees work 2 4-hour shifts (morning & night). They need to calculate and mark attendance per shift so 2 attendance records. Several other HR solutions also provide this feature btw.

sjain17 commented 10 months ago

I am okay with the feature, but still not convinced why someone will need a double present for a single day. In fact, when we try to apply attendance via Attendance doctype twice for the same day it provides a validation error.

ruchamahabal commented 10 months ago

apply attendance via Attendance doctype twice for the same day it provides a validation error.

If it's without any shift it means attendance is for the whole day and hence the validation is thrown. It also validates and does not allow marking attendance twice on the same day for the same shift or overlapping shifts.

If these three cases are not true meaning attendance is being marked for 2 non-overlapping shifts, the system allows

luis05282019 commented 7 months ago

Hi,

I'm new in ERPnext. I got a problem with attendance check-in check-out with a multiple entry with different timestamp. Can anyone help me solve the below image. 421615479_385541607431525_654969094018880834_n

image