Payroll - Attendance Integration

Accurate salary calculations based on actual attendance

The Payroll - Attendance module integrates payroll processing with attendance tracking, enabling accurate salary calculations for hourly-paid employees based on their actual attendance records. This module is essential for companies that pay employees based on actual hours worked, track overtime from attendance records, and need to link attendance data to payslip calculations.

The module automatically links attendance records to payslips based on date period, calculates overtime hours from attendance for hourly employees, and handles timezone accurately for date matching.

Attendance Tracking
Overtime
Work Entries
Hourly Wages

Key Features

Key points

  • Attendance Linking: Automatically links attendance records to payslips based on date period

  • Smart Button: View all attendances for a payslip with one click

  • Attendance Count: Display number of attendances on payslip form

  • Overtime Calculation: Calculate overtime hours from attendance for hourly employees

  • Timezone Handling: Accurate date matching across different timezones

  • Half-Day Logic: Exclude overtime from half-day calculations

  • Work Entry Integration: Seamless integration with attendance-based work entries


User Roles & Permissions

Role Permissions

RolePermissions
HR OfficerView payslips, view attendances, basic payroll operations
Payroll ManagerFull access to payroll, configure overtime settings, manage employee payroll settings
AdministratorSystem configuration, employee setup, work entry source configuration

Viewing Attendances on Payslips

Key points

  • The view is read-only (you cannot create new attendances from here)

  • Attendances are filtered to show only those matching: same employee as the payslip, check-in date within payslip period, check-out date within payslip period

Steps

  • 1. Navigate to Payroll → Payslips

  • 2. Open any validated payslip

  • 3. Look for the Attendances smart button at the top of the form

  • 4. The button shows the count of linked attendances (e.g., "5 Attendances")

  • 5. Click the Attendances smart button to open the list


Employee Configuration

Setting up attendance-based payroll:

Key points

  • When to Enable Overtime from Attendance: Employee is paid hourly, overtime should be calculated from actual attendance, company tracks attendance for this employee

  • When to Disable: Salaried employees with fixed monthly pay, employees without attendance tracking, overtime calculated differently (e.g., manual entry)

FieldsTrường dữ liệuDescription
Overtime from AttendanceOvertime from AttendanceEnable overtime calculation from attendance records (Payroll User only)
RulesetRulesetSelect overtime calculation ruleset (Payroll User only)

Work Entry Sources

Work entry source determines how payslip hours are calculated:

Key points

  • Only payslips with work_entry_source = "attendance" show attendance data

  • Changing work entry source affects how hours are calculated

  • Attendance smart button only appears for attendance-based payslips

Source Types

SourceDescriptionUse Case
AttendanceHours calculated from attendance recordsHourly employees, shift workers
CalendarHours calculated from work scheduleSalaried employees, fixed schedules
PlanningHours calculated from planning/shiftsEmployees with variable schedules

Overtime Calculation

When Overtime from Attendance is enabled:

Key points

  • Calculation example: Expected hours: 9 hours/day, Actual attendance: 20 hours in one day, Overtime: 20 - 9 = 11 hours. Result: Regular hours: 9 hours, Overtime hours: 11 hours (at overtime rate)

  • Overtime approval workflow: If company requires overtime approval, manager receives approval request, manager approves or rejects overtime, only approved overtime included in payslip

  • Overtime outside payslip period is excluded to prevent double-counting

Steps

  • 1. System compares actual attendance hours vs expected hours

  • 2. Calculates overtime: actual_hours - expected_hours

  • 3. Only positive overtime is recorded (no negative overtime)

  • 4. Overtime requires approval if company setting requires it


Half-Day Handling

The module ensures overtime hours are not counted as half-days:

Key points

  • Standard Behavior: Regular work hours can be marked as half-days, half-day calculations affect leave balances

  • With This Module: Overtime work entry types are excluded from half-day logic, overtime hours never count as half-days, prevents incorrect leave balance calculations

  • Why This Matters: Without exclusion, employee works 11 hours overtime, system might mark it as half-day, leave balance incorrectly adjusted. With exclusion, overtime hours processed separately, half-day logic only applies to regular hours, leave balances remain accurate


Troubleshooting

Key points

  • Attendance Smart Button Not Visible: Work entry source is not "Attendance", attendance count is 0, payslip not yet computed. Solutions: Check contract/version work entry source setting, verify attendances exist for the period, compute the payslip first

  • Attendances Not Linked to Payslip: Attendance dates outside payslip period, different employee, timezone mismatch. Solutions: Verify attendance check-in/check-out dates, confirm employee matches, check timezone settings

  • Overtime Not Calculated: "Overtime from Attendance" not enabled, no ruleset configured, overtime requires approval (pending), negative overtime (not recorded). Solutions: Enable "Overtime from Attendance" on employee, configure overtime ruleset, approve pending overtime requests

  • Incorrect Attendance Count: Duplicate attendance records, attendance spans multiple days, timezone conversion issues. Solutions: Check for duplicate check-ins, review multi-day attendances, verify timezone settings

  • Cannot Edit Overtime Settings: User lacks Payroll User permissions. Solution: Request Payroll User access from administrator


Best Practices

Key points

  • Before Payroll Processing: Validate attendances, review overtime approvals, verify dates, check configuration

  • During Payslip Generation: Review attendance count, verify hours, check overtime, audit trail

  • After Payslip Validation: Archive attendances, document exceptions, review patterns, update configuration

  • Employee Setup: Consistent configuration, clear rulesets, regular reviews, training

  • Attendance Management: Timely check-out, correct errors, timezone awareness, regular audits

  • Overtime Management: Clear policies, timely approvals, budget monitoring, pattern analysis

  • Compliance: Audit trail, data retention, access control, regular reviews