Skip to content

Comments

O3-5202: Add “Finalize bill” button with privilege control#573

Draft
ValarCode wants to merge 2 commits intoopenmrs:mainfrom
ValarCode:feat/O3-5202-finalize-bill
Draft

O3-5202: Add “Finalize bill” button with privilege control#573
ValarCode wants to merge 2 commits intoopenmrs:mainfrom
ValarCode:feat/O3-5202-finalize-bill

Conversation

@ValarCode
Copy link

@ValarCode ValarCode commented Dec 5, 2025

Summary

This PR implements the frontend changes required for O3-5202, adding a “Finalize bill” action to the Invoice view. The button updates the bill status to POSTED and refreshes the UI.

What’s included

  • Added Finalize bill button to the invoice action bar on the invoice page
  • Integrated updateBillItems to send status updates to the backend
  • Normalized line items using getBillableServiceUuid (same pattern as Edit Bill Line Item)
  • Added privilege check using userHasAccess() so only users with the configured privilege see the button
  • Added loading state and snackbar notifications for success and error
  • Hides the finalize button for:
    • non-pending bills
    • users without the required privilege

Testing

  • yarn verify (all tests passing locally)
  • Manually tested on a pending bill:
    • Button visible only when status === "PENDING"
    • Button hidden when status is not pending

Backend note

When changing the bill status to POSTED, the backend currently returns:

No rounding item specified in options. This must be set in order to use rounding for bill totals.

This seems related to the billing rounding configuration on my local environment, not the payload.
I’ve asked on the Jira ticket for guidance on rounding configuration requirements.

JIRA

https://openmrs.atlassian.net/browse/O3-5202

@ValarCode ValarCode changed the title Feat/o3 5202 finalize bill O3-5202: Add “Finalize bill” button with privilege control Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant