-
Notifications
You must be signed in to change notification settings - Fork 991
Fix: Display "Locked" badge for locked invoices instead of ₹0.00 in Total column #14971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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 |
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>
There was a problem hiding this 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
| {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)} | ||
| /> | ||
| )} |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
🎭 Playwright Test ResultsStatus: ✅ Passed
📊 Detailed results are available in the playwright-final-report artifact. Run: #4159 |
| {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)} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
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?
|
@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! 🙌 |
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:
InvoicesData.tsxto conditionally render Total column based oninvoice.lockedstateinvoice.locked === trueMonetaryDisplaywithinvoice.total_grosswhen invoice is not lockedvariant="secondary")Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist
Original prompt
💡 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.