Published July 21, 2026
The client runs a limestone processing operation with workers on rotating shifts, including regular hours and separate overtime sessions when workers stay to hit production quotas. Attendance and payroll were disconnected from each other, so calculating gross pay — daily rate, overtime at a premium multiplier, and statutory deductions — for every worker every cycle was a manual, error-prone process.
We built a QR-code attendance system: workers scan to clock in and out, managers scan to verify, and admins get a dashboard to manage worker rates, generate payroll, and export attendance/payroll reports. Payroll is calculated automatically from attendance records using the client's actual rate structure, with role-based access so managers can only scan attendance while admins control rates and approve payroll.
During testing, we found that overtime hours were being silently dropped for workers who clocked out of their regular shift shortly after finishing an overtime session. The system correctly recorded the overtime clock-in and clock-out timestamps, but the regular clock-out logic was overwriting the calculated overtime hours back to zero in that specific sequence — a gap that, left unfixed, would have meant real underpayment across the workforce.
We traced this to an ordering assumption in the clock-out code: it assumed that if an overtime session was already marked as closed, the overtime hours must already be calculated and saved — which wasn't reliably true. The fix recalculates overtime directly from the stored timestamps whenever a completed overtime session is detected, rather than trusting a value that could be stale.
Because this affects real pay, we didn't just patch the function — we wrote failing tests that reproduced the bug, wrote separate tests confirming every other clock-in/clock-out scenario still worked exactly as before, and shipped the fix only once both sets passed. We also wrote a script to recalculate and correct historical attendance records that had already been affected, with a dry-run step to review changes before applying anything.
Overtime is now calculated correctly and automatically for every worker, closing a gap that had been resulting in real underpayment. Payroll that previously required manual calculation per worker per cycle is now generated directly from attendance data, with exportable reports for record-keeping.
Tell us what you need and we'll help you figure out the right approach.
Get in touchWe collect anonymous analytics (device, browser, approximate location) to understand traffic. Nothing is shared or sold. See our Privacy Policy.