Allowance Matrix Overview
Allowance Matrix Overview
The allowance matrix turns client allowance configuration, project eligibility, timesheet entries, and manual selections into calculated TimesheetAllowanceLine rows.
It is implemented by:
ClientAllowancefor client-owned allowance rules.Project.allowances_datafor project-specific apply/rate/type settings.TimeEntry.allowances_datafor manual/selectable user selections.AllowanceMatrixCalculatorfor calculation.TimesheetAllowanceCalculationSubscriberfor automatic refresh during persistence.RecalculateTimesheetAllowancesCommandfor manual backfills.TimesheetAllowanceLinefor stored results.
Why the matrix exists
Before the calculated matrix, allowance information could exist as manual entry metadata or project configuration. The calculated matrix provides a durable, auditable, recalculable output table:
client_allowances + project allowances_data + time_entries + selected allowances
-> AllowanceMatrixCalculator
-> timesheet_allowance_linesWhat it does not do
The allowance matrix does not create project expense records. Allowances are stored as allowance lines, not as expense rows.
It also does not replace the award calculator. Instead, award calculation reads existing TimesheetAllowanceLine rows and includes them as award calculation lines.
Status boundary
Automatic allowance recalculation runs only for timesheets with status:
submittedacceptedapproved
Draft and rejected timesheets can hold manual input data, but subscribers do not persist calculated lines for them.