payslip-ingest/tests/fixtures
Viktor Barzin 26e43b1055 parser + P60 ingest: split income_tax cash/RSU, add P60 ground-truth
Meta variant-B payslips gross up Taxable Pay for RSU and compute PAYE on
the grossed-up figure, so `income_tax` on the slip is the total PAYE
(cash + RSU-attributed). Dashboards that stacked the raw figure made
vest-month tax look ~2x higher than "cash tax paid". Introduce
`cash_income_tax = income_tax * (gross_pay - pension_sacrifice) /
taxable_pay` as a derived column alongside the raw figure. Dashboards
can now stack cash vs RSU-attributed tax as separate segments.

Also capture YTD column values of `RSU Tax Offset` and `RSU Excs Refund`
from the Payments grid — needed for reconciliation against HMRC annual
figures.

P60 ingest: new parser under `parsers/p60.py` anchoring on statutory
HMRC line labels (`Tax year to 5 April YYYY`, `Employer PAYE reference`,
`In this employment` pay/tax row, NI letter bands). Processor routes
documents carrying the `p60` Paperless tag to `_handle_p60` which
writes to the new `payslip_ingest.p60_reference` table (one row per
tax_year+employer). App lifespan resolves the tag id at startup; missing
tag disables dispatch without breaking payslip ingest. Paperless tag
creation + webhook config are manual follow-ups.

Migrations:
- 0004 — cash_income_tax + ytd_rsu_tax_offset + ytd_rsu_excs_refund on
  payslip, all nullable.
- 0005 — p60_reference table with (tax_year, employer) unique +
  paperless_doc_id unique for idempotent re-uploads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 15:23:05 +00:00
..
meta_uk_2021_06_variant_a_bik.txt processor + parser: fix 3 backfill failure modes 2026-04-19 12:00:00 +00:00
meta_uk_2021_08_variant_a.txt meta_uk parser: add variant A (2019-2022) + variant C (2022-2023) 2026-04-19 11:52:59 +00:00
meta_uk_2022_11_variant_c.txt meta_uk parser: add variant A (2019-2022) + variant C (2022-2023) 2026-04-19 11:52:59 +00:00
meta_uk_2025_03.txt v2: regex parser for Meta UK template + accurate RSU tax attribution 2026-04-19 10:53:52 +00:00
meta_uk_2026_02.txt v2: regex parser for Meta UK template + accurate RSU tax attribution 2026-04-19 10:53:52 +00:00
meta_uk_p60_2024_25.txt parser + P60 ingest: split income_tax cash/RSU, add P60 ground-truth 2026-04-19 15:23:05 +00:00