HR — finalize, amend, and override payslips
The /hr/payroll roster, bulk Finalize, per-row actions, modification history, and manual payslip entry.
/hr/payroll is where HR drives the monthly payroll cycle. You see every employee × payslip status for the chosen month, and you can finalize, amend, override, or download from one place.
Picking a month
The header shows the current month by default. Use the ◀ / ▶ buttons to step through other months. The URL takes ?year=YYYY&month=MM if you want to bookmark a specific period.
Counts strip
Above the table you see five tiles: Total, Draft, Finalized, Amended, Missing. "Missing" means the employee is on the HR roster but doesn't have a payslip yet for this month. The most common reason: no active SalaryStructure for the period — click through to /hr/payroll/structures/[userId] to add one.
Bulk Finalize
The Finalize all drafts button finalizes every DRAFT row in one go. It walks each payslip through the same lifecycle as the per-row Finalize button, so each employee gets the release email and the PDF link. If any rows fail (e.g. structure was removed mid-month), the failures are shown after the bulk action — you can open them individually to fix.
CSV export
The CSV button downloads a flat row-per- payslip CSV with employee email, period, gross, deductions, net, status, and finalization timestamp. Sorted alphabetically by email so it imports cleanly into external payroll software.
Create manual payslip
The Create manual payslip button opens a dialog where you type in the values directly — earnings, deductions, line items, optional period stats. Marks the row as manualEntry, which means:
- Source-data changes don't auto-recalc the payslip — the values you typed stay locked in.
- The payslip carries an "Imported / Manual" badge in both HR and employee views.
Use it for mid-month joiners before HRMS data exists, one-off correction payslips, or any edge case the engine doesn't model.
Per-row actions
Click Manage on any row to open the detail page at /hr/payroll/[userId]/[year-month]. From there, the right set of action buttons appears for the current status:
- Recalculate (DRAFT only) — re-runs the calc engine. Safe to click anytime; idempotent if nothing changed.
- Finalize (DRAFT only) — locks the row, sends the release email, makes it visible at
/me/payroll. - Amend (FINALIZED + AMENDED) — opens a dialog with a required reason field. By default re-runs the engine against current source data; uncheck the box to amend status only without changing numbers. The reason appears on the employee's payslip + email.
- Direct override (any status) — type in gross / deductions / notes directly. Bypasses the engine. Reason required. Status doesn't change — finalize or amend separately if you want.
- Download PDF — HR can pull the PDF for any payslip, including drafts (useful for review).
Modification history
The detail page has a Modification history panel at the bottom showing every change to the payslip — initial generation, every recalc, every status change, every override, with timestamp + actor + role + reason. Money changes are color-coded: green for increases, red for decreases, with the before-and-after amounts inline.
Source-data deep links
The right rail on the detail page links straight to the source data that fed the calculation — attendance for that employee + period, leave requests, OT entries, and the salary structure. Use these when you need to investigate why a number is what it is.