<aside> 🔁 Synced from GitHub #2dfb09fb6da1. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.

</aside>

Payroll

Status: Live

💡 In plain words

Payroll works out everyone's pay for a period, and gets it approved.

PaidHR sets up each pay run in advance. HR presses prepare, and PaidHR calculates each person's pay before and after tax, pension and other deductions. HR checks the preview, sends it for approval, and once it's approved, payslips are created and a list of payments is made ready to send.

Like a draft bill at a restaurant. It's added up, checked, signed off by the manager, and only then paid.

Who's involved: HR / payroll admins (prepare and submit), approvers, and employees (receive payslips).

In one paragraph

A payroll is one pay run for one company and one pay period. PaidHR creates the runs ahead of time from the company's pay schedule. HR prepares a run, which calculates every employee's gross pay, deductions, tax, statutory contributions and net pay into a preview. HR reviews it, submits it for approval, approvers approve it step by step, and the approved run produces payslips and a payment schedule that actually pays people (see payments). All the arithmetic happens in SQL stored procedures in the tenant database. The C# layer orchestrates, checks permissions, sends emails and reports progress.

Key ideas

Term Meaning
Payroll type 1 Regular (the monthly run), 2 Off-cycle (extra run, e.g. a bonus), 3 On-demand (created by hand)
Pay schedule When runs happen: cut-off day (last day counted), run day (when it should be processed), pay day. Can be split into two runs a month. Stored in PayrollSchedules / PayrollScheduleConfigSettings; next dates in PayrollConfigSettings
Custom pay schedule A different schedule for a group (e.g. weekly staff), with its own allowances
Pay band / pay grade Sets base pay and allowances. Allowances can be prorated (ProrateRegularAllowances, ProrateOffcycleAllowances)
Payroll item One line on someone's pay: allowance, bonus, deduction, payable, contribution or amortisation
Payroll change An adjustment for a person: 1 Bonus, 2 Deduction, 3 Payable, 4 Reimbursement, 5 Payment in lieu of notice (PILON). One-off or recurring; for the regular or the off-cycle run. Has its own approval
Payable type A configurable earning paid by units × rate (overtime hours, shifts, trips). Rates can differ by band, grade or policy group
Deduction type A configurable deduction (union dues, cooperative)
Exemption / skip Leave someone out of a run (Skip_Persons), or out of upcoming runs, or exempt them from an item
Temp vs final items Preparing writes temporary items (Temp* in the API) for preview. Submitting fixes them
Recovery tax Tax recomputed on recovered amounts
Tax relief A per-employee relief an admin adds or bulk-uploads: EVC (voluntary pension contribution), mortgage interest, life assurance, or rent (pulled in from the separate approved-rents feature). Managed at Admin/Tax_Reliefs. On the payroll report, a regular run shows each employee's reliefs as extra "Information" columns (one per type, plus a Total Relief column) — these are informational only and never change earnings, tax, deductions or net pay
Tax rebate A payroll item type that lowers the Tax figure and raises Net Pay by the same amount. It's taken first from consolidated salary tax, then allowance tax, then retro/differential tax; advance tax is never reduced, and any amount left over after those columns shows under Total Allowances Tax so the tax columns still add up to the Tax column
Off-cycle narration Off-cycle runs only, and off by default. Set on its own "Off-cycle" tab in payment narration settings (next to the "Regular" tab): HR picks an off-cycle suffix (Payment, Salary, or a custom "Others" text up to 50 characters), independently of the regular run's suffix, and can switch on using the off-cycle schedule's own name as the narration prefix instead of the company's. Regular runs are unaffected

Statutory items by country

Country Items
Nigeria PAYE tax, Pension, NHF, NSITF, ITF, NHIS, Life assurance, Gratuity
Ghana SSNIT Tier 1, SSNIT Tier 2
Kenya NSSF (6% up to the upper earnings limit), SHIF (2.75%, minimum 300), Housing Levy (1.5%)

Each company sets its tax formula (TaxFormula, whether gross income is used for CRA) and its reference numbers (tax, pension, housing, NSITF, ITF) in Settings.

Lifecycle

stateDiagram-v2
  [*] --> New: created from pay schedule\n(CreateMonthlyPayrolls / Create_OnDemand_Payroll)
  New --> New: Prepare / Refresh (preview)
  New --> Submitted: Submit
  Submitted --> Submitted: an approval step passes
  Submitted --> Approved: last step approves
  Submitted --> Declined: an approver declines
  Declined --> New: fix and prepare again
  New --> Cancelled: Cancel
  Approved --> Processing: payment schedule processing
  Processing --> Processed: payouts complete

Status ids: 1 New · 2 Cancelled · 3 Declined · 4 Submitted · 5 Approved · 6 Processed · 7 Processing.

Step by step

  1. Create runs. Create_Monthly_Payrolls calls spCreatePayrollsForCompany to create the upcoming regular (and off-cycle) runs from the pay schedule. Changing the schedule (UpdateRegularPayrollSchedule) re-plans them. If AutoPayrollEnabled is on, runs are created and reminders sent automatically.
  2. Prepare. Prepare → spPreparePayroll. For each eligible employee it gathers base pay and allowances from their grade, approved payroll changes, payables, deductions, loan and advance repayments, EWA withdrawals to recover, unpaid leave and approved absences, then computes tax and statutory contributions and net pay. Results go into temporary items and totals (ClonePayrollTotals). Progress streams to the screen through transaction progress. A preview email goes to the preparer. Refusals: "Payroll runner is busy" (another run is preparing), "There are no eligible employees for this payroll".
  3. Review the preview. HR reads the summaries (take-home, company cost, totals, variance against last month), downloads reports, adds or removes changes, skips people, and runs Refresh to recalculate. When anyone has an EWA deduction, the report adds a Net Pay Before EWA column just before Net Pay, so both figures are visible. A company's first-ever payroll run still gets the full breakdown (headcount, totals, basic salary, allowances, statutory and other deductions) in the approval email; it just has nothing to compare against, so the email says that instead of showing blank figures. In the approval email each total and line now says which way it moved: an increase shows its change and percentage in green, a decrease in red, and a figure that did not move stays grey (the email data carries up and down flags for this). The payroll report now has a Bank Name column right after Account Number (hidden for the same excluded people as the account number). One customer group (the parent organisation with id 354 hard-coded, and its sub-accounts) gets a different approval email at its own request: Total payroll is stated as everything earned (bonus, payable, allowance, reimbursement, and cash advances that carry an amount) plus employer contributions, so it matches the report's Gross Earnings; the breakdown gains an Employer contributions band that adds up to it, and a Total deductions band (statutory plus other deductions, this run and last, with its own change and percentage) placed directly under the two deduction bands and left out when neither month had deductions; every consolidated-salary line (retro and differential too) shows as "Consolidated Salary"; and the heading and subject name the entity and the payroll, for example "<entity> Regular payroll is ready for your approval" (an off-cycle run carries its own name, and a trailing "payroll" is not repeated). Every other company keeps the old totals and heading, where total payroll starts from net pay and adds back only statutory items, so it can equal total payment on a run with no statutory deductions.
  4. Submit. Submit → spSubmitPayroll. Fixes the items and starts approval. The first approver gets an email, with one-click buttons where enabled. A Payroll creation custom notification can also email chosen roles.
  5. Approve. Review → spReviewPayroll, one step at a time along the Payrolls (or Off-cycle payroll) chain. Restart_Approval resets the chain.