Skip to content

Add payment status column in payments table inside invoice#15223

Closed
yash-learner wants to merge 2 commits intodevelopfrom
issues/15222/show-status-for-payments-invoice-page
Closed

Add payment status column in payments table inside invoice#15223
yash-learner wants to merge 2 commits intodevelopfrom
issues/15222/show-status-for-payments-invoice-page

Conversation

@yash-learner
Copy link
Copy Markdown
Member

@yash-learner yash-learner commented Jan 19, 2026

Proposed Changes

Fixes #15222

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes

Summary by CodeRabbit

  • New Features
    • Added a payment status column to invoice payment listings, showing color-coded badges for each payment to improve at-a-glance transaction visibility and quick status identification. Status labels are localized to match the user's language settings for clearer interpretation.

@yash-learner yash-learner requested review from a team and Copilot January 19, 2026 09:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_COLORS constant 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 19, 2026

Walkthrough

Modified 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

Cohort / File(s) Summary
Payment Status Display
src/pages/Facility/billing/invoice/InvoiceShow.tsx
Added import of PAYMENT_RECONCILIATION_STATUS_COLORS. Added a "status" column to the payments table header and a status Badge cell per payment row that selects variant from the status colors map and displays localized status text. (+20/-1 lines)
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a payment status column to the payments table in the invoice view.
Description check ✅ Passed The PR description references the linked issue (#15222) and includes the full merge checklist template, though specific change details are minimal.
Linked Issues check ✅ Passed The code changes implement displaying payment status (cancelled and Entered in Error) in the payments table via a new Badge column using PAYMENT_RECONCILIATION_STATUS_COLORS, meeting issue #15222 requirements.
Out of Scope Changes check ✅ Passed All changes are scoped to adding a status column to the payments table in InvoiceShow.tsx, directly addressing the linked issue #15222 with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issues/15222/show-status-for-payments-invoice-page

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 19, 2026

🎭 Playwright Test Results

Status: ❌ Failed
Test Shards: 3

Metric Count
Total Tests 176
✅ Passed 162
❌ Failed 14
⏭️ Skipped 0

📊 Detailed results are available in the playwright-final-report artifact.

Run: #6632

@github-actions github-actions Bot added the Merge Conflict pull requests with merge conflict label Jan 20, 2026
@github-actions
Copy link
Copy Markdown

Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @yash-learner

See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 23, 2026

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

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

View logs

@github-actions github-actions Bot removed the Merge Conflict pull requests with merge conflict label Feb 23, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Status 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_payments and invoice.total_credit_notes are 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).

ℹ️ Review info

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17f27b1 and bc4c2a0.

📒 Files selected for processing (1)
  • src/pages/Facility/billing/invoice/InvoiceShow.tsx

@amjithtitus09
Copy link
Copy Markdown
Member

We're showing only active payments anyway

@github-actions github-actions Bot added needs-triage question Further information is requested labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show cancelled status when payment is cancelled on invoice page

3 participants