Expenses, Invoices, and Xero
Expense approval, invoice assembly, PDF generation, and Xero submission.
Expenses, Invoices, and Xero
Expenses are separate from timesheets, but finance and invoice outputs can combine approved expense amounts with timesheet labour/material/allowance amounts.
Expense lifecycle
ExpenseStatus values are draft, submitted, accepted, approved, and rejected.
Typical flow:
- Electrician creates and submits an expense with project, category, amount, and attachment evidence.
- Supervisor accepts or rejects submitted expense records.
- Payroll or Client Admin approves accepted expenses.
- Approved expenses can be included in invoice/Xero workflows.
Invoice calculation behavior
The existing calculation documentation describes two paths:
If current TimesheetCalculation.billTotal > 0:
timesheet invoice amount = award bill total + material total
Otherwise:
timesheet invoice amount = timesheet total hours x matching client base rate + allowance total + material totalExpense invoice lines are separate:
expense invoice amount = approved expense amountInvoice subtotal is the sum of timesheet invoice amounts and expense invoice amounts. Tax is currently documented as zero at the invoice aggregate level, while award line billing GST can be stored inside award calculation lines when enabled.
Invoice services
| Service | Role |
|---|---|
PayrollInvoiceService | Builds and manages invoice aggregates. |
InvoicePdfViewBuilder | Builds PDF-ready rows, allowance rows, material rows, and fallback labour rows. |
HeadlessChromiumPdfRenderer | Renders HTML/PDF outputs where used. |
FinanceController | Finance invoice list, mock invoice preview, approve/reject/export/PDF, weekly reports, and cost-code adjustment routes. |
Xero integration
Xero is integrated through OAuth and service wrappers:
XeroAuthControllerhandles/xero/auth,/xero/callback,/xero/test, and/xero/disconnect.XeroTokenstores token state.XeroClient,XeroIntegrationService, andXeroBillSubmissionServiceperform API work.SubmitExpensesTimesheetsToXeroCommandsupports command-line submission flows.
Xero routes are authenticated browser routes, not public API endpoints.