Skip to main content

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

CategoryDescription
Base HoursThe first 4 hours of work. These are covered by the daily base advance.
Regular HoursStandard paid hours beyond the base. Paid at the regular hourly rate.
Overtime HoursHours 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:

  1. The worker was on site for more than 4 hours (the base hours threshold)
  2. 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

ShiftPresenceLunch Deducted?After LunchBaseRegularOvertime
08:00 - 12:004hNo (left before 1 PM)4h4h0h0h
08:00 - 12:084h 8mNo (left during lunch)4h 8m4h0h0h
08:00 - 15:007hYes (covers noon to 1 PM)6h4h0h2h OT
13:00 - 18:005hNo (arrived after noon)5h4h0h1h OT
08:00 - 17:009hYes8h4h4h0h
08:00 - 18:0010hYes9h4h4h1h OT
08:00 - 20:0012hYes11h4h4h3h OT
06:00 - 10:004hNo (under base threshold)4h4h0h0h

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).