Skip to main content

Payroll Processing

Overview

The Payroll Processing page provides an end-to-end workflow for running fortnightly payroll. It connects three systems -- Deputy (timesheets), RABS (classification and allowances), and Xero (pay runs and payslips) -- into a single guided interface.

The page is located at Admin > Payroll and is designed to be worked through top-to-bottom, with each row of buttons representing a phase of the payroll cycle.


Page Layout

The page is organised into three horizontal zones:

1. Period & Status Bar (Top)

  • Pay Period selector with date pickers and forward/back arrows. The system auto-selects the current fortnight aligned to the Xero pay calendar.
  • Status indicators for Xero connection, Deputy connection, timesheet status, and countdown to next pay date.
  • Period stats showing active staff count, Deputy hours, last pay wages, sync issues, unapproved timesheets, and imported count.

2. Action Buttons (Two Rows)

Row 1 -- Timesheet Preparation:

ButtonPurpose
Run Health CheckCompares staff records across RABS, Deputy, and Xero. Identifies mismatches (missing in Xero, missing Deputy ID, name discrepancies). Run this first if payroll looks wrong.
Preview SyncShows which staff need to be created in Xero or pulled into RABS. Click "Execute Sync" to action.
Pull TimesheetsFetches approved timesheets from Deputy for the selected period. Shows a preview table with employee names, shifts, hours. Click "Import to RABS" to save, then "Push to Xero" to send as draft timesheets.
Clear Xero Drafts / Reset LocalEmergency tools. "Clear Xero Drafts" deletes all draft timesheets in Xero for the period (and auto-resets local status). "Reset Local to Draft" resets pushed timesheets in the RABS database back to draft so they can be re-pushed.

Row 2 -- Pay Run & Allowances:

ButtonPurpose
Create Pay RunCreates a draft pay run in Xero for the current period. Xero auto-populates payslips for every employee on the payroll calendar. The pay run summary panel opens automatically showing all employees.
Auto-DetectScans imported shift data for overnight shifts (10+ hours crossing midnight, or "overnight/sleepover" in shift comments) and counts shifts per employee for first aid allowance. Populates the editable allowances grid.
Import CSVUpload a CSV file containing allowance data. Merges into the allowances grid. See CSV Format below.
Push AllowancesSaves the allowances grid to the database, then pushes each employee's allowances to their Xero payslip as EarningsLines (km, overnight, first aid) or DeductionLines (salary sacrifice).

3. Results & Detail Panels (Below Buttons)

These panels appear contextually when actions are taken:

  • Allowances Grid -- Editable spreadsheet showing every employee with columns for KMs, Overnights, First Aid, and Salary Sacrifice. Totals update live as you type. Click "Save" to persist without pushing.
  • Pay Run Summary -- Shows the pay run status, totals (gross/tax/super/net), and a table of all employees with their financial breakdown and hours summary. Click the eye icon to view a detailed payslip modal.
  • Log panels -- Detailed operation logs showing per-employee results for pushes, imports, and deletions.

Standard Payroll Workflow

Follow these steps in order for each pay period:

Step 1: Pull & Import Timesheets

  1. Confirm the pay period dates are correct (should auto-select current fortnight)
  2. Click Pull Timesheets -- review the preview table
  3. Click Import to RABS -- saves shift data to the database
  4. Click Push to Xero -- sends classified timesheets as draft

The system automatically classifies each shift into the correct earnings rate:

  • Weekday base (06:00--16:30 permanent / 06:00--20:00 casual & PPT)
  • Weekday evening (16:30--06:00 permanent / 20:00--06:00 casual & PPT)
  • Saturday, Sunday, and Public Holiday rates
  • Shifts that span the base/evening boundary are automatically split
Public Holidays

The system checks lunch.nsw_holidays for public holiday dates. If a shift falls on a public holiday, it receives the PH earnings rate regardless of the day of week. Ensure the holidays table is kept current.

Step 2: Approve Timesheets in Xero

  1. Open Xero > Payroll > Timesheets
  2. Review the draft timesheets
  3. Approve all timesheets

This is a manual step -- the Xero API does not support programmatic timesheet approval.

Step 3: Create Pay Run

  1. Return to RABS Payroll page
  2. Click Create Pay Run
  3. The pay run summary panel opens showing all employees, their wages, tax, super, and net pay
  4. The W/AL/LSL/SL/CL column shows hours at a glance:
    • W = Worked hours (from timesheets)
    • AL = Annual Leave
    • LSL = Long Service Leave
    • SL = Sick/Personal/Carer's Leave
    • CL = Compassionate/Other Leave

Step 4: Enter Allowances & Deductions

  1. Click Auto-Detect to scan for overnights and first aid shifts
  2. Review the allowances grid -- remove first aid for staff who don't hold a current certificate
  3. Enter KMs manually or via CSV import
  4. Enter Salary Sacrifice amounts manually or via CSV
  5. Click Save to persist the data (you can come back later)
  6. Click Push Allowances to send to Xero payslips

Step 5: Review & Generate Report

  1. Click Refresh on the pay run summary to see updated figures (including allowances)
  2. Click any employee's eye icon to view their full payslip breakdown
  3. Click Generate Report to download the payroll report PDF and auto-save to Admin Drive > Documents > Reports

Step 6: Post Pay Run in Xero

  1. Open Xero > Payroll > Pay Runs
  2. Review the draft pay run
  3. Post the pay run to finalise

This is a manual step -- posting a pay run is irreversible and should be verified by a human.


CSV Import Format

The CSV importer accepts flexible column names and allowance type aliases.

Required Columns

ColumnAliases Accepted
Employee namename, employee, staff
Allowance typetype, allowance
Quantityunits, quantity, kms, count
Dollar amountamount, total, value

Allowance Type Aliases

TypeAliases
Kilometre reimbursementkm, kms, kilometres
Overnight allowanceovernight, overnights, sleepover
First aid allowancefirst_aid, firstaid
Salary sacrificesalary_sacrifice, sacrifice

Example CSV

name,type,units,amount
Jane Smith,km,45,
John Brown,overnight,3,
Jane Smith,first_aid,10,
John Brown,salary_sacrifice,,150.00
  • If units is provided without amount, the system calculates: units x rate
  • If amount is provided without units, the system back-calculates units
  • Employee matching is by full name or last name (case-insensitive)

Allowance Rates

These rates are configured in Xero and referenced by the system:

AllowanceXero Earnings RateRateXero Line Type
KM ReimbursementKM Reimbursment$0.99 per kmEarningsLine (RATEPERUNIT)
First AidFirst Aid$0.54 per shiftEarningsLine (RATEPERUNIT)
OvernightOvernight Allowance$60.02 per nightEarningsLine (RATEPERUNIT)
Salary SacrificeFBT - Salary SacrificeFixed amountDeductionLine (FIXEDAMOUNT)

Payroll Report PDF

The Generate Report button produces a comprehensive PDF document containing:

  1. Summary page -- Company header, period dates, four summary boxes (Gross Wages, Tax, Super, Net Pay), and a full employee table with W/AL/LSL/SL/CL hours and financial columns
  2. Individual payslip pages -- One page per employee with earnings breakdown, tax, deductions, superannuation, leave accrued, and a Gross/Tax/Net Pay summary box

The report is:

  • Downloaded to the browser immediately
  • Saved to Admin Drive > Documents > Reports using the naming convention: YYYY-MM-DD Payroll Report start_end.pdf

Error Recovery

SituationSolution
Timesheets pushed with wrong ratesClick Clear Xero Drafts (deletes from Xero, auto-resets local DB), fix the issue, re-push
Some employees failed to push (rate limit)Just click Push to Xero again -- only unpushed employees will be sent
Timesheets show as "pushed" locally but were deleted in XeroClick Reset Local to Draft, then re-push
Timesheets were approved in Xero and need correctionRevert to Draft in Xero UI, then use Clear Xero Drafts in RABS, then re-push
Allowances pushed to wrong payslipsDelete the pay run in Xero, re-create via RABS
Public holiday not detectedCheck lunch.nsw_holidays table has the correct dates

Classification Rules

The system uses payroll.classification_rules to map shifts to Xero earnings rates. Rules are matched by employment category and day type:

CategorySourceDay Types Covered
permanentFull-time permanent staffweekday (base + evening), saturday, sunday, public_holiday
casualStaff with "casual" in employment typeweekday (base + evening), saturday, sunday, public_holiday
pptPart-time permanent staffweekday (base + evening), saturday, sunday, public_holiday

For weekday shifts, if two rules exist for the same category (base and evening), the system splits hours at the evening threshold time (e.g., 16:30 for permanent, 20:00 for casual/PPT).


Technical Details

Data Flow

Deputy API ──→ payroll.timesheet_entries ──→ classifyShift() ──→ Xero Timesheets (Draft)

[Human approves]

RABS creates Pay Run ←┘

payroll.timesheet_allowances ──→ Push to Xero Payslips ──┘

[Human posts]

Pay Run Summary + PDF Report

Database Tables

TablePurpose
payroll.timesheetsParent record per staff per period
payroll.timesheet_entriesIndividual shifts with start/end times
payroll.timesheet_allowancesKM, overnight, first aid, salary sacrifice per timesheet
payroll.classification_rulesRate lookup rules by employment category + day type
payroll.pay_runsLocal pay run records (mirrors Xero)
payroll.pay_run_payslipsIndividual payslip records per pay run
payroll.xero_pay_itemsCached Xero earnings rates and deduction types
lunch.nsw_holidaysPublic holiday dates for shift classification

API Endpoints

MethodEndpointPurpose
GET/payroll/healthSync health check
POST/payroll/staff-syncForce staff sync
GET/payroll/deputy/timesheetsPull Deputy timesheets
POST/payroll/deputy/importImport to database
POST/payroll/xero/push-timesheetsPush to Xero
POST/payroll/xero/create-payrunCreate draft pay run
GET/payroll/payrun/summaryFull pay run summary with payslip details
POST/payroll/payrun/auto-detectAuto-detect overnights and first aid
POST/payroll/payrun/allowancesSave allowances
POST/payroll/payrun/push-allowancesPush allowances to Xero payslips
POST/payroll/payrun/import-csvImport allowances from CSV
POST/payroll/payrun/generate-reportGenerate and save payroll report PDF
DELETE/payroll/xero/timesheetsDelete Xero draft timesheets
POST/payroll/timesheets/reset-to-draftReset local pushed status