Session Determination Logic
Source:
AttendanceProcessingBO.cs→SetSessionStatus()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 AbsentWorking Hours Thresholds
| Threshold | Formula | Default | Outcome |
|---|---|---|---|
| Full Day | MinWorkingHourOfADay + 10 min buffer | 9h 10m | Both sessions Present |
| Half Day minimum | MinWorkingHourOfADay / 2 | 4h 30m | One session Present |
| Below Half Day | < MinWorkingHourOfADay / 2 | < 4h 30m | Both sessions Absent |
Note:
MinWorkingHourOfADayis configurable pert_HR_EmployeeType.MinWorkingHourOfADay, defaulting to 9.