Skip to content

Conversation

@tendomart
Copy link

@tendomart tendomart commented Oct 29, 2025

Requirements

  • This PR has a title that briefly describes the work done including a conventional commit type prefix and a Jira ticket number if applicable. See existing PR titles for inspiration.
  • My work is based on designs, which are linked or shown either in the Jira ticket or the description below.

Summary

Should be able to select a cash point on the billing module

  1. Created Context (
    selectedCashPointContext.ts
    )
    New context to share selected cash point across components
    Uses OpenmrsResource type from the framework
  2. Updated Dashboard (
    billing-dashboard.component.tsx
    )
    Added SelectedCashPointContext.Provider
    Maintains state for selected cash point at the dashboard level
  3. Updated CashPointSelector (
    cash-point-selector.component.tsx
    )
    Now uses context instead of local state
    When user changes cash point in dropdown, it updates the global context
  4. Updated BillsTable (
    bills-table.component.tsx
    )
    Consumes SelectedCashPointContext
    Added cashPointMatch filter that checks if bill.cashPointUuid === selectedCashPoint.uuid
    Bills are now filtered by the selected cash point along with status and search filters
  5. Updated MetricsCards (
    metrics-cards.component.tsx
    )
    Consumes SelectedCashPointContext
    Filters bills by selected cash point before calculating metrics
    Metrics (cumulative, pending, paid bills) now reflect only the selected cash point
    How It Works:
    When component loads, the first cash point is automatically selected
    User can select a different cash point from the dropdown
    Both the bills table and metrics cards automatically update to show only bills belonging to that cash point
    The filtering uses the cashPointUuid property from each bill to match against the selected cash point's UUID
    Fee

Screenshots

billing-cash-points.mp4

Uploading Screenshot from 2025-10-29 18-21-49.png…

Related Issue

@tendomart
Copy link
Author

@NethmiRodrigo please take a look at this

@tendomart tendomart requested a review from denniskigen October 29, 2025 15:33
@NethmiRodrigo NethmiRodrigo changed the title O3-5126:Should be able to select a cash point on the billing module (feat) O3-5126: Should be able to select a cash point on the billing module Oct 30, 2025
Copy link
Contributor

@NethmiRodrigo NethmiRodrigo left a comment

Choose a reason for hiding this comment

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

Thanks @tendomart. I haven't reviewed the technical details of this yet, because there's a couple of implementation details about this that needs to fleshed out before we actually do this feature (which is why I had the ticket assigned to myself)

  1. The cash point is currently associated with a bill at the time of bill creation with whatever cashpoint is configured on the frontend. This means that you all bills get associated with a single specific cashpoint. Which raises the question, how should a cashpoint get associated with a bill when a bill is created? Through the patient-chart, we could potentially show a dropdown to allow the users to select a cashpoint from the list of cashpoints, but there is also a need to create bills from drug orders and such, so how would cashpoints get associated to a bill then?
  2. Clocking in is a whole different feature entirely, and should call a separate endpoint that records a timesheet, so displaying the time clocked in when all that the cashpoint dropdown does is filter the bills by the cashpoint would be technically incorrect.
  3. Ideally, bills should get associated with a cashpoint at the time of payment, which means something like when the user selects a cashpoint on the dropdown, and records a payment on a bill, the bill will get associated with that cashpoint. But, we need to see if this is a workflow that is supported by the backend.
    I had made a talk post here to get feedback from the implementations as well.

@tendomart
Copy link
Author

Hey @NethmiRodrigo since there's still discussions I can still put a halt or close the this ticket

@NethmiRodrigo
Copy link
Contributor

Hey @NethmiRodrigo since there's still discussions I can still put a halt or close the this ticket

Let's keep this in draft for now

@tendomart
Copy link
Author

Okk no problem

@tendomart tendomart marked this pull request as draft November 6, 2025 07:35
@tendomart
Copy link
Author

@NethmiRodrigo was looking at Taifacare and looks like it has something similar too

taifa-care-cash-point.mp4

@NethmiRodrigo
Copy link
Contributor

@NethmiRodrigo was looking at Taifacare and looks like it has something similar too

taifa-care-cash-point.mp4

Yeah I'm aware of this

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.

2 participants