1.9 KiB
1.9 KiB
PLAN: Payslip Data Mapping Correction
Context
The payslip simulation engine output 18,360 for Ana instead of 13,000, and labeled her as EMP-00002 instead of SEB2018-2008T.
Root Cause Analysis
- The Salary Defect: During the
SimulatePayslipscommand, we tried to patch Ana's legacy gross salary to 26000 by targetinguser_id = 2. However, Ana isEMP-00002in the new system, meaning heruser_idis actually3(since User 1 is the Admin). By targeting ID 2, we patched the wrong employee entirely! Because of this, the engine fell back to Ana's actual legacygross_salarysitting in the database... which was exactly18,360! - The ID Defect: The data migration script (
ImportLegacyRamesebData.php) generated brand new sequentially assigned Employee IDs (e.g.EMP-00002) instead of importing the exact legacy IDs from Rame_Seb.
Task Breakdown
Phase 1: Dynamic Data Selection
- Update the
SimulatePayslips.phppatcher. Instead of blindly targetinguser_id = 2, we will strictly target Ana's email oremployeeprofile linkage, ensuring the26000gross salary injection successfully hits her record. - We will do the same for Paul Rei Paas (Target B) to ensure his values don't break either.
Phase 2: Employee ID Override
- Update the
ImportLegacyRamesebData.phpscript to map the physical legacy employee ID (legacyUser->employee_idor similar legacy string) onto the newemployee_idcolumn, forcing Ana to natively becomeSEB2018-2008T. - Instead of wiping and perfectly re-importing the whole DB right now, I will explicitly run an update query in
SimulatePayslips.phpto patch Ana's activeemployee_idtoSEB2018-2008Tso the PDF reads it perfectly.
Phase 3: Scrub Exemption Fixes
- Now that Ana's true ID is known, we will fix the attendance absentee scrubber (
1.5 Scrub dirty legacy data) so it scrubsemployee_id3 instead of 2.