2.0 KiB
2.0 KiB
Project Plan: Payroll Parallel 2 Fixes
Context & Recommendations
- Daily Wage Configuration Recommendation:
- Pay Frequency:
daily - Payroll Type:
automatic - Statutory Contributions: Encode their Full Monthly Amount in the Salary Components tab. Our new logic will automatically divide this by the Payroll Run frequency (e.g., divide by 2 for semi-monthly runs). This prevents double-deductions.
- Pay Frequency:
- Overtime Logic: Overtime will be strictly tied to an approved record in
overtime_applications. Automatic calculation from late clock-outs will be disabled for payroll generation. - Night Differential: ND will revert to standard computation (10% of the employee's standard hourly rate) without being inflated by phantom OT.
Phase 1: Statutory Deductions Divisor (Double Deductions Fix)
- Modify
PayrollService.phpto derive the$divisorfrom$payrollRun->payroll_frequencyinstead of$employee->pay_frequency. - Ensure a
semi-monthlypayroll run correctly applies a divisor of2regardless of whether the employee isdailyormonthly.
Phase 2: Overtime Approval Enforcement
- Update
PayrollService.phpto fetchovertime_applicationsfor the date range wherestatus = 'approved'. - Calculate Overtime Earnings only using the
approved_hoursfrom these explicit applications. - Ignore the raw
overtime_hourstally stored inAttendanceRecord.
Phase 3: Night Differential & Leave Reflection Fix
- Verify Night Differential multiplier correctly targets the base hourly rate.
- Update UI template or API responses if necessary to ensure the custom
Paid Leavesearnings array item correctly displays on the payslip PDF.
Phase X: Verification
- Regenerate a test payroll run for Dinh Chavez and verify SSS/PH/PI deduct exactly half of the encoded monthly amount.
- Verify Dinh Chavez receives 0 Overtime pay since no approved application exists.
- Verify Night Differential calculates perfectly at
(Hourly Rate × 10%) × ND Hours. - Verify Birthday/Vacation leave appears explicitly in Earnings.