Hi everyone,
I think I’ve found a bug in how Attendance and Overtime Slip work together, and wanted to share what I found before opening a GitHub issue — in case someone here already knows a fix or a setting I’m missing.
What I’m trying to do:
Set up overtime for an employee:
- Shift Type with Auto Attendance and Allow Overtime turned on
- An Overtime Type using “Salary Component Based” calculation
- Employee has Checkin records — clocked in at shift start, clocked out well after shift end (so there’s real overtime to calculate)
- Attendance auto-marks correctly as “Present” for those days
What’s going wrong:
- When I open an Overtime Slip and click “Fetch Overtime Details”, it comes back empty — even though the employee clearly worked past shift end on several days.
- If I manually add a row and try to submit the Overtime Slip anyway, it crashes with this error:
ZeroDivisionError: division by zero
(in overtime_slip.py, line 312, _calculate_component_based_hourly_rate)
What I found when I checked the actual data:
I checked the Attendance records directly (via bench console), and every single one shows working_hours = 0.0 and standard_working_hours = 0.0 — even for days where the employee has valid checkin/checkout times and is marked “Present.”
So it looks like:
- The system calculates the working hours correctly behind the scenes when marking attendance, but that number never actually gets saved onto the Attendance record.
- Because it’s never saved, there are no hours for the Overtime Slip to find or calculate with — hence the empty “Fetch Overtime Details” and the crash when it tries to divide by zero.
I’ve double-checked HR Settings, the Employee record, and the Shift Type settings, and none of them seem to be the missing piece — this looks like something not being wired up correctly in the app itself, rather than a setting I forgot to configure.
Workaround for now: switching the Overtime Type to “Fixed Hourly Rate” instead of “Salary Component Based” avoids the crash, since that calculation doesn’t rely on the missing hours.
My question: has anyone else run into this, or is there a step/setting that’s supposed to make Attendance save the working hours that I might be missing? If not, I’ll open a proper GitHub issue with the details.
Versions I’m running:
- Frappe: 16.27.0
- ERPNext: 16.28.0
- HRMS: 16.13.0
Thanks in advance!