Allowance Matrix
Allowance Matrix Data Model
Allowance Matrix Data Model
client_allowances
Entity: App\Entity\ClientAllowance
| Field | Meaning |
|---|---|
client | Owning client. |
allowanceDefinition | Optional link to a reusable definition/code. |
name | Display and matching name. Matching normalizes case and non-alphanumeric characters. |
amount | Default unit rate/amount. Can be null for project-variable allowances. |
amountUnit | hourly, daily, weekly, daily_or_weekly, or project_variable. |
triggerType | One of the AllowanceTriggerType enum values. |
triggerConfig | JSON rule config, such as thresholds, vehicle type, slug, weekly amount, taxable/billable flags. |
triggerDescription | Human-readable reason. Used as output trigger reason if present. |
applicationMode | auto, selectable_timesheet, or manual. |
ebaLinked | Legacy/linking flag. |
isEab | EAB display/calculation marker, included in snapshots and PDF labels. |
enabled | Must be true to calculate. |
status | Must be active to calculate. archived rules are ignored. |
notes | Admin notes. |
Project.allowances_data
Project allowance rows are stored as JSON. They are used for project eligibility and project-specific overrides.
Common row keys:
| Key | Meaning |
|---|---|
name | Allowance name to match against ClientAllowance.name. |
rate | Project override rate. Currency symbols are stripped before parsing. |
type | Project override amount type. Supports hourly, daily, weekly, and daily_or_weekly. |
apply | Whether this allowance is enabled for the project. Defaults to true when the row matches and apply is missing. |
time_entries.allowances_data
Time-entry selections are submitted by electrician/client/admin entry forms and API payloads. They support strings or objects. The calculator accepts names from name or label, and quantities from quantity, hours, days, or units.
timesheet_allowance_lines
Entity: App\Entity\TimesheetAllowanceLine
| Field | Meaning |
|---|---|
timesheet | Owning calculated timesheet. |
timeEntry | Optional entry. Current aggregate paths mostly set this to null and store matched entries in the snapshot. |
clientAllowance | Source rule, nullable for historical survival if rule is deleted. |
name | Copied allowance name. |
code | Optional allowance definition code. |
amountUnit | Effective unit used for this calculation. |
quantity | Calculated quantity. |
unitRate | Effective rate after project override. |
amount | Quantity x unit rate. |
triggerReason | Configured trigger description or generated reason. |
taxable | From triggerConfig.taxable, default false. |
billable | From triggerConfig.billable, default true. |
sourceSnapshot | Immutable explanation of trigger type, application mode, config, amount unit, EAB flag, and matched metadata. |