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, ]),