Skip to content

Payroll & HR

Document the custom payroll pipeline built on ERPNext HR/Payroll DocTypes with Singapore-specific calculations.

  • leekimerp/leekimerp/scripts/salary_slip.py, salary_component.py, payroll_entry.py, employee.py
  • leekimerp/leekimerp/hook_methods.py
  • hooks.pydoc_events for Employee, Salary Slip, Payroll Entry, Salary Component
  • Reports: see Reports catalog (payroll-related: Payroll Report, CPF Payment Advice, Monthly Payroll Summary Report, Employee-Payslip Report, etc.)
  • Employee, Salary Slip, Payroll Entry, Salary Component, Company, Account
flowchart LR
A[Salary Slip validate] --> B[setup_payment_days]
B --> C[setup_pay_items]
C --> D[calculate_cpf_v2]
D --> E[calculate_shg]
E --> F[calculate_sdl]
F --> G[recalculate_net_pay]
G --> H[payroll_entry.append_salary_slip]
  • Desk: Standard Payroll Entry and Salary Slip workflows
  • Hooks: validate chains on Salary Slip; Employee validate / after_insert for structures and holiday list

Function / method list (representative hooks)

Section titled “Function / method list (representative hooks)”
HandlerTypeRole
setup_payment_daysscriptPayment days
setup_pay_itemsscriptEarnings/deductions
calculate_cpf_v2scriptCPF
calculate_shgscriptSHG
calculate_sdlscriptSDL
recalculate_net_payscriptNet pay
append_salary_slipscriptTie to payroll entry
  • Chart of accounts and salary component setup per company
  • Lee Kim Payroll Settings, Singapore Payroll Settings (and related DocTypes as present in the app)
  • Payroll Entry naming and trash handling — see scripts/payroll_entry.py on_trash
  • Mid-month hire proration and other edge cases may need manual adjustment (track as product backlog).