-
Notifications
You must be signed in to change notification settings - Fork 49
(fix)O3-5174: Prevent duplicate billable services in billing form #497
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
|
@VeronicaMuthee please have a look! |
|
@RajPrakash681 thanks for your PR. Requesting @NethmiRodrigo & @denniskigen to review. |
|
@RajPrakash681 this fix should happen in the backend module. |
@denniskigen Thank you for the feedback!
I'm happy to implement the backend validation. Please let me know the preferred approach! |
|
I've updated the ticket accordingly, @RajPrakash681. There is a frontend component:
which should be fixed, but I'd lean towards starting with the backend fix (the primary issue) before solving the secondary issue on the frontend. |
|
Set to draft pending discussions on a separate form such as Talk. |
O3-5174: Prevent duplicate billable services in billing form
Problem
The system was allowing users to add the same billable service multiple times, creating duplicate line items without warning. This resulted in confusing bills with entries like "Antenatal care & Antenatal care & Orthopedic Service", making it unclear whether the user intended to add duplicates or increase quantities.
Solution
Implemented a duplicate detection mechanism in the billing form that:
Changes Made
Files Modified:
src/billing-form/billing-form.component.tsxduplicateWarningstate to track duplicate service attemptsselectBillableItem()to detect existing services before addinghandleIncreaseQuantity()to increment quantity when user confirmshandleDismissWarning()to close the warning without actiontranslations/en.jsonduplicateServiceWarning: "Duplicate service detected"duplicateServiceMessage: "{{itemName}} is already in this bill. Would you like to increase the quantity?"increaseQuantity: "Yes, increase quantity"cancel: "Cancel"Testing
📸 Screenshots
Quantity increased after clicking "Yes, increase quantity":


Related Issue
Fixes #O3-5174
Impact