-
Notifications
You must be signed in to change notification settings - Fork 49
(feat) O3-5126: Should be able to select a cash point on the billing module #483
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
base: main
Are you sure you want to change the base?
Conversation
|
@NethmiRodrigo please take a look at this |
NethmiRodrigo
left a comment
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.
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)
- 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?
- 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.
- 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.
|
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 |
|
Okk no problem |
|
@NethmiRodrigo was looking at Taifacare and looks like it has something similar too taifa-care-cash-point.mp4 |
Yeah I'm aware of this |
Requirements
Summary
Should be able to select a cash point on the billing module
selectedCashPointContext.ts
)
New context to share selected cash point across components
Uses OpenmrsResource type from the framework
billing-dashboard.component.tsx
)
Added SelectedCashPointContext.Provider
Maintains state for selected cash point at the dashboard level
cash-point-selector.component.tsx
)
Now uses context instead of local state
When user changes cash point in dropdown, it updates the global context
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
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
Related Issue