-
Notifications
You must be signed in to change notification settings - Fork 100
11527 need to improve inward doctor payment summary #11581
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
11527 need to improve inward doctor payment summary #11581
Conversation
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Closes #11527 Signed-off-by: Dr M H B Ariyaratne <[email protected]>
WalkthroughThe pull request introduces new methods and fields for aggregating professional payment data in the inward payment controller, along with enhancements to tax configuration handling. Changes in the core data classes add financial tracking fields. The report controller’s scope was updated to better preserve session state. In addition, several UI modifications have been made, including a redesigned payment summary table, updated menu icons, and consolidated form structures. Overall, the changes affect business logic, backend data handling, and user interface presentation. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant Controller as InwardStaffPaymentBillController
participant DB
participant Bundle as IncomeBundle
User->>UI: Select professional payment filter (Discharged/Added)
UI->>Controller: fillProfessionalPaymentsByDischargedDate()/fillProfessionalPaymentsByAddedDate()
Controller->>DB: Execute JPQL query for BillFee records with filters
DB-->>Controller: Return aggregated payment data
Controller->>Bundle: Update IncomeBundle with totals (netTotal & paidTotal)
Controller->>Controller: Retrieve latest withholding tax status via getWithholdingTaxCalculationStatus()
Controller-->>UI: Return updated payment summary data
Assessment against linked issues
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (9)
src/main/java/com/divudi/core/data/IncomeRow.java (2)
141-141
: Consider using BigDecimal for monetary amounts.
You introducedprivate double paidTotal;
to store paid totals. While usingdouble
is convenient, floating-point rounding may lead to inaccuracies when dealing with real currency.
897-898
: Remove or justify extra blank lines.
These newly added blank lines appear unnecessary. Removing them keeps the file compact and more consistent.897- 898-src/main/java/com/divudi/core/data/IncomeBundle.java (1)
43-45
: Consider BigDecimal for new financial fields.
FieldsnetTotal
andpaidTotal
are introduced asdouble
. For monetary values, usingBigDecimal
helps avoid floating-point rounding errors.src/main/webapp/inward/report_doctor_payment_summery.xhtml (3)
47-48
: BHT Type selection.
"BHT" type is presumably a domain-specific admission detail. Confirm the user has enough context to accurately choose among the options.
61-63
: Bootstrap row and col usage.
You introduced.row
and.col-12
. Ensure the appropriate spacing for the parent container, if any.
120-122
: Typographical error in facet header.
You labeled the header as "Processional Payments." If you meant "Professional Payments," please correct the wording.-<h:outputText value="Processional Payments" /> +<h:outputText value="Professional Payments" />src/main/java/com/divudi/bean/inward/InwardStaffPaymentBillController.java (1)
716-801
: Aggregating BillFee data and building an IncomeBundle.
The approach of iterating over each BillFee and storing aggregates in a map keyed by Staff works. Consider using a grouped JPQL query to sum fee values and paid values, which can improve performance by offloading aggregation to the database.src/main/webapp/resources/ezcomp/menu.xhtml (2)
615-620
: Lab Analytics Icon Change:
The Lab Analytics menu item has been updated to include the new"pi pi-chart-bar"
icon, which standardizes the appearance across analytics-related entries.Note: Verify that the privilege check
#{webUserController.hasPrivilege('LabSummeries')}
is correctly spelled and intentional, as it might be a typographical error for “LabSummaries”.
1209-1214
: Channel Analytics Icon Update:
The Channel Analytics menu item now includes the"pi pi-chart-bar"
icon. This improves the overall visual consistency for analytics items.Note: Please double-check whether the rendered condition
#{webUserController.hasPrivilege('ChannelSummery')}
is intentionally spelled as “Summery” or if it should be “Summary”.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/main/java/com/divudi/bean/inward/InwardStaffPaymentBillController.java
(11 hunks)src/main/java/com/divudi/bean/report/MdInwardReportController.java
(2 hunks)src/main/java/com/divudi/core/data/IncomeBundle.java
(2 hunks)src/main/java/com/divudi/core/data/IncomeRow.java
(3 hunks)src/main/webapp/inward/inward_reports.xhtml
(1 hunks)src/main/webapp/inward/report_doctor_payment_summery.xhtml
(1 hunks)src/main/webapp/resources/ezcomp/menu.xhtml
(7 hunks)src/main/webapp/resources/ezcomp/midding_data_fields.xhtml
(4 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
src/main/java/com/divudi/bean/inward/InwardStaffPaymentBillController.java (2)
src/main/java/com/divudi/core/data/IncomeBundle.java (1)
IncomeBundle
(20-1537)src/main/java/com/divudi/core/data/IncomeRow.java (1)
IncomeRow
(17-1229)
🔇 Additional comments (40)
src/main/webapp/inward/inward_reports.xhtml (1)
15-17
: UI enhancement with improved stylingAdding the CSS classes
m-1 w-100
to the accordion panel improves the UI by providing a small margin and ensuring the panel takes up the full width of its container. This change aligns with the overall session state preservation improvement mentioned in the PR summary.src/main/webapp/resources/ezcomp/midding_data_fields.xhtml (1)
15-147
: Form structure improvement for better state managementRestructuring by moving the
<h:form>
tag to wrap the entire accordion panel consolidates multiple forms into a single form. This is a good change that:
- Ensures all form inputs across tabs will be submitted together
- Simplifies the AJAX behavior as all fields are within the same form context
- Improves state preservation across tab switches
This change will work better with session-scoped controllers and supports the new professional payment functionalities mentioned in the PR summary.
src/main/java/com/divudi/bean/report/MdInwardReportController.java (1)
48-48
: Appropriate scope change from RequestScoped to SessionScoped.The controller has been changed from request-scoped to session-scoped, allowing state (report parameters, calculation results) to persist throughout a user's session. This is a beneficial change for report generation workflows as it maintains the user's report configuration between requests, providing a better user experience when working with inward payment summaries.
Also applies to: 58-58
src/main/java/com/divudi/core/data/IncomeRow.java (1)
1219-1226
: Verify financial calculations with new getters and setters.
The getters and setters forpaidTotal
look fine functionally. If you intend to sum or manipulate these values across multiple threads or contexts, ensure concurrency safety and consider potential rounding issues.src/main/java/com/divudi/core/data/IncomeBundle.java (1)
1519-1534
: Validate new summarization fields.
The new getters and setters fornetTotal
andpaidTotal
align with the added financial tracking. Ensure that any aggregation logic (likepopulateSummaryRow()
) references these fields consistently.src/main/webapp/inward/report_doctor_payment_summery.xhtml (20)
24-29
: Check p:calendar styling classes.
Updating these classes can affect component spacing and alignment. Confirm that the user experience remains smooth on different screen sizes.
34-35
: AutoComplete changes look fine.
No issues spotted. Ensure thatspecialityController.completeSpeciality
properly handles partial matches for large data sets.
40-45
: Admission Type dropdown updates.
Referring toadmissionTypeController.items
. Verify that the default "All Admission Types" case is handled in the controller logic.
53-54
: Credit company filtering.
Ensure that "All Credit Companies" behaviors are tested when no specific institution is selected.
58-58
: PanelGrid closure.
No functional changes noted. Confirm that the layout is valid.
64-70
: New button for filling professional payments by added date.
Looks correct. Confirm thatfillProfessionalPaymentsByAddedDate()
is covered by tests if the logic is significant.
71-75
: New button for filling professional payments by discharge date.
Implementation is consistent with the added-date version. Again, consider adding unit tests.
78-85
: Hidden command button for paid professional payments by added date.
This is rendered asfalse
. If you intend to use it later, ensure the method references remain valid.
86-91
: Hidden command button for paid professional payments by completed discharge date.
Similar to the above. The button is hidden, so no immediate effect.
92-95
: Print feature.
Thep:printer
targetingtbl
is straightforward. No concerns.
97-100
: Excel export.
Thep:dataExporter
usage is correct. No performance issues expected.
102-105
: Spacing changes.
These new lines mainly improve visual spacing. Looks fine.
107-119
: Data table configuration changes.
You introducedrowKey="#{ir.uuid}"
and adjusted pagination. Confirm that eachIncomeRow
always has a unique UUID for stable rowKey usage.
124-130
: Additional column: Speciality.
No functional issues. Checking for NPE ifir.staff
orir.staff.speciality
is null might be important.
132-138
: Additional column: Name.
Same caution about potential null references forir.staff.person
.
140-155
: New Net Total column.
Columns with numeric filtering and sorting are a good addition. Confirm data type formatting is consistent with other columns.
157-171
: New Paid Total column.
Ensures display ofir.paidTotal
. The approach is consistent with the net total column.
175-175
: Footer update.
No concerns. The table ends properly.
31-32
:❓ Verification inconclusive
Confirm date range consistency.
You’re using the same date pattern for both from-date and to-date. Ensure the system logic prohibits invalid ranges (e.g. from-date after to-date).
🏁 Script executed:
#!/bin/bash # Searching for date range validations in controller or xhtml rg "fromDate" -A 5 rg "toDate" -A 5Length of output: 68123
Date Range Consistency & Validation Check
The date fields throughout the application consistently use the long date/time format defined by
#{sessionController.applicationPreference.longDateTimeFormat}
. Please confirm that the corresponding controller logic (for example, withininwardStaffPaymentBillController
or other related controllers) properly validates the date range—ensuring that a "from-date" is not set later than the "to-date." This check is crucial to prevent invalid input despite the consistent UI formatting.
19-22
:❓ Verification inconclusive
Ensure that the expanded panel grid columns match desired layout.
Changing columns to 8 can significantly alter the UI. Double-check the layout in all target viewports for responsiveness.
🏁 Script executed:
#!/bin/bash # Searching for references to this xhtml to ensure it's included in the correct layout or template rg "report_doctor_payment_summery.xhtml" -A 3Length of output: 45
Verify Responsive Layout of 8-Column Panel Grid
The current change in
src/main/webapp/inward/report_doctor_payment_summery.xhtml
sets the panel grid to 8 columns, which could significantly affect the UI’s appearance and responsiveness. Automated searches for this file's usage did not yield further context, so please manually verify that the new grid layout adapts correctly across all target viewports. If any issues are found, consider revising the column count or the overall layout as needed.src/main/java/com/divudi/bean/inward/InwardStaffPaymentBillController.java (10)
16-17
: Imports are correct and consistent.
No issues found with these new import statements.
66-66
: EJB references appear valid.
The newly introduced EJB fields (BillFacade, BillItemFacade, BillNumberGenerator, StaffFacade) are properly annotated and match your usage patterns.Also applies to: 82-90
91-98
: Dependency injection is properly declared.
SessionController, ConfigOptionApplicationController, and DrawerController are injected correctly.
99-105
: Added class fields are consistent with the overall design.
Your new lists, numeric totals, and reference fields (e.g.,bills
,billComponents
,selectedItems
,bundle
, etc.) align with the rest of the controller’s logic. Make sure to remove any fields that are never accessed to keep the class maintainable.Also applies to: 114-119, 129-130, 133-136, 137-147, 151-160, 162-168
170-179
: No functional changes in these folding or comment lines.
277-279
: Ensure withholdings are initialized before view navigation.
CallingfetchWithholdingDetailConfiguration()
prior to returning the new page is a good approach to ensure the UI has correct default settings.
281-304
: Withholding tax configuration method looks good.
This method adequately initializes withholding tax calculation statuses from your configuration. The code is straightforward; ensure you’ve tested the dependent keys.
307-307
: No substantive change.
These lines appear to be empty lines, closing braces, or single-line calls with no notable effect on functionality.Also applies to: 340-340, 367-367, 394-394, 631-631, 707-709
710-715
: Methods delegate to fillProfessionalPayments effectively.
Using separate shortcuts for discharge date vs. added date is clean and readable.
2080-2087
: Getter/Setter for bundle are well-defined.
These methods align with the usage infillProfessionalPayments(...)
. The naming and logic are consistent with the rest of the class.src/main/webapp/resources/ezcomp/menu.xhtml (5)
269-273
: OPD Analytics Icon Update:
The menu item for OPD Analytics now uses the new icon"pi pi-chart-bar"
. This change improves visual consistency with other analytics items and aligns with the updated design guidelines.
441-447
: Inward Analytics Icon Addition:
Anicon="pi pi-chart-bar"
attribute has been added to the Inward Analytics menu item. This update ensures the iconography is consistent with the rest of the application while preserving the existing action and rendered conditions.
945-950
: Pharmacy Analytics Icon Update:
The Pharmacy Analytics item has been revised to use the"pi pi-chart-bar"
icon, bringing it in line with the current UI aesthetic. The functional behavior and privilege check (#{webUserController.hasPrivilege('PharmacySummaryViews')}
) remain unchanged.
1062-1068
: Theatre Analytics Icon Replacement:
The Theatre Analytics menu item now features the"pi pi-chart-bar"
icon. This change enhances the consistency of analytics icons across different modules (OPD, Lab, Pharmacy, etc.).
1125-1130
: Store Analytics Icon Addition:
The Store Analytics menu item has been updated to display the new"pi pi-chart-bar"
icon. This update appears to be a straightforward visual change without impacting the underlying functionality.
The others will be added later |
Closes #11527
Summary by CodeRabbit
New Features
User Interface Enhancements