-
Notifications
You must be signed in to change notification settings - Fork 102
Debtor Analysis - Excess search (Credit company) #11834 #12581
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
Debtor Analysis - Excess search (Credit company) #11834 #12581
Conversation
""" WalkthroughThe pull request refactors the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Controller as CreditCompanyDueController
participant Facade as patientEncounterFacade
participant Exporter as Excel/PDF Export Logic
User->>Controller: Trigger createInwardCreditAccessWithFilters()
Controller->>Facade: Execute JPQL query with dynamic filters
Facade-->>Controller: Return filtered PatientEncounters
Controller->>Controller: Map encounters by Institution, aggregate amounts
User->>Controller: Trigger exportCreditCompanyInwardExcessToExcel()/Pdf()
Controller->>Exporter: Generate formatted report with mapping and totals
Exporter-->>User: Downloadable Excel/PDF file
Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.38.1)src/main/java/com/divudi/bean/common/CreditCompanyDueController.java📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)src/main/java/com/divudi/bean/common/CreditCompanyDueController.java (1)undefined <retrieved_learning> 🧬 Code Graph Analysis (1)src/main/java/com/divudi/bean/common/CreditCompanyDueController.java (1)
🔇 Additional comments (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading ent 8000 ire 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: 4
🔭 Outside diff range comments (1)
src/main/webapp/reports/financialReports/credit_company_inward_excess.xhtml (1)
190-208
:⚠️ Potential issueRemove duplicate data processing in export buttons
The Excel and PDF export buttons have both
action
andactionListener
attributes that process the same data. TheactionListener
callscreateInwardCreditAccessWithFilters()
which is redundant since the export methods should already have the processed data from the initial "Process" button click.Remove the
actionListener
attribute from both export buttons:<p:commandButton class="ui-button-success my-4 mx-2" style="width: 150px" icon="fas fa-file-excel" ajax="false" value="Excel" - action="#{creditCompanyDueController.exportCreditCompanyInwardExcessToExcel()}" - actionListener="#{creditCompanyDueController.createInwardCreditAccessWithFilters()}"> + action="#{creditCompanyDueController.exportCreditCompanyInwardExcessToExcel()}"> </p:commandButton> <p:commandButton class="ui-button-danger my-4 mx-2" style="width: 150px" icon="fas fa-file-pdf" ajax="false" value="PDF" - action="#{creditCompanyDueController.exportCreditCompanyInwardExcessToPdf()}" - actionListener="#{creditCompanyDueController.createInwardCreditAccessWithFilters()}"> + action="#{creditCompanyDueController.exportCreditCompanyInwardExcessToPdf()}"> </p:commandButton>
🧹 Nitpick comments (3)
src/main/java/com/divudi/bean/common/CreditCompanyDueController.java (1)
2801-2801
: Consider using standard dash instead of em dash.The em dash character (—) might cause encoding issues in some PDF viewers.
Replace with a standard hyphen:
-table.addCell(new Phrase("—", boldFont)); +table.addCell(new Phrase("-", boldFont));Also applies to: 2810-2810
src/main/webapp/reports/financialReports/credit_company_inward_excess.xhtml (2)
269-273
: Consider extracting long method calls to improve readabilityThe method calls to retrieve policy and reference numbers are quite long and affect code readability. Consider creating shorter aliases in the controller or using more concise method names.
For better maintainability, consider shorter method names in the controller:
-<h:outputLabel value="#{creditCompanyDueController.getPolicyNumberFromEncounterCreditCompanyMap(b.bhtNo, entry.key.name)}"/> +<h:outputLabel value="#{creditCompanyDueController.getPolicyNumber(b.bhtNo, entry.key)}"/>-<h:outputLabel value="#{creditCompanyDueController.getReferenceNumberFromEncounterCreditCompanyMap(b.bhtNo, entry.key.name)}"/> +<h:outputLabel value="#{creditCompanyDueController.getReferenceNumber(b.bhtNo, entry.key)}"/>
371-465
: Consider removing commented old codeThe old table implementation has been preserved as comments. While this can be helpful during the transition period, consider removing it in a future commit to keep the codebase clean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/divudi/bean/common/CreditCompanyDueController.java
(3 hunks)src/main/webapp/reports/financialReports/credit_company_inward_excess.xhtml
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/java/com/divudi/bean/common/CreditCompanyDueController.java (1)
src/main/java/com/divudi/core/data/dataStructure/InstitutionBillEncounter.java (1)
InstitutionBillEncounter
(10-200)
🔇 Additional comments (3)
src/main/java/com/divudi/bean/common/CreditCompanyDueController.java (2)
2697-2699
: Verify column indices for styling.The loop applies
amountStyle
to columns 5-8, but ensure these match the actual numeric columns in your data.Based on the headers, columns 5-8 should be: Billed Amount (5), Paid by Patient (6), Paid by Company (7), Excess Amount (8). This appears correct.
2752-2759
: Well-structured date formatting implementation.Good use of SimpleDateFormat for consistent date formatting in the PDF export.
src/main/webapp/reports/financialReports/credit_company_inward_excess.xhtml (1)
210-364
: Well-structured data table refactoringThe refactoring to use
billInstitutionEncounterMap.entrySet()
with institution-level grouping is a good architectural improvement. The new column structure with additional fields (discharge date, policy number, reference number) provides better reporting capabilities.
Summary by CodeRabbit