From 6b9f008fffd617461e67a113ab5d8eaa70ff4d8e Mon Sep 17 00:00:00 2001 From: Krao Hasanee Date: Tue, 9 Jun 2026 23:33:34 -0500 Subject: [PATCH] fix: report Version Status collapses Approved into Completed Co-Authored-By: Claude Opus 4.8 --- .claude/settings.local.json | 3 ++- src/pages/team/TeamReports.jsx | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 3e86984..55581b9 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -28,7 +28,8 @@ "Bash(git commit -q -m 'fix: guard task status updates on invoice lifecycle transitions *)", "Bash(vercel ls *)", "Bash(vercel --prod)", - "Bash(git commit -q -m 'feat: add Sub Billing column to billing report \\(sub invoiced/paid per version\\) *)" + "Bash(git commit -q -m 'feat: add Sub Billing column to billing report \\(sub invoiced/paid per version\\) *)", + "Bash(git commit -q -m 'fix: report Version Status collapses Approved into Completed *)" ] } } diff --git a/src/pages/team/TeamReports.jsx b/src/pages/team/TeamReports.jsx index 035ba71..522d4a8 100644 --- a/src/pages/team/TeamReports.jsx +++ b/src/pages/team/TeamReports.jsx @@ -42,9 +42,9 @@ function versionStateFor(task, versionNumber) { const version = Number(versionNumber || 0); if (version < currentVersion) return 'completed'; const status = task?.status || 'not_started'; - // invoiced/paid are billing states (legacy leak) — collapse to the work state - // they imply. Billing is shown separately in the Billing column. - if (status === 'invoiced' || status === 'paid') return 'client_approved'; + // Approved work = done. client_approved (and legacy invoiced/paid billing leak) + // all collapse to Completed. Billing is shown separately in the Billing columns. + if (status === 'client_approved' || status === 'invoiced' || status === 'paid') return 'completed'; return status; } @@ -280,7 +280,7 @@ export default function TeamReports() { row.task_title, row.version_label, row.version_type, - row.version_state === 'client_review' ? 'In Review' : row.version_state === 'client_approved' ? 'Approved' : row.version_state.replace(/_/g, ' '), + row.version_state === 'client_review' ? 'In Review' : row.version_state === 'completed' ? 'Completed' : row.version_state.replace(/_/g, ' '), row.billing_label, row.sub_billing_label, ]),