DODIL BLOG
DocsLog inSign up

Modules / Payroll

Payroll

Pay your people correctly and on time: monthly and weekly pay runs from the HR record, holidays, sickness and approved hours, with tax, National Insurance, pension and statutory pay worked out for you. HMRC gets its submission on payday, employees get their payslips, P45s and P60s, the bank pays the net, and the books get one clean journal for every run.

People ask for it as: “payroll”, “run the payroll”, “payslips”, “PAYE”, “RTI”, “FPS”, “auto-enrolment”, “P45”, “P60”, “statutory sick pay”, “maternity pay”, “bring payroll in-house”, “Lohnabrechnung”

Who uses it

RoleDoesSees
Payroll administratorkeeps each employee's tax code, NI category, starter declaration and pension membership; opens and calculates runs; records HMRC coding notices; fixes what the calculation flagsevery payroll record and payslip of their companies
Payroll manager / finance directorapproves pay runs, approves the approver's own payslip when a peer is the approver, runs off-cycle payments, keeps elements, schemes and statutory rates, reads the HMRC liabilityevery payroll record and payslip of their companies
Anyone on the payrollreads their own payslips, P60s and P45, and their tax code and pension membership; opts out of the pensiononly their own payroll documents
The owner (or whoever the owner names)holds the controls (who may approve, the small employer and employment allowance claims, whether payments trusts payroll's approval, the proration method), signs the year-to-date migrationeverything
The systemopens periods, reads hr, time-off and timesheets, marks payslips stale, posts journals, requests payouts, sends FPS, EPS and pension files through capabilities, publishes payslips, P45s and P60s, runs the year end, takes payments' confirmations, loads year-to-date figureseverything, through its own service account

What it has to do

Reference user stories. Each has a test written into it — the given / when / then — which becomes an automated check once it is built. Expect to keep some, change some and drop some.

Things people do

  • PRL-01As a payroll administrator, I want each starter on the payroll with the tax code, NI category and pension membership HMRC and the scheme expect, so that the first payslip is right.

    Given hr's extract for UK01|2026-11 names starter 4450 (start 2026-11-16, salary 30,000.00 a year, employee, monthly schedule); they bring a P45 from their last employer: tax code 1257L, leaving date 2026-10-31, pay to date 15,200.00, tax to date 1,363.40 · when I complete their payroll record · then a payroll employee 4450-1 (payroll_id "4450-1", the HMRC payroll ID of the employment) with tax code 1257L cumulative from 2026-11-16 (source p45), the previous pay and tax to date kept as P45 figures (never added to this employer''s year to date, used only in the cumulative calculation), NI category A (age 22 to state pension age, no other category applies), starter declaration not needed (a P45 was given), student loan none; the record is dated rows; a starter with no P45 gives a starter declaration instead (PRL-02); a record with no tax code is refused by the run with the person named

    Payroll administrator · screen: Employees · reference: not built

  • PRL-02As a payroll administrator, I want the tax code for a starter without a P45 set from their starter declaration, so that they pay the right tax until HMRC sends a code.

    Given three starters without a P45 in 2026-11: 4451 statement A (first job since 6 April), 4452 statement B (only job now, had another since 6 April), 4453 statement C (has another job or a pension) · when I record each statement · then tax codes 1257L cumulative (A), 1257L month 1 (B), BR (C), each dated from the start date with source starter_checklist; no statement by the first run gives 1257L month 1 (the emergency rule) and a warning on the run; the statement letter goes on the first FPS

    Payroll administrator · screen: Employees · reference: not built

  • PRL-03As a payroll administrator, I want a tax code change from HMRC recorded from the date HMRC says, so that the next payslip uses it and the past is never rewritten.

    Given employee 4410 on 1257L cumulative; an HMRC P6 coding notice issued 2026-11-10 changes it to 1100L, to be used from the next pay day · when I record the notice (or the HMRC data provisioning capability delivers it) · then a dated tax code row 1100L cumulative from 2026-11-10 with source p6 and the notice reference; the November run (pay date 2026-11-30) uses it and the cumulative calculation refunds or collects the difference; an approved payslip is never recalculated; I cannot change my own tax code (email AND sub)

    Payroll administrator · screen: Employees · reference: not built

  • PRL-04As a payroll administrator, I want the monthly run calculated from the HR record with every figure shown, so that I check a payslip by reading it, not by redoing it.

    Given run UK01-M-2026-27-M08 (monthly, period 2026-11, pay date 2026-11-30, tax month 8: 6 November to 5 December); employee 4410: salary 36,000.00 a year (hr), tax code 1257L cumulative, NI category A, pension 5% employee / 3% employer on qualifying earnings by net pay arrangement, paid the same every month since April (taxable pay to date at month 7: 20,132.00, tax to date 2,558.80); starter 4450 from 2026-11-16 at 30,000.00 (PRL-01) · when I calculate the run · then 4410: gross 3,000.00; pension on qualifying earnings 3,000.00 - 520.00 = 2,480.00: employee 124.00, employer 74.40; taxable pay 2,876.00, to date 23,008.00, free pay to date 8,386.00 (1257L, month 8), taxable to date 14,622 (rounded down to the pound), tax to date 2,924.40, tax this month 365.60; employee NI (3,000.00 - 1,048.00) x 8% = 156.16, employer NI (3,000.00 - 417.00) x 15% = 387.45; net pay 3,000.00 - 124.00 - 365.60 - 156.16 = 2,354.24; cost to the employer 3,461.85. 4450: 2,500.00 x 11 / 21 working days (16 to 30 November in hr''s work pattern) = 1,309.52. Each payslip line names its source (hr extract line, absence_ref, sheet) and the rate row it used; the calculation is a pure function, so calculating again gives the same payslips and replaces the previous draft

    Payroll administrator · screen: Pay runs · reference: not built

  • PRL-05As a payroll administrator, I want the weekly run for hourly staff paid from their approved hours, so that nobody is paid for time that was not approved or missed for time that was.

    Given run UK01-W-2026-27-W33 (weekly, worked 2026-11-09 to 2026-11-15, pay date Friday 2026-11-20, tax week 33); worker 4470: 13.0000 an hour (hr), statement C so tax code BR, NI category A, eligible jobholder; timesheets approved 32.00 hours for 2026-W46 · when I calculate the run · then gross 32.00 x 13.0000 = 416.00; qualifying earnings 416.00 - 120.00 = 296.00: employee pension 14.80, employer 8.88; taxable 401.20 x 20% (BR) = 80.24; employee NI (416.00 - 242.00) x 8% = 13.92, employer NI (416.00 - 96.00) x 15% = 48.00; net 416.00 - 14.80 - 80.24 - 13.92 = 307.04; the payslip shows the hours and the rate (an itemised statement for a time worker); hours approved after the calculation mark the payslip stale (PRL-25)

    Payroll administrator · screen: Pay runs · reference: not built

  • PRL-06As the payroll manager, I want to approve a run that somebody else calculated, so that no one person can pay themselves or anyone else unchecked.

    Given run UK01-M-2026-27-M08 calculated by payroll admin A (sub a-1); 46 payslips, net 98,412.60; one of them is my own (payroll manager M, person 2101); the pay date is 2026-11-30 · when I try to approve the run on 2026-11-25; my peer payroll manager P approves my payslip; I approve the run · then gates: no payslip stale, every employee with a tax code, every hourly rate at or above the national minimum wage for the worker''s age band on the pay date (a dated row), no net pay below 0.00, approval at least bacs_lead_working_days (3) before the pay date, the approver is not the preparer (email AND sub), and the approver''s own payslip already approved by a peer; my first try is refused {gate: own_payslip_by_peer}; P approves my payslip (approve_approver_payslip), then my approval approves the run; after commit (from pending rows): hr''s extract is marked sent, the journal posts (PRL-16), the payouts are requested (PRL-12), the FPS is sent (PRL-13), the pension contributions are sent (PRL-15); approved payslips are frozen

    Payroll manager / finance director · screen: Pay runs · reference: not built

  • PRL-07As a payroll administrator, I want approved sickness and unpaid leave turned into deductions and statutory sick pay, so that the payslip follows what time-off approved.

    Given time-off: 4410 sick 2026-11-10 to 2026-11-12 (3 days, self-certified, pay treatment sick); 4412 sick 2026-11-16 to 2026-11-19 (4 days, a period of incapacity for work); 4480 unpaid leave on 2026-11-16 (1 day, salary 26,000.00); 4410 and 4412 on 36,000.00 a year, average weekly earnings 692.31; company sick pay none (statutory only); SSP 123.25 a week from 2026-04-06, payable from the first qualifying day of a period of incapacity (4 or more consecutive days), the lower of the rate and 80% of average weekly earnings, with no waiting days and no lower earnings limit test from that date (dated rows ssp_waiting_days 0 and ssp_lel_test 0 from 2026-04-06; 3 and 1 before) · when the November run is calculated · then 4410: sickness deduction 3 x 138.4615 (36,000.00 / 260) = 415.38 and no SSP: 3 days are not a period of incapacity for work (v2: the law, not a setting; the v1 example paid 73.95, which the law does not), unless a later spell within 8 weeks links to it; gross 3,000.00 - 415.38 = 2,584.62; 4412: sickness deduction 4 x 138.4615 = 553.85, SSP 4 x 24.65 (123.25 / 5 qualifying days) = 98.60 (80% of 692.31 is 553.85, above 123.25, so the flat rate applies); gross 3,000.00 - 553.85 + 98.60 = 2,544.75; tax, NI and pension follow from each; 4480: unpaid deduction 1 x 100.0000 (26,000.00 / 260) = 100.00; each line names its absence_ref and revision; SSP is never paid on a day that is not a qualifying day in hr''s pattern

    Payroll administrator · screen: Pay runs · reference: not built

    Usually different per customer: a company sick pay scheme (full pay for N days, then SSP) is a dated scheme row; SSP is offset against it

  • PRL-08As a payroll administrator, I want a leaver's final pay worked out with their untaken holiday and a P45 produced, so that they leave paid in full and with the right paperwork.

    Given leaver 4490 in hr's extract for UK01|2026-10 (last day 2026-10-16, salary 36,000.00, 1257L cumulative); time-off answers 4.79 days of annual leave owed on the last day (TOF-22) · when the October run (pay date 2026-10-30) is calculated and approved · then salary to the last day 3,000.00 x 12 / 22 working days = 1,636.36; holiday in lieu 4.79 x 138.4615 = 663.23; gross 2,299.59; the FPS carries the leaving date 2026-10-16; on approval a P45 (parts 1A to the employee, the figures to date) is produced as a document and the payroll employee moves to left; a payment after the P45 (a late bonus) is taxed on 0T month 1 and reported with the leaving date; a negative holiday balance is deducted only when deduct_overtaken_holiday is set, and never below the national minimum wage

    Payroll administrator · screen: Pay runs · reference: not built

  • PRL-09As a payroll administrator, I want maternity pay assessed and paid from the facts time-off recorded, so that SMP is right and the company recovers it from HMRC.

    Given time-off: 4431 maternity from 2026-11-02, expected week of childbirth from Sunday 2026-11-15, MATB1 received 2026-06-01; hr: salary 33,800.00 a year, employed since 2023; her two paydays in the relevant period paid 2,816.67 each; SMP 90% of average weekly earnings for 6 weeks, then the lower of 194.32 and 90%; recovery 92% (not a small employer) · when the November run is calculated · then eligibility met (26 weeks'' service by the qualifying week starting 2026-08-02; average weekly earnings 5,633.34 x 6 / 52 = 650.00, above the lower earnings limit row); 90% = 585.00 a week; November: 4 whole weeks (2 to 29 November) 2,340.00 plus 1 day of week 5 at 585.00 / 7 = 83.57, total 2,423.57; salary 0.00 for days on maternity leave (statutory only); weeks 7 to 39 at 194.32 are scheduled on the payroll record; the recovery 2,229.68 (92%) goes on the EPS for tax month 8 (PRL-14); an absence change in time-off (an earlier birth) marks the payslip stale

    Payroll administrator · screen: Pay runs · reference: not built

  • PRL-10As a payroll administrator, I want each person assessed for pension auto-enrolment every pay period, and opt-outs refunded, so that we meet our duties without a spreadsheet.

    Given scheme UK01-QS (qualifying earnings, 5% / 3%, net pay arrangement, no postponement); starter 4450 aged 31 earning 1,309.52 in November (above the monthly trigger 833.00); employee 4460 enrolled on 2026-10-01 opts out on 2026-10-20 (within one month of enrolment) · when the November run is calculated · then 4450 is assessed eligible jobholder and enrolled from 2026-11-16 (the enrolment communication and the scheme''s enrolment record go with the contribution file, PRL-15); 4460''s October contributions (employee 62.00, employer 37.20) are refunded to 4460 through the November payslip (employee part, taxable pay adjusted) and the scheme is told; an opt-out after one month ceases membership from the next period with no refund; an entitled or non-eligible worker may ask to join; re-enrolment every three years is a job on the scheme

    Payroll administrator · screen: Employees · reference: not built

  • PRL-11As an employee, I want my payslips, P60s and P45 in one place, so that I can prove my income without asking anyone.

    Given employee 4410 with payslips for 2026-04 to 2026-11 and a P60 for 2025-26 · when I open My payslips on 2026-11-30 · then the November payslip appears on the pay date (never before: publish_on pay_date) with every line, the year to date and the tax code; the P60 for 2025-26 is there; each is a stored document (raw/payroll/UK01/2026-27/payslip/4410/ UK01-M-2026-27-M08.pdf); I see only my own; a payroll admin opening my payslip is recorded in the access log

    Anyone on the payroll · screen: My payslips · reference: not built

  • PRL-26As the payroll manager, I want an off-cycle payment for someone the regular run missed, so that a starter is paid this week rather than next month.

    Given run UK01-M-2026-27-M08 approved; starter 4454 (start 2026-11-23) reached hr after the run was approved; pay date of the off-cycle 2026-11-30 · when I open an off-cycle run for 4454 and approve it after admin A calculates it · then run UK01-M-2026-27-M08-X1 (kind off_cycle, the same tax period) with one payslip calculated cumulatively with the regular run; its own FPS, payouts and journal; the person may be in only one regular run per period (prl_period_claim), so a second regular run for M08 is refused 409; an off-cycle run never contains a person already paid in the regular run unless the payslip says why (a correction)

    Payroll manager / finance director · screen: Pay runs · reference: not built

  • PRL-23As the payroll manager, I want the statutory rates and thresholds kept as dated rows, so that a new tax year is entered and checked, never programmed.

    Given rates for 2026-27 from 2026-04-06; HMRC publishes 2027-28 rates · when I enter the 2027-28 rows from 2027-04-06 (tax bands for the rest of the UK and for Scotland, NI thresholds per frequency, SSP, SMP, the lower earnings limit, auto-enrolment thresholds, student loan thresholds, the national minimum wage bands) · then each is a row with valid_from after today and its source named; a run uses the rows in force on its pay date; a row that leaves a band empty (a threshold above the next one) is refused 422 {gate: bands_ordered}; a payslip shows which rows it used

    Payroll manager / finance director · screen: Settings · reference: not built

  • PRL-27As the payroll manager, I want what we owe HMRC for each tax month and when it is due, so that it is paid by the 22nd and matches the bank.

    Given tax month 8 (6 November to 5 December 2026): runs M08 and W31 to W34 approved; SMP recovered 2,229.68; employment allowance remaining 0.00 (used by July) · when I open HMRC liability for 2026-27 month 8 · then tax + employee NI + employer NI + student loans of every run whose pay date falls in the tax month, less SMP recovered, less employment allowance used, with each run listed; due 2026-12-22 (paid electronically); the payment from the bank is matched in payments by its reconciliation rule to purpose paye_ni_payable (matched_kind tax_liability), with no route between the two modules; the month shows paid when the gl balance of paye_ni_payable for it is zero

    Payroll manager / finance director · screen: HMRC · reference: not built

  • PRL-19As the owner, I want the payroll controls held by me, so that nobody can switch off the second approval of salaries.

    Given payouts_auto_approve_source off; proration working_days; small_employer_relief false · when the payroll manager tries to turn payouts_auto_approve_source on; I set small_employer_relief true from 2027-04-06 after confirming 2026-27's Class 1 NICs were 38,400.00 · then the first is refused 403 (prl:settings:controls); mine is a dated row after today with my note; runs before 2027-04-06 keep 92% recovery

    The owner (or whoever the owner names) · screen: Settings · reference: not built

  • PRL-24As the owner moving payroll in-house mid-year, I want each employee's year-to-date figures from the previous provider loaded and reconciled, so that cumulative tax and the P60 are right.

    Given the previous provider's last FPS for 2026-27 month 7 and its year-to-date report: 46 employees, taxable pay to date 811,432.00, tax 98,220.40, employee NI 52,118.24, employer NI 101,903.71 · when the year-to-date load runs, reconciles and I sign · then one opening row per payroll employee and tax year keyed "ytd:<payroll_id>:2026-27" with taxable pay, tax, NI per category letter, employer NI, statutory payments and pension to date; the totals equal the provider''s FPS to the penny or the run is not signable; the first run here (M08) calculates cumulatively from them; the payroll IDs are kept as HMRC knows them (or changed with the old ID on the first FPS); loading twice writes nothing

    The owner (or whoever the owner names) · screen: Migration · reference: not built

Things that happen on their own

  • PRL-16when a pay run is approvedThe system posts the run's journal, so that pay cost, the HMRC and pension liabilities and the net pay owed are in the books on the pay date.

    Given run UK01-M-2026-27-M08 approved; for 4410 alone (cost centre SALES-N): gross 3,000.00, employer NI 387.45, employer pension 74.40, tax 365.60, employee NI 156.16, employee pension 124.00, net 2,354.24 · when the post runs, and runs again after a timeout · then gl POST /journal-entry/journals with journal_id derived_id("prl:UK01-M-2026-27-M08", "approve"), source_module payroll, journal_date 2026-11-30 (the pay date), lines summed per purpose and cost centre: debit gross_pay 3,000.00, employer_ni 387.45, employer_pension 74.40 (SALES-N); credit paye_ni_payable 909.21 (365.60 + 156.16 + 387.45), pension_payable 198.40 (124.00 + 74.40), net_pay_payable 2,354.24; 3,461.85 each side; the retry is gl''s replay; a closed period leaves the journal pending with gl''s reason and holds the payouts until it posts

    · reference: not built

  • PRL-17after the last pay date of the tax year (5 April), in the composition's workerThe system closes the tax year, so that P60s are out by 31 May and the new year starts from zero.

    Given tax year 2026-27 ends 2027-04-05; 44 employees employed on 2027-04-05; the last runs M12 and W52 approved · when the year-end pass runs on 2027-04-06, and again · then the last FPS of each schedule was sent with the final submission indicator; 44 P60s (keyed "p60:<payroll_id>:2026-27") are produced and published by 2027-05-31; week1/month1 codes are not carried into 2027-28 (they become cumulative) unless HMRC says otherwise; year-to-date figures start at zero for 2027-28; the second pass writes nothing

    · reference: not built

  • PRL-25when hr's extract, an absence, approved hours, a tax code or a rate row changes for a person in a calculated, not yet approved runThe system marks payslips stale when what they were calculated from changes, so that nobody approves a payslip built on yesterday's facts.

    Given run M08 calculated on 2026-11-24; on 2026-11-25 hr records a pay change for 4410 from 2026-11-16 and time-off extends 4425's sickness · when payroll reads hr's extract and time-off's absences with changed_since · then the payslips of 4410 and 4425 are flagged stale with the cause; approval is refused {gate: not_stale} until they are recalculated; an approved payslip is never flagged: the change lands in the next period as a retro line (hr) or an absence correction

    · reference: not built

Things that cross into other modules

  • PRL-12after a run is approved and its journal postedNet pay is paid by payments as one payout per payslip in a Bacs run on the pay date, and each payslip is paid when the bank says so.

    Given run M08 approved with 46 payslips, net 98,412.60, pay date 2026-11-30; 4410 net 2,354.24 to person partner bp 9410 · when payroll requests the payouts, twice, and later payments confirms them · then 46 payouts keyed "prl:UK01-M-2026-27-M08:<person_id>:net" with batch_ref UK01-M-2026-27-M08, due_on 2026-11-30, clearing_purpose net_pay_payable; the repeat is payments'' replay; payments approves the batch (its approver not a payee in it), exports the Bacs file, reads each bank account from hr itself, and calls payroll''s POST /pay-runs/UK01-M-2026-27-M08/payouts/{payout_ref}/paid; the run is paid when every payout is paid or returned; a returned payout leaves the payslip unpaid with the bank''s reason for a new payout (…:net:2); a payout is never requested for a net of 0.00

    · owned by payments · reference: not built

  • PRL-13after a run is approved, on or before its pay dateThe full payment submission goes to HMRC through a capability on or before payday, so that HMRC knows what each person was paid and deducted.

    Given run M08 approved on 2026-11-25; PAYE reference 123/AB45678, accounts office reference 123PA00045678; identity of each person from hr (HR-61) · when payroll calls the capability hmrc.rti_submit with kind fps, and again after a timeout · then the FPS (tax year 2026-27, tax month 8, payment date 2026-11-30, per employee the payroll ID, NI number or address, name, date of birth, gender as HMRC holds it, tax code and basis, starter or leaver details, pay and deductions in the period and to date) is written as an object raw/payroll/UK01/rti/fps/UK01-M-2026-27-M08-1.xml and sent with idempotency_key "fps:UK01-M-2026-27-M08:1"; the capability''s RESULT accepted (HMRC''s correlation id) moves the run to submitted, rejected keeps it approved with HMRC''s errors for the admin, and a corrected FPS is n+1 (v2: sent by a holder of prl:fps:correct); with no provider it is a manual task "submit this FPS by 2026-11-30" with the file, which a holder of prl:filing:complete_manual records as done with HMRC''s reference; no live HMRC call is built here

    · owned by the capability provider named in compose.yaml (an HMRC RTI provider brick; none = a manual task) · reference: not built

  • PRL-14monthly, after the last run of a tax month, before the 19th of the next monthThe employer payment summary goes to HMRC through the same capability, so that statutory pay recovered and the employment allowance reduce what we pay.

    Given tax month 8 of 2026-27: SMP paid 2,423.57, recovered 92% = 2,229.68; no other recoveries · when the EPS pass runs on 2026-12-06 (after the tax month ends on 2026-12-05), and again · then one EPS keyed "eps:123/AB45678:2026-27:M08:1" with the year-to-date recoverable amounts (SMP recovered 2,229.68, no NIC compensation), sent through hmrc.rti_submit kind eps; a month with no payments sends the no-payment EPS; the journal debits paye_ni_payable and credits statutory_pay_recovery 2,229.68 (event eps, derived from the EPS key); the second pass sends nothing

    · owned by the capability provider named in compose.yaml (an HMRC RTI provider brick; none = a manual task) · reference: not built

  • PRL-15after a run is approvedPension contributions and enrolment changes go to the scheme through a capability, so that the scheme and the payslips agree.

    Given run M08: 44 members, employee 5,312.40, employer 3,187.44; 4450 newly enrolled; 4460 opted out with a refund · when payroll calls the capability pension.submit_contributions, and again after a timeout · then a PAPDIS file (one row per member: employee and employer contributions, pensionable earnings, enrolment status and dates) as an object raw/payroll/UK01/pension/UK01-QS/UK01-M-2026-27-M08.csv, sent with idempotency_key "pension:UK01-QS:UK01-M-2026-27-M08"; the scheme collects 8,499.84 by direct debit, which payments matches by its reconciliation rule to purpose pension_payable; with no provider it is a manual task to upload the file by the 22nd of the next month (the legal due date)

    · owned by the capability provider named in compose.yaml (a pension provider brick; none = a manual task) · reference: not built

  • PRL-20when a run is opened and before it is calculatedPay, starters, leavers and changes come from hr's payroll extract, so that payroll never keeps a second copy of salaries.

    Given company UK01, monthly period 2026-11 · when payroll calls hr POST /payroll-extracts {legal_entity_ref UK01, period 2026-11}, then GET /payroll-extracts/UK01|2026-11, and after approval POST /payroll-extracts/UK01|2026-11/sent {sent_ref UK01-M-2026-27-M08} · then starters become payroll employees waiting for their tax details (PRL-01), leavers get their final pay and P45 (PRL-08), pay slices and components become payslip lines with their proration dates, retro lines for closed periods are paid in this period; the employment and the person partner come from GET /persons/{person_id}/employment; the signed-in employee from GET /persons?pool_user_sub=; payroll never reads hr_ tables

    · owned by hr · reference: not built

  • PRL-21when a run is calculated, and to detect changes before approvalUnpaid leave, sickness and family leave come from time-off's approved absences.

    Given time-off's November absences of UK01 (TOF-20) · when payroll calls GET /absences?company_code=UK01&from=2026-11-01&to=2026-11-30, and later with changed_since · then pay treatments map to elements (unpaid -> UNPAID_DEDUCTION, sick -> SICK_DEDUCTION and SSP, statutory_maternity -> SMP); an absence changed after calculation marks the payslip stale (PRL-25); a change to a period already approved is settled in the next run; payroll never writes tof_ tables

    · owned by time-off · reference: not built

  • PRL-22when a weekly or monthly run with hourly-paid or overtime-paid people is calculatedHourly pay and overtime come from approved timesheets.

    Given timesheets' approved hours of UK01 for 2026-11-09 to 2026-11-15 (TS-20) · when payroll calls GET /approved-hours?company_code=UK01&from=2026-11-09&to=2026-11-15, and later with changed_since · then normal hours x the hourly rate (hr), overtime hours x the rate x the overtime element's multiplier; a superseded revision is settled as the difference in the next run; payroll never reads ts_ tables

    · owned by timesheets · reference: not built

  • PRL-18when a run is approved and when a period's journal is postedCost centres, open periods and the company come from gl.

    Given cost centre SALES-N open; period 2026-11 open; company UK01 in GBP · when payroll calls GET /cost-centres/SALES-N, GET /periods/open?date=2026-11-30&company_code=UK01 and GET /companies/UK01 · then a payslip whose cost centre is closed is refused at approval with the person named; a closed period leaves the journal pending; payroll never writes gl_ tables

    · owned by gl · reference: not built

  • PRL-28when payments confirms or returns a payout it paid for payrollPayments tells payroll that a net pay payout was paid or came back, so that each payslip knows whether the person has their money.

    Given payout prl:UK01-M-2026-27-M08:4410:net of 2,354.24 · when payments calls POST /pay-runs/UK01-M-2026-27-M08/payouts/prl:UK01-M-2026-27-M08:4410:net/paid {status paid, payment_id, paid_on 2026-11-30, amount 2,354.24}, twice · then the payslip is paid on 2026-11-30, recorded once (the second call answers the same); a different amount is refused 409; status returned leaves the payslip unpaid with the reason and lists it for the admin

    · owned by payroll · reference: not built

How things move

pay_run

open → calculated → approved → submitted → paid → closed → cancelled

  • none → open by system or payroll_admin · when the schedule's previous regular run is approved; the period claim (company, schedule, tax year, period, regular) free · pay_run_id <company>-<schedule>-<tax year>-<period>; the hr extract produced (HR-60)
  • none → open by payroll_manager · when the tax period's regular run approved · needs reason · pay_run_id <regular>-X<n>, kind off_cycle
  • open → calculated by payroll_admin · when every employee in it has a tax code and an NI category · payslips derived from hr's extract, time-off, timesheets and the rows in force on the pay date
  • calculated → calculated by payroll_admin · the draft payslips replaced; stale flags cleared
  • calculated → approved by payroll_manager · when not_stale; nmw_met; net_not_negative; bacs_lead; the approver is not the preparer (email AND sub); own_payslip_by_peer (the approver's own payslip, if in the run, already approved by a peer) · payslips frozen; after commit, from pending rows: extract sent (HR-60), journal (PRL-16), payouts (PRL-12); the FPS and the pension file are built by build_pay_run_documents (v2), never inside the approval
  • approved → approved by system · when the approval committed; the run's pending document row claimed once by the worker tick · v2 (seemo's decided answer 7): the FPS (fps:<run>:1) and the pension contribution file built from the frozen payslips and handed to the capability (PRL-13, PRL-15) or to a manual task; the EPS is built by the tick's monthly EPS pass; a retry builds nothing twice
  • calculated → calculated by payroll_manager · when a payroll manager who is neither the payslip's person nor the run's preparer (email AND sub) · that payslip approved; the run may then be approved
  • approved → submitted by system · when the capability's RESULT accepted, or the admin's manual task done with HMRC's reference · the correlation id kept
  • submitted → paid by system · when every payout paid or returned (payments, PRL-28)
  • paid → closed by system or payroll_admin · when the journal posted; the pension file sent or its manual task done · year to date frozen; payslips published on the pay date
  • open / calculated → cancelled by payroll_manager · needs reason · the period claim released; nothing was sent

payroll_employee

pending_details → active → left

  • none → pending_details by system · when a starter on hr's extract with an employee worker type · payroll_id <person_id>-<n>; enrolment assessed in the first run
  • pending_details → active by payroll_admin · when a P45 or a starter declaration (A, B or C), else the emergency code with a warning; the admin is not the person (email AND sub) · needs tax_code
  • active → left by system · when the leaver's final payslip approved · P45 document; the leaving date on the FPS

pension_membership

enrolled → opted_out → ceased

  • none → enrolled by system or payroll_admin · when assessed eligible jobholder, or an entitled or non-eligible worker who asked to join · the enrolment date; the opt-out window (one month) starts when the scheme confirms
  • enrolled → opted_out by employee or payroll_admin · when within the opt-out window · contributions refunded in the next run; the scheme told
  • enrolled → ceased by employee or payroll_admin or system · when after the window (no refund), or the person left · contributions stop from the next period

prl_ytd_run

loaded → reconciled → signed → discarded

  • none → loaded by system · when hr's migration signed; the provider's last FPS file attached · v2 (pattern §11, seemo's decided answer 4): staging rows only (prl_migration_row, keyed by the source id); nothing written to the ledger, balances or journals
  • loaded → reconciled by system
  • reconciled → signed by owner · when every total equal to the penny · v2 (decided answer 4): the staged rows written through this module's normal use cases, idempotent on the source key; the first write to the ledger; a signed run is later reversed by reversing entries, never deleted
  • loaded / reconciled → discarded by owner · needs reason · v2 (decided answer 4): the run's staging rows deleted, nothing else (no ledger row was written)

What it keeps

ThingMeaningIdentified byShared?
paye schemeone employer PAYE scheme registered with HMRCcompany_codepaye_refmodule-owned
pay schedulehow often a group is paid and on which daycompany_codeschedule_codemodule-owned
payroll employeeone employment of one person on this payroll, as HMRC knows itpayroll_id = "<person_id>-<n>" (the employment n from hr), fixed once on an FPSmodule-owned
tax code rowthe tax code and basis in force for an employment from a datepayroll_idvalid_frommodule-owned (append-only)
ni category rowthe National Insurance category letter of an employment from a datepayroll_idvalid_frommodule-owned (append-only)
student loan rowa student or postgraduate loan HMRC asked us to deduct, from a datepayroll_idplanvalid_frommodule-owned (append-only)
pay elementone kind of payment or deduction and how tax, NI, pension and the books treat itcompany_codeelement_codevalid_fromSHARED, sole writer (gl maps the purpose; hr's pay components and time-off's pay treatments name what they map to)
statutory ratea rate, band or threshold set by law, from a daterate_keyregionfrequencyvalid_fromvendor-published (v2, seemo's decided answer 1): dated rows shipped with the module's statutory pack and its releases, checked against the statute or HMRC page named; never edited by the customer (a wrong row is corrected by a new vendor row from a date); the customer's own figures are scheme rows (company sick pay, enhanced maternity), never these
pension schemea workplace pension scheme the employer pays intocompany_codescheme_codemodule-owned
pension membershipone employment's membership of a schemepayroll_idscheme_codeenrolled_onmodule-owned
pay runone payment of one schedule for one periodpay_run_id = "<company_code>-<schedule>-<tax year>-<period>" (UK01-M-2026-27-M08, UK01-W-2026-27-W33); off-cycle "<regular>-X<n>"module-owned
period claimthe row a regular run of a period races for, so a period is paid oncecompany_codeschedule_codetax_yearperiod_codekindmodule-owned (a plain INSERT; released only by cancel_pay_run)
payslipone person's pay in one runpay_run_idpayroll_idmodule-owned
payslip lineone element on one payslip and where it came frompay_run_idpayroll_idline_nomodule-owned
ytd openingthe year-to-date figures carried from the previous providerytd_ref = "ytd:<payroll_id>:<tax year>"module-owned
rti submissionone FPS or EPS sent (or to be sent) to HMRCsubmission_id = "fps:<pay_run_id>:<n>" | "eps:<paye_ref>:<tax year>:M<nn>:<n>"module-owned
documenta payslip, P45 or P60 kept for the person and for HMRC's record-keeping periodobject key raw/payroll/<company_code>/<tax year>/<kind>/<person_id>/<ref>.pdfmodule-owned
outboxa side effect waiting after the local commit (extract sent, journal, payouts, FPS, EPS, pension file, publication)targetrefmodule-owned
settingsthe controls and defaults, datedkeyvalid_frommodule-owned

A payroll that keeps its own staff list and salaries is how a leaver is paid in December and a pay rise is paid in March for January. Pay and dates stay in hr; this module keeps only what HMRC and the pension scheme need on top.

What runs on its own

StoryWhenWhat
PRL-16when a run is approvedthe journal
PRL-172027-04-06 and every 6 Aprilfinal FPS check, P60s, the new tax year
PRL-25on read and before approvalthe stale check against hr, time-off and timesheets (changed_since)
PRL-14on the 6th of each month (after the tax month ends on the 5th)the EPS for the tax month just ended

Questions that shape your version

Read these out and let the customer correct one — people rarely recall a policy on demand and can always react to one. Standard is a named authority you can look up and hold us to. Commonly seen is exactly that: arrangements we have met, with no survey behind them. A customer doing none of them is not doing it wrong.

  1. How often do you pay, and on which day?
    office staff
    monthly, the last working day
    hourly staff
    weekly, Friday, a week in arrears
  2. What do you pay when someone is off sick or on maternity leave?

    Standard Social Security Contributions and Benefits Act 1992 Parts XI and XII; Employment Rights Act 2025 (SSP from day one, from 2026-04-06)

  3. Which pension scheme do you use, on which earnings, and how is tax relief given?

    Standard Pensions Act 2008 ss. 13 and 20 (qualifying earnings, minimum 8% with at least 3% from the employer)

    small employer
    the state-backed scheme, qualifying earnings, relief at source
    mid market
    an insurer's scheme, qualifying or basic pay, net pay arrangement
    warning
    the net pay arrangement leaves members earning below the personal allowance without relief
  4. Who approves the payroll, and should finance approve the bank payment again?
  5. Were your Class 1 NICs last tax year 45,000 or less, and are you eligible for the employment allowance?

    Standard HMRC: Statutory Payments (small employers' relief); NICs Act 2014 s. 2 (employment allowance)

  6. Who submits to HMRC and the pension scheme today, and with which software?
  7. Are you moving payroll mid-year, and who has the year-to-date figures?
  8. How long do you keep payroll records?

    Standard Income Tax (PAYE) Regulations 2003 reg. 97 (3 years after the tax year); National Minimum Wage Regulations 2015 reg. 59 (6 years)

What you can change yourself

These are settings, not code: someone in your team changes them on a screen, without a developer and without a release.

Where the platform limits what we can promise

No read-your-writes inside an open transaction. approval commits the run and its outbox rows; the journal, payouts and FPS go in a second step
A plain INSERT of a committed key is rejected (23505). period claims, tax code rows and RTI submissions are plain INSERTs; the loser re-reads
No HMRC or pension provider capability exists on the platform. FPS, EPS and PAPDIS files are produced and handed to a person as manual tasks with their deadlines; tell the customer before the first run who submits them

For builders

Code

Public repositories, anonymous clone, one release tag each. Read README.md and AGENTS.md first.

Known gaps in the reference

© 2026 DODILHomeDocsConsole