3.1 KiB
3.1 KiB
Project Plan: Remove RDOT and Hide Resigned Employees
1. Overview
This plan addresses two main adjustments requested by the client:
- RDOT Computation: Remove the "Rest Day Over Time" (RDOT) rule from the payroll computation.
- Attendance Calendar Visibility: Hide employees from the attendance record calendar if their resignation process is completed.
2. Context & Discovery Findings
- RDOT Computation:
app/Services/PayrollService.phpcalculates$regularOtTotaland processes rest days. Currently, rest day premiums are removed, but regular overtime includes all OT. We need to clarify if "removing RDOT" means completely ignoring any OT hours logged on a Rest Day, or removing a specific line item. - Attendance Calendar Visibility:
app/Http/Controllers/AttendanceRecordController.php@calendarqueries theUsermodel whereemployee_statusis 'active'. TheResignationmodel tracks the resignation process (statuscompletedorapproved). We will add awhereDoesntHaveclause to exclude users who have a completed resignation.
3. Socratic Gate (Open Questions for User)
To ensure the implementation exactly matches the business requirements, we need clarification on the following:
- RDOT Rule: When you say "remove the rdot rule", do you mean that if an employee works overtime on their Rest Day, they should NOT receive any overtime pay for it? Or is there a specific multiplier/line item that should be removed?
- Resignation Status: In the database, what is the exact string used for a completed resignation? Is it
completed,approved, or something else in theResignationmodel? Should we also automatically update theemployee_statustoresignedwhen a resignation is completed?
4. Proposed Task Breakdown
Phase 1: Attendance Calendar Adjustment
- Target File:
app/Http/Controllers/AttendanceRecordController.php - Action: Modify the
$queryin thecalendarmethod. - Implementation Details:
- Add a clause:
->whereDoesntHave('resignations', function($q) { $q->where('status', 'completed'); })(or the equivalent correct relationship/status based on answers). - Ensure it doesn't break branch or department filtering.
- Add a clause:
Phase 2: Payroll Computation Adjustment (RDOT)
- Target File:
app/Services/PayrollService.php - Action: Update the overtime calculation loop.
- Implementation Details:
- Identify when
$isRestDayis true. - Prevent
otHoursfrom being added to$regularOtTotalif it's a Rest Day (pending user clarification). - Update any UI/payslip arrays if the RDOT line item was previously explicitly shown.
- Identify when
Phase 3: Verification & Testing
- Run the application and verify the calendar view no longer shows the resigned employee.
- Simulate a payroll calculation for an employee with Rest Day OT to ensure the RDOT is correctly removed.
- Run
php artisan testor standard verification checklist.
5. Agent Assignments
- Backend Specialist: To update
AttendanceRecordController.phpandPayrollService.php. - Orchestrator: To verify the payroll logic aligns with the requested rule change.