GL Journal Posting — Detailed Requirements
An approved run is turned into a single balanced general-ledger journal entry: one consolidated Salary Expense debit, offset by credits for item deductions, employee statutory shares, PCB, and per-employee net salary payable. The posting is previewable, guarded against unmapped accounts, and must exist before a run can be marked paid.
One expense debit
Σ gross salary in one line — allowances, OT and bonus are folded in.
Liability credits
Deductions, statutory shares, PCB and net pay each credit their payable account.
Preview first
A dry-run surfaces unmapped items and totals before anything is written.
Employee side only
Employer statutory and HRDF are deliberately excluded from the salary journal.
GL Posting · Detailed
Journal legs GL-L
Per approved run, calculated employees only. Each line carries the employee as payee and a descriptive remark.
| Leg | Side | Account | Amount |
|---|---|---|---|
| Salary Expense | DR | Payroll expense account (config) | Σ gross salary — one consolidated line |
| Item deductions | CR | Each deduction item's own account | |amount| per employee per item |
| Employee statutory | CR | Contribution group's per-scheme account | Employee share per contribution (e.g. "EPF (Employee)") |
| PCB tax | CR | Payroll tax account (config) | Tax per employee (when > 0) |
| Net salary | CR | Salary liability account (chosen or config) | Net pay per employee (when > 0) |
Balancing identity: DR gross = CR deductions + CR employee statutory + CR PCB + CR net — which holds because net = gross − deductions − statutory − tax. The finance module independently validates balance before accepting the entry.
- The journal entry id is stored on the run, unblocking mark-as-paid.
- Employer statutory contribution lines are built for preview grouping but removed before posting — employer costs are settled outside the salary journal.
- The HRDF levy never appears in the salary journal.
GL Posting · Detailed
Preview & guards GL-P
The preview is a no-write twin of the posting, and the posting refuses to create an unbalanced or misconfigured entry.
- Preview never writes and has no status gate; posting requires
APPROVED. - Preview totals equal what posting would write.
- The error lists every unmapped item by name.
- The liability account may be overridden per posting; the choice is remembered on the run.
GL Posting · Detailed
Re-posting GL-R
- Posting and the entry-swap happen in one transaction.
- Exception: a recalculation clears the run's journal link without deleting the entry — see Known gaps.
GL Posting · Detailed
Business rules
- Journal before payment — mark-as-paid is impossible without a linked journal entry.
- Only calculated employees post; zero-value tax/net lines are omitted.
- Account resolution order for net salary: explicit argument → configured liability account → error.
- Accounts come from three places: the config singleton (expense, tax, liability), the item catalogue (deduction payables), and the contribution group (statutory payables).
GL Posting · Detailed