HR Module
Attendance Processing
Session Determination Logic

Session Determination Logic

Source: AttendanceProcessingBO.csSetSessionStatus() method

The HR system divides every workday into two sessions — Morning (Forenoon) and Evening (Afternoon). Each session is independently evaluated.

Core Session Decision Tree

Half-Day Decision: The 20-Minute Rule

The system uses a 20-minute threshold to decide WHICH half was worked:

Permission Check on Full Day

When an employee works a full day but arrives slightly late or leaves slightly early:

Permission Budget Calculation

Available = NoOfPermissionsApplicableInAMonth - COUNT(t_HR_PermissionUtilized
            WHERE EmployeeId = @Id
            AND DateAndTime BETWEEN FirstDayOfMonth AND LastDayOfMonth)

-- Default: 2 permissions/month, 10 minutes each
-- Late <= 10 mins → costs 1 permission
-- Early <= 10 mins → costs 1 permission
-- Late > 10 mins → no permission covers this → session marked Absent

Working Hours Thresholds

ThresholdFormulaDefaultOutcome
Full DayMinWorkingHourOfADay + 10 min buffer9h 10mBoth sessions Present
Half Day minimumMinWorkingHourOfADay / 24h 30mOne session Present
Below Half Day< MinWorkingHourOfADay / 2< 4h 30mBoth sessions Absent

Note: MinWorkingHourOfADay is configurable per t_HR_EmployeeType.MinWorkingHourOfADay, defaulting to 9.