Add payment status column in payments table inside invoice#15223
Add payment status column in payments table inside invoice#15223yash-learner wants to merge 2 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a payment status column to the payments table within the invoice view, enhancing visibility of payment reconciliation states.
Changes:
- Imports the
PAYMENT_RECONCILIATION_STATUS_COLORSconstant for status badge styling - Adds a new "Status" column header to the payments table
- Displays payment status as a colored badge with appropriate styling based on payment state
WalkthroughModified invoice payments table to display payment status information by importing status color definitions and adding a new status column with color-coded Badge components for each payment record. Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
🎭 Playwright Test ResultsStatus: ❌ Failed
📊 Detailed results are available in the playwright-final-report artifact. Run: #6632 |
|
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
|
Deploying care-preview with
|
| Latest commit: |
bc4c2a0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://af7e0798.care-preview-a7w.pages.dev |
| Branch Preview URL: | https://issues-15222-show-status-for.care-preview-a7w.pages.dev |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/pages/Facility/billing/invoice/InvoiceShow.tsx (1)
1192-1243:⚠️ Potential issue | 🟠 MajorStatus column never shows cancelled/entered_in_error payments.
Line 1192 and Line 1238 still gate and filter the table to active payments only, so cancelled/entered_in_error rows will never render—this misses the PR objective.
✅ Suggested fix (render all payments and keep totals as-is)
- {invoice.payments?.filter( - (p) => p.status === PaymentReconciliationStatus.active, - ).length > 0 && ( + {invoice.payments?.length > 0 && ( <> @@ - {invoice.payments - .filter( - (p) => - p.status === PaymentReconciliationStatus.active, - ) - .map((payment, index) => { + {invoice.payments.map((payment, index) => { const mainRow = (Based on learnings: “
invoice.total_paymentsandinvoice.total_credit_notesare already computed by filtering for active statuses only.”Also applies to: 1308-1318
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/Facility/billing/invoice/InvoiceShow.tsx` around lines 1192 - 1243, The table rows are currently filtered to only PaymentReconciliationStatus.active so cancelled/entered_in_error payments never render; update the rendering logic in the InvoiceShow component so the TableBody maps over invoice.payments without filtering by PaymentReconciliationStatus.active (remove the .filter((p) => p.status === PaymentReconciliationStatus.active) used before .map for the rows), while leaving any total calculations (invoice.total_payments, invoice.total_credit_notes) unchanged since those totals already filter for active statuses; apply the same change to the other payments rendering block referenced near the mapping at the later section (the block around the other .filter/.map usage).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/pages/Facility/billing/invoice/InvoiceShow.tsx`:
- Around line 1192-1243: The table rows are currently filtered to only
PaymentReconciliationStatus.active so cancelled/entered_in_error payments never
render; update the rendering logic in the InvoiceShow component so the TableBody
maps over invoice.payments without filtering by
PaymentReconciliationStatus.active (remove the .filter((p) => p.status ===
PaymentReconciliationStatus.active) used before .map for the rows), while
leaving any total calculations (invoice.total_payments,
invoice.total_credit_notes) unchanged since those totals already filter for
active statuses; apply the same change to the other payments rendering block
referenced near the mapping at the later section (the block around the other
.filter/.map usage).
|
We're showing only active payments anyway |
Proposed Changes
Fixes #15222
Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit