Skip to content

Tutorial: Singapore payroll run

Orient developers on the custom payroll stack (Singapore: CPF, SHG, SDL, etc.) built on ERPNext Payroll Entry, Salary Slip, Employee, Salary Component.

  • Payroll Entry — batch run for employees in a period
  • Salary Slip — per-employee payslip document
  • Salary Component — earnings and deductions
LayerLocation
Hooks registrationleekimerp/hooks.pydoc_events for Salary Slip, Employee, Payroll Entry, Salary Component
Calculation scriptsleekimerp/scripts/salary_slip.py, salary_component.py, payroll_entry.py, employee.py
Hook methodsleekimerp/hook_methods.py

See the diagram on Payroll & HRSalary Slip validate runs setup_payment_days → … → calculate_cpf_v2 → … → recalculate_net_pay.

Payroll Entry submit

Salary Slip validate

calculate_cpf_v2

recalculate_net_pay

  • Payroll & HR category — settings DocTypes (Singapore Payroll Settings, Lee Kim Payroll Settings, etc.)

Verification checklist (Singapore payroll)

Section titled “Verification checklist (Singapore payroll)”

Run on staging with anonymized employees where possible.

StepCheck
1Payroll Entry for a small cohort (1–3 employees) with known salary structures.
2Open each Salary Slip — verify gross, CPF employee/employer, net pay against spreadsheet expectations.
3Confirm SHG/SDL and other components match configured Salary Components for the period.
4Submit payroll; verify GL impact (if your process posts journals) matches finance sign-off rules.
5Error Log clean during run; scheduler not stalled.
CaseWhy it matters
New hire mid-periodProration and payment days logic
Resigned employee last monthCessation rules and component stops
CPF ceilingcpf_ow_ceiling and related settings — see payroll-hr DocTypes
Retro adjustmentsCustom salary lines and validation hooks
  1. Compare Salary Slip JSON (export) vs Salary Component breakdown in Desk.
  2. Step through scripts/salary_slip.py validation order — validate chain is order-sensitive.
  3. Check hooks on Employee / Salary Structure Assignment for overrides.
  4. Document outcome in an ADR if business rules change.