Three related changes to the executive payroll report:
1. Adjustment Summary table and Worker Breakdown table now render
deductive types (Deductions, Loan Repayment, Advance Repayment)
as "-R 500.00" in muted red. Before, they showed the same way as
bonuses — which read as "everyone gets richer" when a deduction
was actually shrinking net pay. New context keys:
- `adjustment_totals[i]['sign']` and `['is_deductive']`
- `active_adj_headers` (list of {label, is_deductive}) replaces
the parallel `active_adj_labels`/`active_adj_types` lists for
templates. The originals are still emitted for any external
consumer.
- `worker_breakdown[i]['adj_values']` now contains
{'amount', 'is_deductive'} dicts instead of bare Decimals.
Templates updated: report.html + pdf/report_pdf.html.
2. "Total Paid Out" hero card on /report/ now shows a small asterisk
+ tooltip when project/team filters are active, explaining that
a PayrollRecord touching the filtered scope is summed at its
FULL amount — not just the project-attributable portion. Cheap
label approach; the proper per-project attribution would need
proportional splitting across each record's work_logs (deferred).
New context key `total_paid_filter_caveat: bool`.
3. (No code change — Finding 6 was already satisfied by commit 1's
`outstanding_by_project_sorted` rewrite, but the regression test
protects the sort order going forward.)
Findings 3, 4, 6.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>