T1 Electrical SolutionsT1 Platform Docs
Allowance Matrix

Allowance QA Playbook

Allowance QA Playbook

Use this playbook to verify allowance matrix behavior.

Database tables to inspect

TableExpected use
client_allowancesRule configuration.
projects.allowances_dataProject apply/rate/type settings.
time_entries.allowances_dataManual and selectable per-entry selections.
time_entries.work_conditions_dataFlags for timesheet_flag, callout, break, dirty work, etc.
timesheet_allowance_linesCalculated allowance output.
timesheet_calculation_linesAward snapshot lines that include allowance output.

Test scenarios

Hourly site allowance

  1. Create an active enabled client allowance named Site Allowance.
  2. Set amount unit to hourly.
  3. Set trigger type to project_flag.
  4. Add matching project allowance row with apply: true.
  5. Submit a timesheet with positive entry hours.
  6. Expect one calculated allowance line with quantity equal to matched hours.

Long shift meal allowance

  1. Create active enabled client allowance with shift_hours_over.
  2. Set triggerConfig.thresholdHours to 10.
  3. Submit a 10.0 hour entry.
  4. Expect no line.
  5. Submit a 10.5 hour entry.
  6. Expect a line, because the code uses > rather than >=.

Manual travel allowance

  1. Create active enabled client allowance named Travel Allowance.
  2. Set application mode to manual or selectable_timesheet.
  3. Select the allowance on a time entry.
  4. Include quantity, days, hours, or units if not using the default of one.
  5. Submit the timesheet.
  6. Expect one calculated allowance line after submission.

Overtime allowance

  1. Create hourly allowance with trigger overtime_hours.
  2. Configure dailyThresholdHours or weeklyThresholdHours.
  3. Submit entries above threshold.
  4. Expect quantity equal to calculated overtime hours only.

Normal time or all-inclusive allowance

  1. Create hourly allowance with trigger normal_time_hours.
  2. Configure threshold, often 8 hours.
  3. Submit entries.
  4. Expect quantity equal to normal-time hours, not overtime hours.

Daily or weekly allowance

  1. Create allowance with unit daily_or_weekly.
  2. Configure weeklyThresholdDays, defaulting to 5 if missing.
  3. Configure weeklyAmount if weekly rate differs from daily rate.
  4. Submit enough worked days to cross threshold.
  5. Expect quantity 1.0 and selected mode weekly in the source snapshot.

Commands

Dry run:

cd app
php bin/console app:allowances:recalculate-timesheets --limit=50

Persist:

cd app
php bin/console app:allowances:recalculate-timesheets --force --limit=50

Single timesheet:

cd app
php bin/console app:allowances:recalculate-timesheets --force --id=<timesheet-id>

On this page