Attendance and Payroll System Documentation
1. Clock In/Out Same Time Handling
1.1 Problem
- Employees sometimes clock In and Out at the exact same time.
- System used to mark them Absent, even if they were present.
- Sub-case: If Start = End but earlier than Shift Start, the deduction logic was skipped.
1.2 WEEKLY / MONTHLY SALARY SHEET Report – SameTime Clock In and Clock Out
- If Clock In = Clock Out → Employee is marked Present.
- A 1-hour deduction is always applied (before, equal to, or after shift start).
1.3 Example
| Shift Start | Clock In | Clock Out | Status | Deduction |
|---|---|---|---|---|
| 09:00 | 09:30 | 09:31 | Present | 1 Hour |
| 09:00 | 08:00 | 08:00 | Present | 1 Hour |
2. WEEKLY / MONTHLY SALARY SHEET Report – Missing Clock In or Clock Out
- If In is missing → Deduct 1 Hour.
- If Out is missing → Deduct 1 Hour.
| Clock In | Clock Out | Status | Deduction |
|---|---|---|---|
| NULL | 18:00 | Present | 1 Hour |
| 09:00 | NULL | Present | 1 Hour |
3. Reported Issues – Payroll for the Month Report (Salary Sheet)
3.1 Total Time Short Not Deducted
- Issue: 1 hour not deducted if total working time is short.
- Condition: Applies only if salary type = Monthly.
3.2 Late Deduction Not Working Properly
- Issue: 1 hour not deducted for late arrival.
- Condition: Applies only if either Start Time or End Time is missing.
- Expected: Deduct 1 hour if only one time entry (start or end) is missing.
Given Test Case: 1248 – Rizwankhanbismillahkhan
5. Night Shift Handling
- Night shifts cross midnight, often causing errors.
- Fix (03/Sep/2025): Apply 1-hour deduction if either In or Out is missing (same as day shifts).
6. Saturday Special Case
- Fix (13/Sep/2025): On Saturday, if Out Hour is missing, system applies no deduction.
| Day | Clock In | Clock Out | Deduction |
|---|---|---|---|
| Saturday | 09:00 | NULL | 0 Hour |
7. Weekly Payroll Report – Late/Short Deduction
- Fix (13/Sep/2025): If Start Hour or End Hour missing (Day/Night), add 1-hour Late Minutes in Weekly Report.
| Start Hour | End Hour | Late Minutes |
|---|---|---|
| NULL | 18:00 | 60 mins |
| 09:00 | NULL | 60 mins |
8.Additional Attendance Handling Rules (02/Oct/2025 Update)
8.1 Late Arrival with Proper Exit
- Condition: Employee comes late but marks exit correctly.
- Behavior: Only Late Minutes are calculated.
- Example: Shift Start 09:00, In 09:15 → Late = 15 mins
8.2 Late Arrival + Missing Exit
- Condition: Employee arrives late and forgets to mark exit.
- Behavior: Late Minutes + 60 mins Penalty.
- Example: Shift Start 09:00, In 09:20, Exit missing → 80 mins
8.3 Missing Entry + Proper Exit
- Condition: Entry missing, exit available.
- Behavior: Fixed 60 mins Penalty.
- Example: In = NULL, Exit 18:00 → 60 mins penalty
8.4 Start Time = End Time (Invalid Record)
- Condition: In = Out time.
- Behavior: Apply 60 mins penalty (or Late + 60 if late).
- Example: Shift Start 09:00, In 09:20, Out 09:20 → 80 mins
8.5 On-Time Arrival + Missing Exit (New Fix)
- Previous: System marked Late + Short Time.
- Now: Only Short Time is considered.
- Example: Shift Start 09:00, In 09:00, Exit missing → Short Time only
Change Log
| Date | Change Description | Requested By | Implemented By |
|---|---|---|---|
| 16/Apr/2025 | Same In/Out rule → Always apply 1-hour deduction | Zain | Muhammad Umair |
| 16/Apr/2025 | Missing In/Out → Mark Present + Deduct 1 hour | Zain | Muhammad Umair |
| 15/May/2025 | Payroll Report Fix – Total Time Short not deducted | Zain | Muhammad Umair |
| 03/Sep/2025 | Added Night Shift Deduction Logic | Zain | AbdulRahman |
| 13/Sep/2025 | Saturday rule → No deduction if Out missing | Zain | AbdulRahman |
| 13/Sep/2025 | If Start/End missing (Day/Night) → Add 1 Hour Late Minutes in Weekly Report | Zain | AbdulRahman |
| 16/Sep/2025 | Fixed Same In/Out (even before shift start) → Always 60 mins deduction | Zain | AbdulRahman |
| 02/Oct/2025 | Added detailed Late/Missing Entry/Exit Penalty Handling + Fixed Short Time logic | Zain | Cartzlink Team |