The Run Payroll button computed PAYE in the browser, from a four-bracket ladder someone invented. The correct SARS engine existed in the same codebase with zero callers. And once wired in, its “2026/27” tables turned out to be last year's numbers. Drag the salary — the same employee owes three different amounts depending on which code path ran.
Monthly PAYE for one employee under each implementation that has shipped in this codebase. The deltas are what the employer would have over- or under-withheld every month.
rate = salary > 500k ? 30% : > 250k ? 25% : > 100k ? 18% : 10% — applied to the entire salary,
no primary rebate, no UIF cap, no SDL. Marginal tax doesn't work like that anywhere on earth. Bonus: it taxed base salary
but paid out net on gross, so overtime and allowances were never taxed at all.
The file said sars-tax-tables-2026-27; the boundaries inside were 2025/26 (first bracket to
R237,100 instead of R245,100). Found by searching the SARS site instead of trusting the filename — the audit test now
transcribes SARS independently, so drift fails CI.
The first fix rewired Run Payroll — then grepping the deployed bundle found the ladder still alive in the Edit Payroll dialog, writing records through a second door. Lesson: a green PR proves the diff, not that the behaviour is gone everywhere it lives.
The frontend had its own diverged copy of the tax engine on the old year — the on-screen estimator quoted different tax than the payslips the server produced. Collapsed to a single implementation; 17 assertions audit it against the published schedule.