(fix) O3-5422: Give BillLineItems their own BillLineItemStatus - #154
Open
EDSONZ-WASSWA wants to merge 2 commits into
Open
Conversation
Comment on lines
48
to
49
| private BillLineItemStatus paymentStatus; // this should only be set to either | ||
| // pending or paid |
Contributor
There was a problem hiding this comment.
This comment is no longer needed
Suggested change
| private BillLineItemStatus paymentStatus; // this should only be set to either | |
| // pending or paid | |
| private BillLineItemStatus paymentStatus; |
| baseTableName="bill_exemption_rule" baseColumnNames="voided_by" | ||
| referencedTableName="users" referencedColumnNames="user_id"/> | ||
| </changeSet> | ||
| <changeSet id="openmrs.billing-004-20260320-migrate-line-item-payment-status" author="Wikum Weerakutti"> |
Contributor
There was a problem hiding this comment.
The author here should be your name I believe
EDSONZ-WASSWA
force-pushed
the
fix-5422-BillLineItems-should-have-its-own-BillLineItemStatus
branch
from
March 21, 2026 19:16
8fa8867 to
373f8e3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
============================================
+ Coverage 27.04% 27.14% +0.10%
- Complexity 497 498 +1
============================================
Files 190 191 +1
Lines 4337 4343 +6
Branches 492 492
============================================
+ Hits 1173 1179 +6
Misses 3062 3062
Partials 102 102 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
EDSONZ-WASSWA
force-pushed
the
fix-5422-BillLineItems-should-have-its-own-BillLineItemStatus
branch
from
March 31, 2026 15:42
0e3472a to
8856dbc
Compare
…illLineItemStatus
wikumChamith
reviewed
Apr 2, 2026
Comment on lines
1114
to
1115
| <changeSet id="openmrs.billing-004-20260320-add-provider-id-to-bill-payment" author="Nethmi Rodrigo"> | ||
| <comment>Add cashier (provider) for each payment to track which cashier processed the payment</comment> |
Member
There was a problem hiding this comment.
This needs to be inside the tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, line items were just reusing the main BillStatus enum. That with that a single line item can't be "POSTED" — only the parent bill can.
##To clean this up, I've split them apart:
Added a new BillLineItemStatus enum that includes all the standard statuses (PENDING, PAID, CANCELLED, ADJUSTED, EXEMPTED) but leaves out POSTED as the ticket required.
Swapped out the old enum for the new one in the BillLineItem model and updated the Hibernate mappings ( Bill.hbm.xml ).
Updated the order creation advices and the status synchronization logic in Bill.java to use the new types.
Updated the unit tests to make sure everything still passes.
Database safety: I also added a quick Liquibase migration. Just in case there are any legacy line items in the database currently marked as POSTED , this safely flips them to PENDING so Hibernate doesn't crash when it tries to map them.
This is a fix to https://openmrs.atlassian.net/issues?filter=-1&selectedIssue=O3-5422
@NethmiRodrigo please review this pr