Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Proposed Changes

Locked invoices displayed ₹0.00 in the Total column of the Patient Accounts → Invoices table, creating ambiguity about whether the invoice had no value or was simply locked.

Changes:

  • Modified InvoicesData.tsx to conditionally render Total column based on invoice.locked state
  • Display "Locked" badge with lock icon when invoice.locked === true
  • Display MonetaryDisplay with invoice.total_gross when invoice is not locked
  • Badge styling matches existing locked badge in invoice detail page (variant="secondary")
<TableCell>
  {invoice.locked ? (
    <Badge variant="secondary" className="gap-1">
      <CareIcon icon="l-lock" className="size-3" />
      {t("locked")}
    </Badge>
  ) : (
    <MonetaryDisplay
      className="font-medium"
      amount={String(invoice.total_gross)}
    />
  )}
</TableCell>

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
Original prompt

This section details on the original issue you should resolve

<issue_title>Bug: Locked invoices show total as ₹0.00 in Patient Accounts table</issue_title>
<issue_description>Describe the bug

On the Patient Accounts → Invoices table, when an invoice is locked, the Total column displays ₹0.00 instead of indicating that the invoice is locked. This creates confusion and makes the UI inconsistent with how locked invoices are represented elsewhere.

Current Behavior

  • Invoice status shows Issued / Balanced
  • Invoice is Locked
  • Total column shows ₹0.00

This is misleading, as the invoice does have an amount but is locked from further changes.

Expected behavior

When an invoice is locked, the Total column should not display ₹0.00

Instead, it should display a “Locked” badge/label, consistent with the existing Locked badge UI used in:

  • Invoice detail page header
  • Other areas where the locked state is communicated

Steps to reproduce

  • Go to Billing → Accounts
  • Open a patient account
  • Navigate to the Invoices tab
  • Lock an invoice
  • Observe the Total column in the invoice table

Screenshots

Image

🚨 DO NOT EDIT BELOW THIS LINE 🚨

Instructions for Requesting Assignment:

To request assignment, please clearly outline your solution and timeline by commenting on the issue using the format below:

Describe your solution clearly:
Provide a detailed explanation of your proposed solution, including your approach, key implementation steps, and relevant examples or references. Mention any dependencies, assumptions, or risks you foresee that might affect your timeline or implementation.

Expected Timeline:

  • End date: [Expected submission date of a completed Pull Request]

Additional Context:
Include any other relevant context, links, screenshots, or resources that support your proposed solution.

🚨 Your assignment may be unassigned if there is no activity or progress within the stated timeline unless communicated clearly and agreed upon.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


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

When an invoice is locked, the Total column in the Patient Accounts → Invoices table now displays a "Locked" badge with a lock icon instead of showing ₹0.00. This provides clear visual indication that the invoice is locked and maintains consistency with the locked badge used in the invoice detail page.

Co-authored-by: nihal467 <57055998+nihal467@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix total display for locked invoices in Patient Accounts Fix: Display "Locked" badge for locked invoices instead of ₹0.00 in Total column Dec 29, 2025
Copilot AI requested a review from nihal467 December 29, 2025 11:37
@nihal467 nihal467 marked this pull request as ready for review December 29, 2025 11:39
@nihal467 nihal467 requested review from a team and Copilot December 29, 2025 11:39
Copy link
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 fixes the display of locked invoices in the Patient Accounts → Invoices table by replacing the misleading ₹0.00 total with a "Locked" badge that includes a lock icon, improving clarity and consistency with the invoice detail page.

Key Changes:

  • Added conditional rendering to the Total column based on invoice locked state
  • Displays "Locked" badge with lock icon for locked invoices instead of monetary value

Comment on lines +184 to +194
{invoice.locked ? (
<Badge variant="secondary" className="gap-1">
<CareIcon icon="l-lock" className="size-3" />
{t("locked")}
</Badge>
) : (
<MonetaryDisplay
className="font-medium"
amount={String(invoice.total_gross)}
/>
)}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

The new conditional rendering logic for locked invoices lacks test coverage. Consider adding Playwright tests to verify that locked invoices display the 'Locked' badge instead of the monetary value, and that unlocked invoices continue to display the monetary value correctly.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Can you file an issue for that?

@abhimanyurajeesh abhimanyurajeesh requested a review from a team January 1, 2026 05:22
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🎭 Playwright Test Results

Status: ✅ Passed
Test Shards: 3

Metric Count
Total Tests 251
✅ Passed 251
❌ Failed 0
⏭️ Skipped 0

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

Run: #4159

@Jacobjeevan Jacobjeevan added reviewed reviewed by a core member and removed needs review labels Jan 2, 2026
Comment on lines +184 to +194
{invoice.locked ? (
<Badge variant="secondary" className="gap-1">
<CareIcon icon="l-lock" className="size-3" />
{t("locked")}
</Badge>
) : (
<MonetaryDisplay
className="font-medium"
amount={String(invoice.total_gross)}
/>
)}
Copy link
Member

Choose a reason for hiding this comment

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

@copilot Can you file an issue for that?

@gigincg gigincg merged commit 09f507b into develop Jan 6, 2026
20 of 21 checks passed
@gigincg gigincg deleted the copilot/fix-invoice-total-display branch January 6, 2026 06:42
Copilot AI requested a review from gigincg January 6, 2026 06:42
Copilot stopped work on behalf of gigincg due to an error January 6, 2026 06:42
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

@nihal467 @Copilot Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed reviewed by a core member Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Locked invoices show total as ₹0.00 in Patient Accounts table

6 participants