Allowance Matrix
Allowance QA Playbook
Allowance QA Playbook
Use this playbook to verify allowance matrix behavior.
Database tables to inspect
| Table | Expected use |
|---|---|
client_allowances | Rule configuration. |
projects.allowances_data | Project apply/rate/type settings. |
time_entries.allowances_data | Manual and selectable per-entry selections. |
time_entries.work_conditions_data | Flags for timesheet_flag, callout, break, dirty work, etc. |
timesheet_allowance_lines | Calculated allowance output. |
timesheet_calculation_lines | Award snapshot lines that include allowance output. |
Test scenarios
Hourly site allowance
- Create an active enabled client allowance named
Site Allowance. - Set amount unit to
hourly. - Set trigger type to
project_flag. - Add matching project allowance row with
apply: true. - Submit a timesheet with positive entry hours.
- Expect one calculated allowance line with quantity equal to matched hours.
Long shift meal allowance
- Create active enabled client allowance with
shift_hours_over. - Set
triggerConfig.thresholdHoursto10. - Submit a 10.0 hour entry.
- Expect no line.
- Submit a 10.5 hour entry.
- Expect a line, because the code uses
>rather than>=.
Manual travel allowance
- Create active enabled client allowance named
Travel Allowance. - Set application mode to
manualorselectable_timesheet. - Select the allowance on a time entry.
- Include
quantity,days,hours, orunitsif not using the default of one. - Submit the timesheet.
- Expect one calculated allowance line after submission.
Overtime allowance
- Create hourly allowance with trigger
overtime_hours. - Configure
dailyThresholdHoursorweeklyThresholdHours. - Submit entries above threshold.
- Expect quantity equal to calculated overtime hours only.
Normal time or all-inclusive allowance
- Create hourly allowance with trigger
normal_time_hours. - Configure threshold, often 8 hours.
- Submit entries.
- Expect quantity equal to normal-time hours, not overtime hours.
Daily or weekly allowance
- Create allowance with unit
daily_or_weekly. - Configure
weeklyThresholdDays, defaulting to 5 if missing. - Configure
weeklyAmountif weekly rate differs from daily rate. - Submit enough worked days to cross threshold.
- Expect quantity
1.0and selected modeweeklyin the source snapshot.
Commands
Dry run:
cd app
php bin/console app:allowances:recalculate-timesheets --limit=50Persist:
cd app
php bin/console app:allowances:recalculate-timesheets --force --limit=50Single timesheet:
cd app
php bin/console app:allowances:recalculate-timesheets --force --id=<timesheet-id>