fix: report Version Status collapses Approved into Completed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Krao Hasanee
2026-06-09 23:33:34 -05:00
parent c891f53d2a
commit 6b9f008fff
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -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 *)"
]
}
}
+4 -4
View File
@@ -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,
]),