Time and Hours Calculations
The system uses a specific set of rules to figure out how many hours a worker gets paid for. Understanding these rules is key to making sense of attendance records and payment calculations.
Hour Categories
| Category | Description |
|---|---|
| Base Hours | The first 4 hours of work. These are covered by the daily base advance. |
| Regular Hours | Standard paid hours beyond the base. Paid at the regular hourly rate. |
| Overtime Hours | Hours that go beyond the regular threshold. Paid at the overtime hourly rate. |
Calculation Rules
Step 1: Calculate Presence Hours
- Take the departure time and subtract the arrival time
- If the shift crosses midnight (an overnight shift), the system handles that correctly
Step 2: Apply Lunch Deduction
A 1-hour unpaid lunch break is deducted, but only if both of these conditions are true:
- The worker was on site for more than 4 hours (the base hours threshold)
- The worker was present for the entire noon to 1:00 PM window (meaning they arrived at or before noon AND left at or after 1:00 PM)
If the worker left before 1:00 PM or arrived after noon, no lunch deduction happens.
Step 3: Classify the Hours
After the lunch deduction (if it applied):
- First 4 hours = Base hours (these are covered by the daily advance)
- Remaining hours after base:
- If the remaining time is less than 4 hours, it all counts as Overtime
- If the remaining time is 4 hours or more, the first 4 of those are Regular and everything after that is Overtime
Step 4: Minimum Thresholds
- Minimum payable hours: 4 hours total. If a worker puts in less than 4 hours, their earnings for the day are zero (unless a special payment gets approved).
- Minimum overtime: 1 hour. Overtime fractions under 1 hour do not get paid.
Examples
| Shift | Presence | Lunch Deducted? | After Lunch | Base | Regular | Overtime |
|---|---|---|---|---|---|---|
| 08:00 - 12:00 | 4h | No (left before 1 PM) | 4h | 4h | 0h | 0h |
| 08:00 - 12:08 | 4h 8m | No (left during lunch) | 4h 8m | 4h | 0h | 0h |
| 08:00 - 15:00 | 7h | Yes (covers noon to 1 PM) | 6h | 4h | 0h | 2h OT |
| 13:00 - 18:00 | 5h | No (arrived after noon) | 5h | 4h | 0h | 1h OT |
| 08:00 - 17:00 | 9h | Yes | 8h | 4h | 4h | 0h |
| 08:00 - 18:00 | 10h | Yes | 9h | 4h | 4h | 1h OT |
| 08:00 - 20:00 | 12h | Yes | 11h | 4h | 4h | 3h OT |
| 06:00 - 10:00 | 4h | No (under base threshold) | 4h | 4h | 0h | 0h |
Reading the Table
- 08:00 - 15:00: The worker was on site for 7 hours. Lunch gets deducted because they were there over the noon-to-1 window, bringing it down to 6 hours. The first 4 are base. The remaining 2 are less than 4, so they count as overtime.
- 08:00 - 17:00: On site for 9 hours. After the lunch deduction, that is 8 hours. First 4 are base. The remaining 4 are exactly 4, so they all count as regular hours with no overtime.
- 08:00 - 18:00: On site for 10 hours. After lunch, 9 hours. First 4 are base. Remaining 5 -- since that is 4 or more, the first 4 are regular and the last 1 is overtime.
Manual Override
An admin can override the total hours for any attendance record. When they do this:
- The manually entered hours replace whatever the system calculated
- Regular and overtime are recalculated from the override value using the same rules
- The override is recorded for audit purposes
Below Minimum Hours
If a worker's total hours come in under 4 (the minimum payable threshold):
- The attendance gets flagged as below minimum hours
- Earnings for that day are zero
- A special payment can be requested by the manager and approved by the admin to compensate the worker despite the short shift
- These special payments have their own amount, reason, and approval status
Time Format
All times are recorded in 24-hour format (for example, 08:00 or 17:30). The system operates in Sri Lanka timezone (UTC+5:30).