2.7 KiB
2.7 KiB
📊 Payroll Data & Payslip Gap Analysis
Based on a forensic mapping of the legacy database rame_seb.sql compared against the structural requirements embedded in the local payslip/ PDF references, here is the gap analysis showing where the legacy system falls out of sync with real-world requirements.
1. Database Schema vs. Structural Capability
| Element | Legacy Implementation (SQL Dump) | Modernized Requirements (Payslips) | Gap Severity |
|---|---|---|---|
| Pay Frequency | Defaulted to monthly or daily for almost everyone. |
Heavy reliance on semi-monthly payouts with Cut-Off division logic (/ 2). |
🔴 High |
| Statutory Setup | No clear structured breakdown for EE shares (lumped in total_deductions). |
Explicit row-by-row itemization needed (SSS, PhilHealth, Pag-IBIG). | 🔴 High |
| Attendance Link | Disconnected. total_deductions was a flat numeric input. |
payslips/ strictly derive Absence and Late amounts dynamically via Hourly/Daily Multipliers. |
🔴 High |
2. Employee Specific Data Drift
We analyzed two primary targets whose real-world payslips were submitted for correlation.
Target A: Ana Regina Mariano
| Data Point | Legacy SQL Value (employee_salary_structures) |
Target Payslip Value | Variance |
|---|---|---|---|
| Gross Salary | ₱20,000.00 | ₱26,000.00 | -₱6,000.00 |
| Pay Type | monthly |
semi-monthly |
Structural Error |
| Daily Rate | (Derived) ₱769.23 | (Target) ₱1,000.00 | -₱230.77/day |
Target B: Paul Rei Paas
| Data Point | Legacy SQL Value (employee_salary_structures) |
Target Payslip Value | Variance |
|---|---|---|---|
| Gross Salary | ₱20,000.00 | ₱22,000.00 | -₱2,000.00 |
| Pay Type | monthly |
semi-monthly |
Structural Error |
| Daily Rate | (Derived) ₱769.23 | (Target) ₱846.15 | -₱76.92/day |
🛠 Mitigation & Architectural Resolution
As engineered inside the new PayrollService and the SimulatePayslips command, we have actively patched this GAP:
- Auto-Patching: The
SimulatePayslipsCLI command forcefully runs an override for Ana and Paul, updating the legacygross_salaryandpay_frequencycolumns to bridge the P6,000 and P2,000 gaps respectively. - Dynamic Division Core: The
PayrollServiceengine was designed to detectsemi-monthly, safely slashing Gross Salaries by/ 2to generate the strict "Cut-Off" Basic Salaries shown on the target PDFs. - Automated Testing Engine: A precise TDD suite has been deployed (
PayrollServiceTest.php) mapping the exact statutory floats to guarantee mathematical precision matching the uploaded PDFs.