From e2eb889a2983809b641e0c9dc1c0a1ca9675df4a Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Wed, 22 Apr 2026 21:45:31 +0200 Subject: [PATCH] Plan: Executive Payroll Report v2 implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-by-task plan for the design committed at 27cdb46. 14 tasks with 4 hard-pause checkpoints at natural demo points: - After Task 6 (backend helpers done) - After Task 8 (multi-select modal + filter pills) - After Task 12 (full HTML layout — all 4 chapters) - After Task 14 (PDF mirrored + QA + shipped note) Task 1 is a pure refactor (extract _compute_outstanding from index()) so later tasks can reuse the dashboard math with filters. Tasks 2-5 add the new helpers alongside existing code with failing-test-first discipline. Task 6 switches the main helper to multi-value filters (project_ids/team_ids) — existing behaviour preserved via backward- compatible getlist. Tasks 7-12 restructure the HTML template into Hero + 4 chapters. Task 13 mirrors in the PDF. Task 14 QAs and ships. ~11 new tests across 4 test classes; total grows from 28 to ~39. One new dependency: Choices.js 10.2.0 via CDN, admin-only gated, graceful fallback to native multi-select on CDN failure. Follows the CLAUDE.md conventions: # === SECTION === comments, plain-English docstrings, subquery-filter pattern for M2M filters, single-batched push at the end, Co-Authored-By trailer on every commit, never amend. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../2026-04-23-executive-report-v2-plan.md | 1778 +++++++++++++++++ 1 file changed, 1778 insertions(+) create mode 100644 docs/plans/2026-04-23-executive-report-v2-plan.md diff --git a/docs/plans/2026-04-23-executive-report-v2-plan.md b/docs/plans/2026-04-23-executive-report-v2-plan.md new file mode 100644 index 0000000..6b83246 --- /dev/null +++ b/docs/plans/2026-04-23-executive-report-v2-plan.md @@ -0,0 +1,1778 @@ +# Executive Payroll Report v2 — Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Rebuild `/report/` as an executive-grade dashboard — multi-select project/team filters (Choices.js), hero KPI band with live "Outstanding Now" + FoxFitt-wide cost velocity, restructured chapters I–IV, new team × project activity pivot. Mirrored in the PDF. No model changes, no migrations. + +**Architecture:** The single helper `_build_report_context(start, end, project_ids, team_ids)` remains the source of truth for both the HTML view and the PDF view. Three new sub-helpers feed it: `_current_outstanding_in_scope`, `_company_cost_velocity`, `_team_project_activity`. The dashboard's outstanding math (currently inline in `index()` at lines 165–203) is first extracted to a reusable `_compute_outstanding()` helper so both the home dashboard and the report call the same code — zero drift risk. Templates restructured into four named chapters; Choices.js enhances the modal's two `` elements to multi-select** + +Find (around lines 63-79): +```django + +``` + +Change to: +```django + +``` + +Do the same for the team select. Note: the empty `` row is removed; "all" is now the empty-selection state. + +**Step 7.2: Add Choices.js CDN + init block at the bottom of the modal partial** + +At the very end of `_report_config_modal.html` (just before the closing script block from Step 7.3 or inside the existing script block near the end): + +```django +{# === CHOICES.JS — multi-select enhancement (admin-only) === #} +{# Loaded CDN-only; falls back to native elements in the report config modal +with