From 96990c25d0b2e4ffc4c9a49794ff817e3c44dbaa Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Tue, 4 Jun 2024 08:32:23 +0530 Subject: [PATCH 01/21] Signed-off-by: buddhika75 --- pom.xml | 4 ++-- src/main/resources/META-INF/persistence.xml | 4 ++-- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- src/main/webapp/lab/report_samples.xhtml | 8 ++++++-- src/main/webapp/pharmacy/admin/amp_multiple.xhtml | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index d87115a0a7..c8eb5e61d8 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.divudi - sethma + lifeCareNew 3.0.0 war - sethma + lifeCareNew ${project.build.directory}/endorsed diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index d0a00faa13..44aea605f3 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,7 +2,7 @@ org.eclipse.persistence.jpa.PersistenceProvider - jdbc/arogya + jdbc/lcd false @@ -15,7 +15,7 @@ - jdbc/arogyaAudit + jdbc/lcdAudit com.divudi.entity.AuditEvent true diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index a8fe38368a..ddef587141 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /sethma1 + /lcd diff --git a/src/main/webapp/lab/report_samples.xhtml b/src/main/webapp/lab/report_samples.xhtml index 07b030e667..3f3cb671c6 100644 --- a/src/main/webapp/lab/report_samples.xhtml +++ b/src/main/webapp/lab/report_samples.xhtml @@ -24,7 +24,9 @@ - + + + + +
+
diff --git a/src/main/webapp/pharmacy/admin/amp_multiple.xhtml b/src/main/webapp/pharmacy/admin/amp_multiple.xhtml index 9df36c05f8..c6e8bae012 100644 --- a/src/main/webapp/pharmacy/admin/amp_multiple.xhtml +++ b/src/main/webapp/pharmacy/admin/amp_multiple.xhtml @@ -20,7 +20,7 @@ paginatorPosition="both" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" - rowsPerPageTemplate="5,10,{ShowAll|'All'}" + rowsPerPageTemplate="5,10,1000,{ShowAll|'All'}" > From 5baf0b4e18a8e392dacba3e867cb6c0a60c789ac Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sat, 15 Jun 2024 14:14:27 +0530 Subject: [PATCH 02/21] Signed-off-by: buddhika75 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 59b94c0489..00fd102f2f 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.divudi - lifeCareNew + lifeCare1 3.0.0 war - lifeCareNew + lifeCare1 ${project.build.directory}/endorsed From 5400f1fc42d91b183bb3d40333816eadaff652e5 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 17 Jun 2024 10:10:42 +0530 Subject: [PATCH 03/21] Signed-off-by: buddhika75 --- src/main/webapp/admin/staff/staff_bulk_delete.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/admin/staff/staff_bulk_delete.xhtml b/src/main/webapp/admin/staff/staff_bulk_delete.xhtml index fee421b4b7..601414cf8a 100644 --- a/src/main/webapp/admin/staff/staff_bulk_delete.xhtml +++ b/src/main/webapp/admin/staff/staff_bulk_delete.xhtml @@ -36,7 +36,7 @@ paginator="true" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" - rowsPerPageTemplate="5,10,15" + rowsPerPageTemplate="5,10,15,500" > From 0f089ef15b15e618e9b7bf70fd816da9a79f849f Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Wed, 19 Jun 2024 10:09:33 +0530 Subject: [PATCH 04/21] Signed-off-by: buddhika75 --- nb-configuration.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/nb-configuration.xml b/nb-configuration.xml index 2c47f15239..7c11325afd 100644 --- a/nb-configuration.xml +++ b/nb-configuration.xml @@ -27,6 +27,5 @@ Any value defined here will override the pom.xml file value but is only applicab /scss:/css js/libs pfv5ee8 - JDK_11 From 47093348ec75486889803b336986f3d59e95d500 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Wed, 3 Jul 2024 10:56:10 +0530 Subject: [PATCH 05/21] Signed-off-by: buddhika75 --- src/main/resources/META-INF/persistence.xml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index eeee670a33..d87f9bd348 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -7,11 +7,7 @@ - - +
@@ -21,11 +17,7 @@ - - +
From e81e04161a6a97725b1ad04b80ea873346bf9fa8 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 21 Jul 2024 09:00:37 +0530 Subject: [PATCH 06/21] Signed-off-by: buddhika75 --- src/main/webapp/opd/opd_bill.xhtml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/opd/opd_bill.xhtml b/src/main/webapp/opd/opd_bill.xhtml index 5725139dd5..18e842dde4 100644 --- a/src/main/webapp/opd/opd_bill.xhtml +++ b/src/main/webapp/opd/opd_bill.xhtml @@ -61,6 +61,18 @@ id="ccPatientDetails" editable="true" controller="#{opdBillController}"/> + + +
+ + +
+
+
- - -
From 8b4fe48cf04ac0126ef13c8120b0e2e7c7e9bc7c Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 21 Jul 2024 10:16:26 +0530 Subject: [PATCH 07/21] Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 3 +- .../ConfigOptionApplicationController.java | 31 ++++++++----------- .../cashier/initial_fund_bill_print.xhtml | 3 +- ...h_headings_for_shift_start_fund_bill.xhtml | 5 ++- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 3c5050cf64..62134d2230 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -36,7 +36,6 @@ import java.util.stream.Collectors; import javax.ejb.EJB; import javax.faces.event.AjaxBehaviorEvent; -import javax.faces.event.ValueChangeEvent; import javax.inject.Inject; import javax.persistence.TemporalType; import org.json.JSONArray; @@ -789,6 +788,8 @@ public String settleInitialFundBill() { p.serializeDenominations(); paymentController.save(p); } + currentBill.setPayments(currentBillPayments); + billController.save(currentBill); return "/cashier/initial_fund_bill_print?faces-redirect=true"; } diff --git a/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java b/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java index 8defc92dcd..03e23a4460 100644 --- a/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java +++ b/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java @@ -56,29 +56,18 @@ public void init() { private void initializeDenominations() { String denominationsStr = getLongTextValueByKey("Currency Denominations"); - if (denominationsStr != null && !denominationsStr.trim().isEmpty()) { - denominations = Arrays.stream(denominationsStr.split(",")) - .map(String::trim) // Trim any extra spaces - .filter(s -> !s.isEmpty()) // Filter out empty strings - .map(Integer::parseInt) - .map(value -> new Denomination(value, 0)) - .collect(Collectors.toList()); - } else { - denominations = new ArrayList<>(); // Initialize to an empty list if the string is null or empty + if (denominationsStr == null || !denominationsStr.trim().isEmpty()) { + denominationsStr = "1,2,5,10,20,50,100,500,1000,5000"; } - } - - public List getCurrencyDenominations() { - String denominationsStr = getLongTextValueByKey("Currency Denominations"); - return Arrays.stream(denominationsStr.split(",")) + denominations = Arrays.stream(denominationsStr.split(",")) + .map(String::trim) // Trim any extra spaces + .filter(s -> !s.isEmpty()) // Filter out empty strings .map(Integer::parseInt) + .map(value -> new Denomination(value, 0)) .collect(Collectors.toList()); } - public String getCurrencyDenominationsAsJson() { - List denominations = getCurrencyDenominations(); - return new JSONArray(denominations).toString(); - } + public void loadApplicationOptions() { applicationOptions = new HashMap<>(); @@ -111,6 +100,12 @@ public void saveOption(ConfigOption option) { } public List getDenominations() { + if (denominations == null) { + initializeDenominations(); + } + for(Denomination d:denominations){ + d.setCount(0); + } return denominations; } diff --git a/src/main/webapp/cashier/initial_fund_bill_print.xhtml b/src/main/webapp/cashier/initial_fund_bill_print.xhtml index e2c209d552..bce0b346d2 100644 --- a/src/main/webapp/cashier/initial_fund_bill_print.xhtml +++ b/src/main/webapp/cashier/initial_fund_bill_print.xhtml @@ -62,7 +62,8 @@
- +
diff --git a/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml b/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml index 68d291e083..a1923708e9 100644 --- a/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml +++ b/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml @@ -12,7 +12,6 @@ - @@ -122,14 +121,14 @@
- + From 5e686eddda4d3c93e966bb3d8e5a531809f04360 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 00:23:56 +0530 Subject: [PATCH 09/21] Signed-off-by: buddhika75 --- .../channel/BookingControllerViewScope.java | 2 +- .../bms5x5WIthoutHeaderChannelBill.xhtml | 2 +- .../webapp/resources/template/template.xhtml | 123 +++++++++++------- 3 files changed, 75 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java index 6c12efde21..af3728bd08 100644 --- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java +++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java @@ -424,7 +424,7 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si) } newBillSession.copy(bs); - newBillSession.setBill(bs.getBill()); + newBillSession.setBill(bs.getB hgill()); newBillSession.setBillItem(bs.getBillItem()); newBillSession.setReferenceBillSession(bs); newBillSession.setCreatedAt(new Date()); diff --git a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml index 914f8bd250..f84772bbf7 100644 --- a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml +++ b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml @@ -100,7 +100,7 @@ - + diff --git a/src/main/webapp/resources/template/template.xhtml b/src/main/webapp/resources/template/template.xhtml index 2a645063ca..5a7f1239a4 100644 --- a/src/main/webapp/resources/template/template.xhtml +++ b/src/main/webapp/resources/template/template.xhtml @@ -90,65 +90,88 @@ } - - - - - - - - - - + + + +
+
+ Important Notification +
+
+

Server has been migrated to a new location

+

Use this link afterwards:

+

https://lcd.carecode.org/

+

Click here to login.

+

Next time, type that URL. This page will not be accessible soon.

+

Call for details - 0715812399

+
+
+
+ + + + + + + + + + + + + + - - - -
-
-
-
|
-
-
-
-
-
+ -
-
- +
+
+
+
|
+
+
+
+
-
-
-
+ +
+
+ +
+
+
+
+
-
- - - - - - - + + + + + + + + + + + + - - + + - - - - +
+ +
-
- -
+ + From cac34cc79447b004f720883464833727d8153f44 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 00:24:44 +0530 Subject: [PATCH 10/21] Signed-off-by: buddhika75 --- .../channel/BookingControllerViewScope.java | 15 +++++++ .../ChannelStaffPaymentBillController.java | 21 ++++++---- .../bean/common/OpdTokenController.java | 4 +- src/main/webapp/cashier/deposit_funds.xhtml | 6 +-- .../webapp/cashier/fund_transfer_bill.xhtml | 20 +++++----- ...und_transfer_bills_for_me_to_receive.xhtml | 2 + .../webapp/cashier/fund_withdrawal_bill.xhtml | 7 ++-- .../webapp/cashier/initial_fund_bill.xhtml | 14 ++++--- .../cashier/shift_end_summery_bill.xhtml | 39 ++++++++++-------- .../channel/channel_booking_by_date.xhtml | 2 +- .../channel/channel_booking_by_month.xhtml | 2 +- src/main/webapp/channel/channel_queue.xhtml | 40 +++++++++---------- .../channel/manage_booking_by_date.xhtml | 10 ++--- .../channel/manage_booking_by_month.xhtml | 12 +++--- .../webapp/channel/session_instance.xhtml | 2 +- src/main/webapp/opd/token/opd_queue.xhtml | 2 +- src/main/webapp/payment_staff_bill.xhtml | 4 +- .../resources/ezcomp/bms5x5ChannelBill.xhtml | 1 + .../bms5x5WIthoutHeaderChannelBill.xhtml | 7 ++-- 19 files changed, 122 insertions(+), 88 deletions(-) diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java index e039985802..30fdf8a37a 100644 --- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java +++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java @@ -2884,6 +2884,21 @@ public boolean patientErrorPresent(Patient p) { JsfUtil.addErrorMessage("Please enter a name"); return true; } + + if (p.getPerson().getPhone() == null) { + JsfUtil.addErrorMessage("Please enter a phone number"); + return true; + } + + if (p.getPerson().getMobile()== null) { + JsfUtil.addErrorMessage("Please enter a mobile number"); + return true; + } + + if (p.getPerson().getArea()== null) { + JsfUtil.addErrorMessage("Please enter a area"); + return true; + } return false; } diff --git a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java index 706d98e93f..24dde24f05 100644 --- a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java +++ b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java @@ -343,7 +343,7 @@ public void debugDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " - + " and b.bill.singleBillSession.absent=false" +// + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.staff=:stf "; @@ -363,8 +363,12 @@ public void debugDueFees() { hm.put("ss", getSelectedServiceSession()); } - sql += " and b.bill.singleBillSession.absent=false " - + " order by b.bill.singleBillSession.serviceSession.sessionDate," +// sql += " and b.bill.singleBillSession.absent=false " +// + " order by b.bill.singleBillSession.serviceSession.sessionDate," +// + " b.bill.singleBillSession.serviceSession.sessionTime," +// + " b.bill.singleBillSession.serialNo "; + + sql += " order by b.bill.singleBillSession.serviceSession.sessionDate," + " b.bill.singleBillSession.serviceSession.sessionTime," + " b.bill.singleBillSession.serialNo "; @@ -445,7 +449,7 @@ public void calculateDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " - + " and b.bill.singleBillSession.absent=false" +// + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.staff=:stf "; @@ -465,8 +469,11 @@ public void calculateDueFees() { hm.put("ss", getSelectedServiceSession()); } - sql += " and b.bill.singleBillSession.absent=false " - + " order by b.bill.singleBillSession.serviceSession.sessionDate," +// sql += " and b.bill.singleBillSession.absent=false " +// + " order by b.bill.singleBillSession.serviceSession.sessionDate," +// + " b.bill.singleBillSession.serviceSession.sessionTime," +// + " b.bill.singleBillSession.serialNo "; + sql += " order by b.bill.singleBillSession.serviceSession.sessionDate," + " b.bill.singleBillSession.serviceSession.sessionTime," + " b.bill.singleBillSession.serialNo "; @@ -537,7 +544,7 @@ public void calculateSessionDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " - + " and b.bill.singleBillSession.absent=false" +// + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.bill.singleBillSession.sessionInstance=:si" diff --git a/src/main/java/com/divudi/bean/common/OpdTokenController.java b/src/main/java/com/divudi/bean/common/OpdTokenController.java index 0d66d69853..87315d5e42 100644 --- a/src/main/java/com/divudi/bean/common/OpdTokenController.java +++ b/src/main/java/com/divudi/bean/common/OpdTokenController.java @@ -356,13 +356,15 @@ public void fillOpdTokensCalled() { String j = "Select t " + " from Token t" + " where t.department=:dep" + + " and t.tokenDate=:date " + " and t.called=:cal " + " and t.tokenType=:ty" + " and t.inProgress=:prog " + " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed m.put("dep", sessionController.getDepartment()); + m.put("date", new Date()); m.put("cal", true); // Tokens that are called - m.put("prog", true); // Tokens that are not in progress + m.put("prog", false); // Tokens that are not in progress m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called m.put("com", false); // Tokens that are not completed j += " order by t.id"; diff --git a/src/main/webapp/cashier/deposit_funds.xhtml b/src/main/webapp/cashier/deposit_funds.xhtml index c95b1941af..b9cc21b820 100644 --- a/src/main/webapp/cashier/deposit_funds.xhtml +++ b/src/main/webapp/cashier/deposit_funds.xhtml @@ -8,11 +8,11 @@ xmlns:f="http://xmlns.jcp.org/jsf/core"> - + - + @@ -227,8 +227,8 @@ + - diff --git a/src/main/webapp/cashier/fund_transfer_bill.xhtml b/src/main/webapp/cashier/fund_transfer_bill.xhtml index c47d4987c9..3947369a53 100644 --- a/src/main/webapp/cashier/fund_transfer_bill.xhtml +++ b/src/main/webapp/cashier/fund_transfer_bill.xhtml @@ -8,13 +8,13 @@ xmlns:f="http://xmlns.jcp.org/jsf/core"> - - - - + + + + + - @@ -109,7 +109,7 @@ value="#{financialTransactionController.currentPayment.paidValue}" > - + - - - + + + + + diff --git a/src/main/webapp/cashier/fund_transfer_bills_for_me_to_receive.xhtml b/src/main/webapp/cashier/fund_transfer_bills_for_me_to_receive.xhtml index ea578d5724..67234068c2 100644 --- a/src/main/webapp/cashier/fund_transfer_bills_for_me_to_receive.xhtml +++ b/src/main/webapp/cashier/fund_transfer_bills_for_me_to_receive.xhtml @@ -10,6 +10,7 @@ +
@@ -67,6 +68,7 @@ + diff --git a/src/main/webapp/cashier/fund_withdrawal_bill.xhtml b/src/main/webapp/cashier/fund_withdrawal_bill.xhtml index d152e12c8d..5f69785923 100644 --- a/src/main/webapp/cashier/fund_withdrawal_bill.xhtml +++ b/src/main/webapp/cashier/fund_withdrawal_bill.xhtml @@ -8,11 +8,11 @@ xmlns:pa="http://xmlns.jcp.org/jsf/composite/paymentMethod"> - + - + @@ -168,8 +168,9 @@ + - + diff --git a/src/main/webapp/cashier/initial_fund_bill.xhtml b/src/main/webapp/cashier/initial_fund_bill.xhtml index f3b68abcae..cb67355dff 100644 --- a/src/main/webapp/cashier/initial_fund_bill.xhtml +++ b/src/main/webapp/cashier/initial_fund_bill.xhtml @@ -7,9 +7,10 @@ xmlns:prints="http://xmlns.jcp.org/jsf/composite/ezcomp/prints" xmlns:f="http://xmlns.jcp.org/jsf/core"> - - - + + + + @@ -230,8 +231,9 @@ - - - + + + + diff --git a/src/main/webapp/cashier/shift_end_summery_bill.xhtml b/src/main/webapp/cashier/shift_end_summery_bill.xhtml index 24c68b8c0a..2581daae4d 100644 --- a/src/main/webapp/cashier/shift_end_summery_bill.xhtml +++ b/src/main/webapp/cashier/shift_end_summery_bill.xhtml @@ -8,35 +8,40 @@ xmlns:ez="http://xmlns.jcp.org/jsf/composite/ezcomp"> - + -
- -
-
- - - -
-
- No Start Fund Bill Available to Close + + + +
+ +
+
+ + + +
+
+ No Start Fund Bill Available to Close +
-
- -
+ +
- - + + + + - + diff --git a/src/main/webapp/channel/channel_booking_by_date.xhtml b/src/main/webapp/channel/channel_booking_by_date.xhtml index f3492b6c31..742abba6b5 100644 --- a/src/main/webapp/channel/channel_booking_by_date.xhtml +++ b/src/main/webapp/channel/channel_booking_by_date.xhtml @@ -971,7 +971,7 @@
- + diff --git a/src/main/webapp/channel/channel_booking_by_month.xhtml b/src/main/webapp/channel/channel_booking_by_month.xhtml index c4ee972eeb..5231676350 100644 --- a/src/main/webapp/channel/channel_booking_by_month.xhtml +++ b/src/main/webapp/channel/channel_booking_by_month.xhtml @@ -1310,7 +1310,7 @@ - + diff --git a/src/main/webapp/channel/channel_queue.xhtml b/src/main/webapp/channel/channel_queue.xhtml index e018f672b9..190b0c6ac3 100644 --- a/src/main/webapp/channel/channel_queue.xhtml +++ b/src/main/webapp/channel/channel_queue.xhtml @@ -102,28 +102,24 @@
- - -
-
-
- -
-
-
- - - - - - -
-
-
-
+ +
+
+ + + + +
+
+ + + + +
+
diff --git a/src/main/webapp/channel/manage_booking_by_date.xhtml b/src/main/webapp/channel/manage_booking_by_date.xhtml index 8b6f78e3e6..012425a205 100644 --- a/src/main/webapp/channel/manage_booking_by_date.xhtml +++ b/src/main/webapp/channel/manage_booking_by_date.xhtml @@ -97,7 +97,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -1231,7 +1231,7 @@ - + @@ -1311,7 +1311,7 @@ - + diff --git a/src/main/webapp/channel/manage_booking_by_month.xhtml b/src/main/webapp/channel/manage_booking_by_month.xhtml index b21e72b603..093228d5fb 100644 --- a/src/main/webapp/channel/manage_booking_by_month.xhtml +++ b/src/main/webapp/channel/manage_booking_by_month.xhtml @@ -97,7 +97,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -297,7 +297,7 @@ - + @@ -1231,7 +1231,7 @@ - + @@ -1311,7 +1311,7 @@ - + diff --git a/src/main/webapp/channel/session_instance.xhtml b/src/main/webapp/channel/session_instance.xhtml index bcefacc0c3..3128ef5097 100644 --- a/src/main/webapp/channel/session_instance.xhtml +++ b/src/main/webapp/channel/session_instance.xhtml @@ -110,7 +110,7 @@
- +
diff --git a/src/main/webapp/opd/token/opd_queue.xhtml b/src/main/webapp/opd/token/opd_queue.xhtml index 7558b0bb7b..779ca690b3 100644 --- a/src/main/webapp/opd/token/opd_queue.xhtml +++ b/src/main/webapp/opd/token/opd_queue.xhtml @@ -105,7 +105,7 @@
- +
diff --git a/src/main/webapp/payment_staff_bill.xhtml b/src/main/webapp/payment_staff_bill.xhtml index 9e4c4199f4..d4dcd663bb 100644 --- a/src/main/webapp/payment_staff_bill.xhtml +++ b/src/main/webapp/payment_staff_bill.xhtml @@ -59,10 +59,10 @@ selection="#{staffPaymentBillController.payingBillFees}" class="w-100" rows="10" - paginator="false" paginatorPosition="bottom" + paginator="true" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" - rowsPerPageTemplate="5,10,{ShowAll|'All'}" + rowsPerPageTemplate="{ShowAll|'All'}" var="bf" rowKey="#{bf.id}" > + diff --git a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml index 2bcf42de5c..8f5a7c375e 100644 --- a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml +++ b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml @@ -15,6 +15,7 @@ /> + @@ -96,11 +97,11 @@
From 4759c8564f5bef02a68e607ad9cdf673e06be0c1 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 00:34:53 +0530 Subject: [PATCH 11/21] Signed-off-by: buddhika75 --- .../java/com/divudi/data/Denomination.java | 6 +- src/main/java/com/divudi/entity/Payment.java | 20 +- .../resources/css/fund_bill_five_five.css | 426 ++++-------------- ...h_headings_for_shift_start_fund_bill.xhtml | 144 +++--- 4 files changed, 181 insertions(+), 415 deletions(-) diff --git a/src/main/java/com/divudi/data/Denomination.java b/src/main/java/com/divudi/data/Denomination.java index 1dcf19c60a..932882b2e0 100644 --- a/src/main/java/com/divudi/data/Denomination.java +++ b/src/main/java/com/divudi/data/Denomination.java @@ -5,7 +5,7 @@ * @author buddhika */ public class Denomination { - private int value; + private double value; private int count; public Denomination() {} @@ -15,11 +15,11 @@ public Denomination(int value, int count) { this.count = count; } - public int getValue() { + public double getValue() { return value; } - public void setValue(int value) { + public void setValue(double value) { this.value = value; } diff --git a/src/main/java/com/divudi/entity/Payment.java b/src/main/java/com/divudi/entity/Payment.java index 9240ddc60a..a96a83d636 100644 --- a/src/main/java/com/divudi/entity/Payment.java +++ b/src/main/java/com/divudi/entity/Payment.java @@ -99,10 +99,9 @@ public class Payment implements Serializable { @ManyToOne Department department; - @Transient private List currencyDenominations; - + @Transient private List humanReadableDenominations; @@ -113,14 +112,19 @@ public Long getId() { public void setId(Long id) { this.id = id; } - + public List getHumanReadableDenominations() { List humanReadableList = new ArrayList<>(); deserializeDenominations(); if (this.currencyDenominations != null) { for (Denomination denomination : this.currencyDenominations) { - String humanReadable = "Denomination: " + denomination.getValue() + ", Count: " + denomination.getCount() + ", Value: " + (denomination.getValue() * denomination.getCount()); - humanReadableList.add(humanReadable); + if (denomination.getCount() > 0) { + String valueFormatted = String.format("%.2f", denomination.getValue()); + String countFormatted = String.format("%d", denomination.getCount()); + String totalFormatted = String.format("%.2f", denomination.getValue() * denomination.getCount()); + String humanReadable = "(" + valueFormatted + "x" + countFormatted + "=" + totalFormatted + ")"; + humanReadableList.add(humanReadable); + } } } return humanReadableList; @@ -389,8 +393,6 @@ public void serializeDenominations() { this.currencyDenominationsJson = "[]"; // Empty JSON array if currencyDenominations is null } } - - public void deserializeDenominations() { if (this.currencyDenominationsJson != null && !this.currencyDenominationsJson.isEmpty()) { @@ -414,7 +416,6 @@ public void deserializeDenominations() { } } - public String getCurrencyDenominationsJson() { return currencyDenominationsJson; } @@ -426,6 +427,5 @@ public List getCurrencyDenominations() { public void setCurrencyDenominations(List currencyDenominations) { this.currencyDenominations = currencyDenominations; } - - + } diff --git a/src/main/webapp/resources/css/fund_bill_five_five.css b/src/main/webapp/resources/css/fund_bill_five_five.css index 1822e2547d..9e585921c1 100644 --- a/src/main/webapp/resources/css/fund_bill_five_five.css +++ b/src/main/webapp/resources/css/fund_bill_five_five.css @@ -1,371 +1,129 @@ -@media print{ - .posbill{ - position: relative!important; - margin-top: -2cm!important; - width: 100%; - padding: 0px!important; - margin: 0px!important; - border: none!important; - font-family:Arial, Helvetica, sans-serif!important; - /* font:*/ - font-size: 11px!important; - /* text-transform: uppercase!important;*/ - - +@media print { + .fiveinchbill { + position: relative !important; + padding: 5px !important; + width: 12cm !important; + height: 14cm !important; + font-family: sans-serif !important; + font-size: 11px !important; + margin: auto !important; + background-size: 100% auto !important; + text-transform: capitalize !important; + page-break-after: always !important; + } + + .institutionName { + text-align: center !important; + font-weight: bold !important; + font-size: 16px !important; + font-family: monospace; + text-transform: capitalize !important; } - .fiveinchbill{ - position: relative!important; - padding: 5px!important; - width: 12cm!important; - height: 14cm!important; - - font-family: sans-serif!important; - font-size: 11px!important; - margin: auto!important; - background-size: 100% auto!important; - /* border: 1px solid!important;*/ - font-size: 130%; - text-transform: capitalize!important; - + .institutionContact { + text-align: center !important; + font-size: 12px !important; + font-family: monospace; } - .channelRecipt_24_2x9_3{ - position: relative!important; - padding: 5px!important; - width: 24.2cm!important; - height: 9.3cm!important; - - font-family: sans-serif!important; - margin: auto!important; - background-size: 100% auto!important; - /* border: 1px solid!important;*/ - text-transform: capitalize!important; - } - - .channelCoop{ - - border: 1px solid!important; - padding: 5px!important; - width: 12cm!important; - height: 9.5cm!important; - - margin: auto!important; + .billDetailsFiveFive { + font-size: 12px !important; + font-family: Arial, Helvetica, sans-serif !important; } - .posbillBreak{ - position: relative!important; - margin-top: -2cm!important; - width: 100%; - padding: 0px!important; - margin: 0px!important; - border: none!important; - font-family:Arial, Helvetica, sans-serif!important; - /* font:*/ - font-size: 11px!important; - /* text-transform: uppercase!important;*/ - page-break-after:always!important; - + .headingBillFiveFive { + text-align: center !important; + font-weight: bold !important; + font-size: 16px !important; } - /* .billDetails{ - text-align: center!important; - font-size: 9px!important; - font-family:Arial, Helvetica, sans-serif!important; - }*/ - - .a4bill{ - page-break-after:always!important; - font-family: sans-serif!important; - font-size: 11px!important; - position: relative!important; - margin: 0px!important; - width: 95%; - height: 95%; - padding: 0px; - font-size: 100%; - + .itemHeadingsFiveFive { + font-size: 13px !important; + font-family: Verdana, Helvetica, sans-serif !important; + font-weight: bold; } - .institutionName{ - text-align: center!important; - font-weight: bold!important; - font-size: 16px!important; - font-weight: bolder; - font-family: monospace; - text-transform: capitalize!important; - + .itemsBlockRightFiveFive { + text-align: right !important; + font-size: 12px !important; + font-family: Arial, Helvetica, sans-serif !important; + text-transform: capitalize !important; + padding-right: 30px; } - .institutionContact{ - position: relative!important; - text-align: center!important; - font-size: 12px!important; - font-family:monospace; + .totalsBlock { + font-size: 14px !important; + font-family: Verdana, Helvetica, sans-serif !important; } - .billDetails{ - text-align: center!important; - font-size: 12px!important; - font-family:Arial, Helvetica, sans-serif!important; - } - .channelNumber{ - font-size: 50px!important; + .billline { + text-align: center !important; + overflow: hidden; + padding: 0px; } - } - -@media screen{ - .fiveinchbill{ - position: relative!important; - padding: 5px!important; - width: 12cm!important; - height: 14cm!important; +@media screen { + .fiveinchbill { + position: relative !important; + padding: 5px !important; + width: 12cm !important; + height: 14cm !important; border: 1px solid; - - font-family: sans-serif!important; - /*margin: auto!important;*/ - background-size: 100% auto!important; + font-family: sans-serif !important; + background-size: 100% auto !important; background-color: lightgray; - /* border: 1px solid!important;*/ - font-size: 100%!important; - text-transform: capitalize!important; - margin: 2cm!important; - + text-transform: capitalize !important; + margin: 2cm !important; } - .posbill{ - position: relative!important; - - width:400px!important; - - font-family: monospace!important; - margin: auto!important; - background-size: 100% auto!important; - border: 1px solid!important; - font-size: 100%; - - font-size: 11px!important; - page-break-after:always!important; - } - - .posbillBreak{ - position: relative!important; - - width:400px!important; - - font-family: monospace!important; - margin: auto!important; - background-size: 100% auto!important; - border: 1px solid!important; - font-size: 100%; - - font-size: 11px!important; - page-break-after:always!important; + .institutionName { + text-align: center !important; + font-weight: bold !important; + font-size: 16px !important; + font-family: monospace; + text-transform: capitalize !important; } - .channelRecipt_24_2x9_3{ - position: relative!important; - padding: 5px!important; - width: 24.2cm!important; - height: 9.3cm!important; - - font-family: sans-serif!important; - margin: auto!important; - background-size: 100% auto!important; - border: 1px solid!important; - text-transform: capitalize!important; + .institutionContact { + text-align: center !important; + font-size: 12px !important; + font-family: monospace; } - .channelCoop{ - position: relative!important; - - font-family: sans-serif!important; - border: 1px solid!important; - padding: 5px!important; - width: 12cm!important; - height: 9.5cm!important; - - margin: auto!important; - background-size: 100% auto!important; + .billDetailsFiveFive { + font-size: 12px !important; + font-family: Arial, Helvetica, sans-serif !important; } - .posbillBreak{ - position: relative!important; - - width:400px!important; - - font-family: monospace!important; - margin: auto!important; - background-size: 100% auto!important; - border: 1px solid!important; - font-size: 100%; - - font-size: 11px!important; - page-break-after:always!important; - + .headingBillFiveFive { + text-align: center !important; + font-weight: bold !important; + font-size: 16px !important; } - .a4bill{ - - font-family: sans-serif!important; - font-size: 11px!important; - position: relative!important; - margin: 0px!important; - width: 95%; - height: 95%; - padding: 0px; - font-size: 100%; + .itemHeadingsFiveFive { + font-size: 13px !important; + font-family: Verdana, Helvetica, sans-serif !important; + font-weight: bold; } - - .institutionName{ - text-align: center!important; - font-weight: bold!important; - font-size: 16px!important; - font-weight: bolder; - font-family: monospace; - + .itemsBlockRightFiveFive { + text-align: right !important; + font-size: 12px !important; + font-family: Arial, Helvetica, sans-serif !important; + text-transform: capitalize !important; + padding-right: 30px; } - .institutionContact{ - position: relative!important; - text-align: center!important; - font-size: 12px!important; - font-family:monospace; + .totalsBlock { + font-size: 14px !important; + font-family: Verdana, Helvetica, sans-serif !important; } - .billDetails{ - text-align: center!important; - font-size: 12px!important; - font-family:Arial, Helvetica, sans-serif!important; + .billline { + text-align: center !important; + overflow: hidden; + padding: 0px; } - -} - - - -.institutionContact{ - position: relative!important; - text-align: center!important; - font-size: 12px!important; - font-family:monospace; } - -.billDetails{ - text-align: center!important; - font-size: 12px!important; - font-family:Arial, Helvetica, sans-serif!important; -} - -.billDetailsFiveFiveBHT{ - text-align: center!important; - font-size: 10px!important; - font-family:Arial, Helvetica, sans-serif!important; -} - - -.headingBillFiveFiveBHT{ - text-align: center!important; - font-weight: bold!important; - font-size: 12px!important; - font-weight: bold; -} - -.billDetailsFiveFive{ - font-size: 14px!important; - font-family:verdana, Helvetica, sans-serif!important; -} - -.itemHeadings{ - text-align: center!important; - font-size: 13px!important; - font-family:Arial, Helvetica, sans-serif!important; - font-weight: bold; -} - -.itemHeadingsFiveFive{ - - font-size: 15px!important; - font-family:verdana, Helvetica, sans-serif!important; - font-weight: bold; -} - -.itemsBlock{ - text-align: center!important; - font-size: 13px!important; - font-family:verdana, Helvetica, sans-serif!important; - text-transform: capitalize!important; -} - - -itemsBlockRight{ - text-align: right!important; - font-size: 13px!important; - font-family:verdana, Helvetica, sans-serif!important; - text-transform: capitalize!important; - padding-right: 30px; -} - - -.itemsBlockRightFiveFive{ - text-align: right!important; - font-size: 12px!important; - font-family:Arial, Helvetica, sans-serif!important; - text-transform: capitalize!important; - padding-right: 30px; -} -.footer{ - text-align: center!important; - font-size: 12px!important; - font-family: monospace; - -} - -.billline{ - text-align: center!important; - overflow: hidden; - padding: 0px; -} - -.bhtNoPharmacy{ - position: absolute; - margin-top: 50px; - margin-right: 30px; -} - -.headingBill{ - text-align: center!important; - font-weight: bold!important; - font-size: 12px!important; - font-weight: bold; -} - -.headingBillFiveFive{ - text-align: center!important; - font-weight: bold!important; - font-size: 18px!important; - font-weight: bold; -} - -.poDetail{ - font-size: 11px!important; - font-family: sans; - min-width: 100%!important; -} - -.totalsBlock{ - font-size: 15px!important; - font-family:Verdana, Helvetica, sans-serif!important; -} - -.totalsItemBlock{ - font-size: 14px!important; - font-family:Arial, Helvetica, sans-serif!important; -} - -.totalsBlockFiveFiveNo{ - font-size: 10px!important; - font-family:Arial, Helvetica, sans-serif!important; -} \ No newline at end of file diff --git a/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml b/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml index a1923708e9..3aafdb0fa7 100644 --- a/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml +++ b/src/main/webapp/resources/ezcomp/prints/five_five_paper_with_headings_for_shift_start_fund_bill.xhtml @@ -7,156 +7,164 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui"> - - - - - - -
+
-
+
-
+
-
- +
+
- - - + + +
-
+
-
-
- + From 2620457294a34b37f0424adb6e8556cb10a34539 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 21 Jul 2024 14:32:41 +0530 Subject: [PATCH 08/21] Signed-off-by: buddhika75 --- .../channel/BookingControllerViewScope.java | 42 +++++++++++-------- .../ChannelStaffPaymentBillController.java | 8 +++- .../com/divudi/ejb/ServiceSessionBean.java | 16 +++++-- .../channel_payment_session_by_dates.xhtml | 2 +- .../channel/channel_payment_staff_bill.xhtml | 2 +- .../channel/manage_booking_by_date.xhtml | 2 +- src/main/webapp/opd/opd_bill.xhtml | 2 +- src/main/webapp/payment_staff_bill.xhtml | 2 +- .../resources/ezcomp/bms5x5ChannelBill.xhtml | 2 +- .../bms5x5WIthoutHeaderChannelBill.xhtml | 6 +-- 10 files changed, 51 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java index ce88d159ed..97ab698452 100644 --- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java +++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java @@ -498,48 +498,50 @@ private Bill createBillForChannelReshedule(BillSession bs) { bill.setPatient(bs.getBill().getPatient()); switch (bs.getBill().getPaymentMethod()) { case OnCall: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); + bill.setBillType(BillType.ChannelOnCall); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); break; case Cash: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); + bill.setBillType(BillType.ChannelCash); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; case Card: - bill.setBillType(BillType.ChannelResheduleWithPayment); + bill.setBillType(BillType.ChannelCash); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; case Cheque: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); - bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); + bill.setBillType(BillType.ChannelCash); + bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; case Slip: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); - bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); + bill.setBillType(BillType.ChannelCash); + bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; case Agent: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); - bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); + bill.setBillType(BillType.ChannelAgent); + bill.setCreditCompany(institution); + bill.setAgentRefNo(agentRefNo); + bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; case Staff: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); + bill.setBillType(BillType.ChannelStaff); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); break; case Credit: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); + bill.setBillType(BillType.ChannelCredit); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); break; case OnlineSettlement: - bill.setBillType(BillType.ChannelResheduleWithOutPayment); - bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT); + bill.setBillType(BillType.ChannelCash); + bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_BOOKING_WITH_PAYMENT_ONLINE); break; case MultiplePaymentMethods: - bill.setBillType(BillType.ChannelResheduleWithPayment); + bill.setBillType(BillType.ChannelCash); bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT); break; } @@ -551,7 +553,7 @@ private Bill createBillForChannelReshedule(BillSession bs) { bill.setDeptId(deptId); bill.setInsId(deptId); - bill.setPaidAmount(getSelectedSessionInstanceForRechedule().getOriginatingSession().getTotal()); + bill.setPaidAmount(bs.getBill().getPaidAmount()); bill.setPaidAt(new Date()); bill.setBillDate(new Date()); @@ -574,7 +576,7 @@ private Bill createBillForChannelReshedule(BillSession bs) { } return bill; } - + private BillItem createSessionItemForReshedule(Bill bill) { BillItem bi = new BillItem(); bi.setAdjustedValue(0.0); @@ -4303,7 +4305,9 @@ public void fillBillSessions() { BillType.ChannelCash, BillType.ChannelOnCall, BillType.ChannelStaff, - BillType.ChannelCredit + BillType.ChannelCredit, + BillType.ChannelResheduleWithPayment, + BillType.ChannelResheduleWithOutPayment }; List bts = Arrays.asList(billTypes); String sql = "Select bs " @@ -4412,7 +4416,9 @@ public void fillBillSessions(SessionInstance s) { BillType.ChannelCash, BillType.ChannelOnCall, BillType.ChannelStaff, - BillType.ChannelCredit + BillType.ChannelCredit, + BillType.ChannelResheduleWithPayment, + BillType.ChannelResheduleWithOutPayment }; List bts = Arrays.asList(billTypes); String sql = "Select bs " diff --git a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java index 980a811adb..706d98e93f 100644 --- a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java +++ b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java @@ -540,11 +540,13 @@ public void calculateSessionDueFees() { + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " - + " and b.bill.singleBillSession.sessionInstance=:si"; + + " and b.bill.singleBillSession.sessionInstance=:si" + + " and b.bill.singleBillSession.completed=:com"; sql += " order by b.bill.singleBillSession.serialNo "; hm.put("si", getSessionInstance()); hm.put("bt", bts); hm.put("ftp", FeeType.Staff); + hm.put("com", true); hm.put("class", BilledBill.class); dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP); @@ -594,11 +596,13 @@ public void calculateSessionAllFees() { // + " and b.bill.singleBillSession.absent=false" // + " and (b.feeValue - b.paidValue) > 0 " // + " and b.bill.billType in :bt " - + " and b.bill.singleBillSession.sessionInstance=:si"; + + " and b.bill.singleBillSession.sessionInstance=:si" + + " and b.bill.singleBillSession.completed=:com"; sql += " order by b.bill.singleBillSession.serialNo "; hm.put("si", getSessionInstance()); // hm.put("bt", bts); hm.put("ftp", FeeType.Staff); + hm.put("com", true); hm.put("class", BilledBill.class); dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP); diff --git a/src/main/java/com/divudi/ejb/ServiceSessionBean.java b/src/main/java/com/divudi/ejb/ServiceSessionBean.java index 978b863740..cd00e5a242 100644 --- a/src/main/java/com/divudi/ejb/ServiceSessionBean.java +++ b/src/main/java/com/divudi/ejb/ServiceSessionBean.java @@ -215,7 +215,9 @@ public int getSessionNumber(ServiceSession serviceSession, Date sessionDate) { BillType.ChannelOnCall, BillType.ChannelStaff, BillType.ClinicalOpdBooking, - BillType.ChannelCredit + BillType.ChannelCredit, + BillType.ChannelResheduleWithOutPayment, + BillType.ChannelResheduleWithPayment }; List bts = Arrays.asList(billTypes); @@ -257,7 +259,9 @@ public int getSessionNumber(ServiceSession serviceSession, Date sessionDate, Bil BillType.ChannelCash, BillType.ChannelOnCall, BillType.ChannelStaff, - BillType.ChannelCredit}; + BillType.ChannelCredit, + BillType.ChannelResheduleWithOutPayment, + BillType.ChannelResheduleWithPayment}; List bts = Arrays.asList(billTypes); String sql = "Select bs From BillSession bs where " @@ -321,7 +325,9 @@ public Integer getNextNonReservedSerialNumber(SessionInstance si, List BillType.ChannelCash, BillType.ChannelOnCall, BillType.ChannelStaff, - BillType.ChannelCredit + BillType.ChannelCredit, + BillType.ChannelResheduleWithOutPayment, + BillType.ChannelResheduleWithPayment }; List bts = Arrays.asList(billTypes); @@ -360,7 +366,9 @@ public Integer getNextAvailableReservedNumber(SessionInstance si, List BillType.ChannelCash, BillType.ChannelOnCall, BillType.ChannelStaff, - BillType.ChannelCredit + BillType.ChannelCredit, + BillType.ChannelResheduleWithOutPayment, + BillType.ChannelResheduleWithPayment }; List bts = Arrays.asList(billTypes); diff --git a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml index cea9454aaa..329acdc195 100644 --- a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml +++ b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml @@ -106,7 +106,7 @@ value="#{channelStaffPaymentBillController.dueBillFees}" selection="#{channelStaffPaymentBillController.payingBillFees}" rowIndexVar="i" var="bf" rowKey="#{bf.id}" - paginator="true" paginatorPosition="bottom" + paginator="false" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="{ShowAll|'All'}" diff --git a/src/main/webapp/channel/channel_payment_staff_bill.xhtml b/src/main/webapp/channel/channel_payment_staff_bill.xhtml index 51e8c6abce..e4631ad071 100644 --- a/src/main/webapp/channel/channel_payment_staff_bill.xhtml +++ b/src/main/webapp/channel/channel_payment_staff_bill.xhtml @@ -150,7 +150,7 @@ selection="#{channelStaffPaymentBillController.payingBillFees}" rowIndexVar="i" var="bf" rowKey="#{bf.id}" rows="10" - paginator="true" paginatorPosition="bottom" + paginator="false" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="5,10,{ShowAll|'All'}" diff --git a/src/main/webapp/channel/manage_booking_by_date.xhtml b/src/main/webapp/channel/manage_booking_by_date.xhtml index 67016b63bb..ec8bb314ff 100644 --- a/src/main/webapp/channel/manage_booking_by_date.xhtml +++ b/src/main/webapp/channel/manage_booking_by_date.xhtml @@ -880,7 +880,7 @@ - + diff --git a/src/main/webapp/opd/opd_bill.xhtml b/src/main/webapp/opd/opd_bill.xhtml index 5cbc391662..34f354e07a 100644 --- a/src/main/webapp/opd/opd_bill.xhtml +++ b/src/main/webapp/opd/opd_bill.xhtml @@ -275,7 +275,7 @@ - + diff --git a/src/main/webapp/payment_staff_bill.xhtml b/src/main/webapp/payment_staff_bill.xhtml index 341f3550b5..9e4c4199f4 100644 --- a/src/main/webapp/payment_staff_bill.xhtml +++ b/src/main/webapp/payment_staff_bill.xhtml @@ -59,7 +59,7 @@ selection="#{staffPaymentBillController.payingBillFees}" class="w-100" rows="10" - paginator="true" paginatorPosition="bottom" + paginator="false" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="5,10,{ShowAll|'All'}" diff --git a/src/main/webapp/resources/ezcomp/bms5x5ChannelBill.xhtml b/src/main/webapp/resources/ezcomp/bms5x5ChannelBill.xhtml index f515d5a8ba..7eb2c46126 100644 --- a/src/main/webapp/resources/ezcomp/bms5x5ChannelBill.xhtml +++ b/src/main/webapp/resources/ezcomp/bms5x5ChannelBill.xhtml @@ -100,7 +100,7 @@ - + diff --git a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml index 914f8bd250..2bcf42de5c 100644 --- a/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml +++ b/src/main/webapp/resources/ezcomp/bms5x5WIthoutHeaderChannelBill.xhtml @@ -96,11 +96,11 @@ - + - + @@ -122,7 +122,7 @@ - + - + - + @@ -122,7 +123,7 @@ - +
+
+
- - + - - + - - - - + - - + -
- + + :: - - - + - - - + : - +
- + + :: - - - + - + - - : - +
- +
-
- +
+
-
- - - +
+
+ - - +
- - + + - - - - + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
-

-
- +
- - @@ -170,4 +178,4 @@ - \ No newline at end of file + From 6790c478d0d89f8616e432d2d922bcde60c97fdc Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 01:15:32 +0530 Subject: [PATCH 12/21] CLoses #6504 --- .../channel/BookingControllerViewScope.java | 2 +- .../bean/common/OpdTokenController.java | 79 ++++- src/main/java/com/divudi/data/TokenCount.java | 49 +++ src/main/resources/META-INF/persistence.xml | 4 +- src/main/webapp/opd/token/index.xhtml | 7 + .../webapp/opd/token/opd_tokens_waiting.xhtml | 314 ++++++++++++++++++ .../webapp/resources/template/template.xhtml | 4 +- 7 files changed, 449 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/divudi/data/TokenCount.java create mode 100644 src/main/webapp/opd/token/opd_tokens_waiting.xhtml diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java index af3728bd08..6c12efde21 100644 --- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java +++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java @@ -424,7 +424,7 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si) } newBillSession.copy(bs); - newBillSession.setBill(bs.getB hgill()); + newBillSession.setBill(bs.getBill()); newBillSession.setBillItem(bs.getBillItem()); newBillSession.setReferenceBillSession(bs); newBillSession.setCreatedAt(new Date()); diff --git a/src/main/java/com/divudi/bean/common/OpdTokenController.java b/src/main/java/com/divudi/bean/common/OpdTokenController.java index 87315d5e42..09891aa7d6 100644 --- a/src/main/java/com/divudi/bean/common/OpdTokenController.java +++ b/src/main/java/com/divudi/bean/common/OpdTokenController.java @@ -10,6 +10,7 @@ import com.divudi.bean.pharmacy.PharmacyPreSettleController; import com.divudi.bean.pharmacy.PharmacySaleController; import com.divudi.data.PaymentMethod; +import com.divudi.data.TokenCount; import com.divudi.data.TokenType; import com.divudi.ejb.BillNumberGenerator; import com.divudi.entity.Bill; @@ -88,6 +89,7 @@ public class OpdTokenController implements Serializable, ControllerWithPatient { private Staff staff; private Bill bill; private boolean patientDetailsEditable; + private List tokenCounts; private boolean printPreview; @@ -351,6 +353,12 @@ public String navigateToManageOpdTokensCalled() { return "/opd/token/opd_tokens_called?faces-redirect=true"; // Adjust the navigation string as per your page structure } + public String navigateToManageOpdTokensWaiting() { + fillOpdTokensWaiting(); + fillOpdWaitingTokensCounts(); + return "/opd/token/opd_tokens_waiting?faces-redirect=true"; // Adjust the navigation string as per your page structure + } + public void fillOpdTokensCalled() { Map m = new HashMap<>(); String j = "Select t " @@ -371,6 +379,58 @@ public void fillOpdTokensCalled() { currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE); //System.out.println("currentTokens = " + currentTokens); } + + public void fillOpdWaitingTokensCounts() { + Map m = new HashMap<>(); + String j = "Select new com.divudi.data.TokenCount(t.counter, t.staff, count(t)) " + + " from Token t" + + " where t.department=:dep" + + " and t.tokenDate=:date " + + " and t.called=:cal " + + " and t.tokenType=:ty" + + " and t.inProgress=:prog " + + " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed + + boolean testing = false; + if(testing){ + Token t=new Token(); + t.getCounter(); + t.getStaff(); + + } + + m.put("dep", sessionController.getDepartment()); + m.put("date", new Date()); + m.put("cal", false); // Tokens that are called + m.put("prog", false); // Tokens that are not in progress + m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called + m.put("com", false); // Tokens that are not completed + j += " order by t.id"; + currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE); + tokenCounts = (List) tokenFacade.findLightsByJpql(j, m); + //System.out.println("currentTokens = " + currentTokens); + } + + public void fillOpdTokensWaiting() { + Map m = new HashMap<>(); + String j = "Select t " + + " from Token t" + + " where t.department=:dep" + + " and t.tokenDate=:date " + + " and t.called=:cal " + + " and t.tokenType=:ty" + + " and t.inProgress=:prog " + + " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed + m.put("dep", sessionController.getDepartment()); + m.put("date", new Date()); + m.put("cal", false); // Tokens that are called + m.put("prog", false); // Tokens that are not in progress + m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called + m.put("com", false); // Tokens that are not completed + j += " order by t.id"; + currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE); + //System.out.println("currentTokens = " + currentTokens); + } public String navigateToTokenIndex() { Boolean opdBillingAfterShiftStart = sessionController.getApplicationPreference().isOpdBillingAftershiftStart(); @@ -448,10 +508,10 @@ public void recallToken() { JsfUtil.addErrorMessage("Please select valid Token"); return; } - + if (currentToken.isCalled()) { currentToken.setCalled(false); - }else{ + } else { currentToken.setCalled(true); } tokenFacade.edit(currentToken); @@ -460,13 +520,12 @@ public void recallToken() { // public void restartTokenService() { // // } - public void reverseCompleteTokenService() { - if (currentToken==null) { + if (currentToken == null) { JsfUtil.addErrorMessage("Token Is Not Valid !"); return; } - currentToken.setRestartTokenServices(true); + currentToken.setRestartTokenServices(true); currentToken.setCompleted(false); tokenFacade.edit(currentToken); } @@ -582,6 +641,8 @@ public Doctor getDoctor() { return doctor; } + + public void setDoctor(Doctor doctor) { this.doctor = doctor; } @@ -610,4 +671,12 @@ public void setBill(Bill bill) { this.bill = bill; } + public List getTokenCounts() { + return tokenCounts; + } + + public void setTokenCounts(List tokenCounts) { + this.tokenCounts = tokenCounts; + } + } diff --git a/src/main/java/com/divudi/data/TokenCount.java b/src/main/java/com/divudi/data/TokenCount.java new file mode 100644 index 0000000000..c6e1616926 --- /dev/null +++ b/src/main/java/com/divudi/data/TokenCount.java @@ -0,0 +1,49 @@ +package com.divudi.data; + +import com.divudi.entity.Department; +import com.divudi.entity.Staff; + +public class TokenCount { + private Department department; + private Long tokenCount; + private Staff staff; + + public TokenCount() { + } + + public TokenCount(Department department, Staff staff, Long tokenCount) { + this.department = department; + this.tokenCount = tokenCount; + this.staff = staff; + } + + + + public Department getDepartment() { + return department; + } + + public void setDepartment(Department department) { + this.department = department; + } + + public Long getTokenCount() { + return tokenCount; + } + + public void setTokenCount(Long tokenCount) { + this.tokenCount = tokenCount; + } + + public Staff getStaff() { + return staff; + } + + public void setStaff(Staff staff) { + this.staff = staff; + } + + + + +} diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 42fe5625f4..e7d5b37cc4 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,14 +2,14 @@ - jdbc/hims + jdbc/demos false - jdbc/himsAduit + jdbc/demoaudit false diff --git a/src/main/webapp/opd/token/index.xhtml b/src/main/webapp/opd/token/index.xhtml index 8ccc6716cc..58806b6031 100644 --- a/src/main/webapp/opd/token/index.xhtml +++ b/src/main/webapp/opd/token/index.xhtml @@ -31,6 +31,13 @@ action="#{opdTokenController.navigateToManageOpdTokensCalled()}" > + + + + + + OPD Token Board + + + + + + + + + + +
+ + + #{tokenCounts.department.name} + #{tokenCounts.staff.person.nameWithTitle} + #{tokenCounts.tokenCount} + + + + + +
+
+
+
+
+

#{token.counter.name}

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+

#{token.staff.person.nameWithTitle}

+
+
+
+
+ + +
+
+
+
+
+ + + + + + +
+ + + + +
+ diff --git a/src/main/webapp/resources/template/template.xhtml b/src/main/webapp/resources/template/template.xhtml index 5a7f1239a4..6042b4f9a6 100644 --- a/src/main/webapp/resources/template/template.xhtml +++ b/src/main/webapp/resources/template/template.xhtml @@ -92,7 +92,7 @@ - +
Important Notification @@ -109,7 +109,7 @@ - + From 4c0db6225a642b3c3df008c05bf0e1ea9f8a06bb Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 01:17:12 +0530 Subject: [PATCH 13/21] Signed-off-by: buddhika75 --- src/main/java/com/divudi/bean/common/OpdTokenController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/divudi/bean/common/OpdTokenController.java b/src/main/java/com/divudi/bean/common/OpdTokenController.java index 09891aa7d6..60cbd520ab 100644 --- a/src/main/java/com/divudi/bean/common/OpdTokenController.java +++ b/src/main/java/com/divudi/bean/common/OpdTokenController.java @@ -405,7 +405,7 @@ public void fillOpdWaitingTokensCounts() { m.put("prog", false); // Tokens that are not in progress m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called m.put("com", false); // Tokens that are not completed - j += " order by t.id"; + j += " group by t.counter, t.staff"; currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE); tokenCounts = (List) tokenFacade.findLightsByJpql(j, m); //System.out.println("currentTokens = " + currentTokens); From 123b5c6c2c313371f941c6d137f6b1f18ffe629c Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 01:21:27 +0530 Subject: [PATCH 14/21] Signed-off-by: buddhika75 --- .../webapp/opd/token/opd_tokens_waiting.xhtml | 75 +++---------------- 1 file changed, 10 insertions(+), 65 deletions(-) diff --git a/src/main/webapp/opd/token/opd_tokens_waiting.xhtml b/src/main/webapp/opd/token/opd_tokens_waiting.xhtml index aeaee62007..432d2dd4d1 100644 --- a/src/main/webapp/opd/token/opd_tokens_waiting.xhtml +++ b/src/main/webapp/opd/token/opd_tokens_waiting.xhtml @@ -178,74 +178,19 @@
+ +

dfsdfsd

+ - #{tokenCounts.department.name} - #{tokenCounts.staff.person.nameWithTitle} - #{tokenCounts.tokenCount} + + + + + + - - - -
-
-
-
-
-

#{token.counter.name}

-
-
-
-
-
-
-
-
- -
-
-
-
-
- - - - - - - - -
-
-
- -
-
-
-
-
- -
-
-
-
-
-

#{token.staff.person.nameWithTitle}

-
-
-
-
- - -
-
-
-
+
From 12abeeb833e643760f5cb67fd17b9da2663ad315 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 03:16:14 +0530 Subject: [PATCH 15/21] Closes #6505 Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 548 +++++++++++++++--- .../bean/channel/ChannelBillController.java | 1 + .../ChannelStaffPaymentBillController.java | 77 ++- src/main/resources/META-INF/persistence.xml | 4 +- .../channel_payment_session_by_dates.xhtml | 106 ++-- 5 files changed, 558 insertions(+), 178 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 87d4323acf..5e2f98a257 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -1,10 +1,9 @@ package com.divudi.bean.cashTransaction; -// import java.util.HashMap; -// import com.divudi.bean.common.BillController; import com.divudi.bean.common.BillSearch; +import com.divudi.bean.common.ConfigOptionApplicationController; import com.divudi.bean.common.SearchController; import com.divudi.bean.common.SessionController; import com.divudi.data.BillClassType; @@ -16,27 +15,32 @@ import com.divudi.bean.common.util.JsfUtil; import com.divudi.data.AtomicBillTypeTotals; import com.divudi.data.BillFinanceType; -import static com.divudi.data.BillType.CollectingCentreBill; import com.divudi.data.BillTypeAtomic; +import com.divudi.data.Denomination; import com.divudi.data.FinancialReport; import com.divudi.data.PaymentMethod; import com.divudi.data.PaymentMethodValues; + import com.divudi.data.ReportTemplateRow; import com.divudi.data.ReportTemplateRowBundle; +import com.divudi.data.dataStructure.PaymentMethodData; import com.divudi.entity.WebUser; import com.divudi.java.CommonFunctions; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import java.io.Serializable; -import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import javax.ejb.EJB; +import javax.faces.event.AjaxBehaviorEvent; +import javax.faces.event.ValueChangeEvent; import javax.inject.Inject; -import org.bouncycastle.mail.smime.handlers.pkcs7_mime; +import javax.persistence.TemporalType; +import org.json.JSONArray; +import org.json.JSONObject; /** * @@ -64,19 +68,24 @@ public class FinancialTransactionController implements Serializable { SearchController searchController; @Inject BillSearch billSearch; + @Inject + ConfigOptionApplicationController configOptionApplicationController; // // private Bill currentBill; private Payment currentPayment; + private PaymentMethodData paymentMethodData; private Payment removingPayment; private List currentBillPayments; private List currentBills; + private List shiaftStartBills; private List fundTransferBillsToReceive; private List fundBillsForClosureBills; private Bill selectedBill; private Bill nonClosedShiftStartFundBill; private List paymentsFromShiftSratToNow; + private List paymentsSelected; private List recievedBIllPayments; private List allBillsShiftStartToNow; @Deprecated @@ -125,6 +134,10 @@ public class FinancialTransactionController implements Serializable { private double additions; private int fundTransferBillsToReceiveCount; + private Date fromDate; + private Date toDate; + + private ReportTemplateRowBundle paymentSummaryBundle; // // @@ -145,6 +158,26 @@ public String navigateToCreateNewInitialFundBill() { return "/cashier/initial_fund_bill?faces-redirect=true;"; } + public String navigateToListShiftEndSummaries() { + resetClassVariables(); + return "/cashier/initial_fund_bill_list?faces-redirect=true;"; + } + + public void listShiftStartBills() { + String jpql = "select b " + + " from Bill b " + + " where b.retired=:ret" + + " and b.billTypeAtomic=:bta " + + " and b.createdAt between :fd and :td " + + " order by b.id "; + Map params = new HashMap<>(); + params.put("ret", false); + params.put("bta", BillTypeAtomic.FUND_SHIFT_START_BILL); + params.put("fd", fromDate); + params.put("td", toDate); + shiaftStartBills = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); + } + public String navigateToFundTransferBill() { resetClassVariables(); prepareToAddNewFundTransferBill(); @@ -171,6 +204,293 @@ public String navigateToCashierSummaryBreakdownFromShiftClosingForCash() { return navigateToCashierSummaryBreakdownFromShiftClosing(pms); } + public String navigateToCashierSummaryBreakdownFromShiftClosingForCashAdmin() { + List pms = new ArrayList<>(); + pms.add(PaymentMethod.Cash); + return navigateToCashierSummaryBreakdownFromShiftClosing(pms, nonClosedShiftStartFundBill.getCreater(), nonClosedShiftStartFundBill.getId(), nonClosedShiftStartFundBill.getReferenceBill().getId()); + } + + public void selectCashierSummaryBreakdownFromShiftClosingForCashAdmin() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForCollectedCash(); + List billTypes = financialReportByPayments.getBillTypesForCollectedCash(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectRefundedCashDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForRefundedCash(); + List billTypes = financialReportByPayments.getBillTypesForRefundedCash(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetCashTotalDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForNetCashTotal(); + List billTypes = financialReportByPayments.getBillTypesForNetCashTotal(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectCollectedCreditCardDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForCollectedCreditCard(); + List billTypes = financialReportByPayments.getBillTypesForCollectedCreditCard(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectRefundedCreditCardDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForRefundedCreditCard(); + List billTypes = financialReportByPayments.getBillTypesForRefundedCreditCard(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetCreditCardTotalDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForNetCreditCardTotal(); + List billTypes = financialReportByPayments.getBillTypesForNetCreditCardTotal(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectCollectedVoucherDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForCollectedVoucher(); + List billTypes = financialReportByPayments.getBillTypesForCollectedVoucher(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectRefundedVoucherDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForRefundedVoucher(); + List billTypes = financialReportByPayments.getBillTypesForRefundedVoucher(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetVoucherTotalDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForNetVoucherTotal(); + List billTypes = financialReportByPayments.getBillTypesForNetVoucherTotal(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectCollectedOtherNonCreditDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForCollectedDebitCard(); + List billTypes = financialReportByPayments.getBillTypesForCollectedDebitCard(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectRefundedOtherNonCreditDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForRefundedDebitCard(); + List billTypes = financialReportByPayments.getBillTypesForRefundedDebitCard(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetOtherNonCreditTotalDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForBankDeposits(); + List billTypes = financialReportByPayments.getBillTypesForBankDeposits(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectShiftStartFundsDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForFloatMySafe(); + List billTypes = financialReportByPayments.getBillTypesForFloatMySafe(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectFloatReceivedDetails() { + List billTypes = financialReportByPayments.getBillTypesForFloatCollected(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectFloatHandoverDetails() { + List billTypes = financialReportByPayments.getBillTypesForFloatHandover(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetFloatDetails() { + + List billTypes = financialReportByPayments.getBillTypesForFloatCollected(); + billTypes.addAll(financialReportByPayments.getBillTypesForFloatHandover()); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectBankWithdrawalsDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForBankWithdrawals(); + List billTypes = financialReportByPayments.getBillTypesForBankWithdrawals(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectBankDepositsDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForBankDeposits(); + List billTypes = financialReportByPayments.getBillTypesForBankDeposits(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectNetBankTransactionDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForBankWithdrawals(); + List billTypes = financialReportByPayments.getBillTypesForBankWithdrawals(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + + public void selectTotalDetails() { + // Assuming this method should simply select all payments + paymentsSelected = new ArrayList<>(paymentsFromShiftSratToNow); + } + + public void selectShortExcessDetails() { + List paymentMethods = financialReportByPayments.getPaymentMethodsForShortExcess(); + List billTypes = financialReportByPayments.getBillTypesForShortExcess(); + List allPayments = paymentsFromShiftSratToNow; + List selectedPayments = new ArrayList<>(); + for (Payment payment : allPayments) { + if (paymentMethods.contains(payment.getPaymentMethod()) + && billTypes.contains(payment.getBill().getBillTypeAtomic())) { + selectedPayments.add(payment); + } + } + paymentsSelected = selectedPayments; + } + public String navigateToCashierSummaryBreakdownFromShiftClosingForCard() { List pms = new ArrayList<>(); pms.add(PaymentMethod.Card); @@ -192,12 +512,17 @@ public String navigateToCashierSummaryBreakdownFromShiftClosingForAllExceptCashC } public String navigateToCashierSummaryBreakdownFromShiftClosing(List pms) { - searchController.setWebUser(sessionController.getLoggedUser()); - searchController.setStartBillId(nonClosedShiftStartFundBill.getId()); - searchController.setEndBillId(null); + navigateToCashierSummaryBreakdownFromShiftClosing(pms, sessionController.getLoggedUser(), nonClosedShiftStartFundBill.getId(), null); + return "/cashier/shift_end_summary_breakdown?faces-redirect=true"; + } + + public String navigateToCashierSummaryBreakdownFromShiftClosing(List pms, WebUser user, Long startId, Long endId) { + searchController.setWebUser(user); + searchController.setStartBillId(startId); + searchController.setEndBillId(endId); searchController.setPaymentMethods(pms); searchController.processAllFinancialTransactionalSummarybySingleUserByIds(); - return "/cashier/shift_end_summary_breakdown?faces-redirect=true"; + return "/analytics/shift_end_summary_breakdown?faces-redirect=true"; } public String navigateToReceiveNewFundTransferBill() { @@ -320,6 +645,9 @@ public void addPaymentToInitialFundBill() { getCurrentBillPayments().add(currentPayment); calculateInitialFundBillTotal(); currentPayment = null; + getCurrentPayment(); + getCurrentPayment().setCurrencyDenominations(null); + getCurrentPayment().setCurrencyDenominationsJson(""); } public void addPaymentToFundTransferBill() { @@ -457,6 +785,8 @@ public String settleInitialFundBill() { p.setBill(currentBill); p.setDepartment(sessionController.getDepartment()); p.setInstitution(sessionController.getInstitution()); + // Serialize denominations before saving + p.serializeDenominations(); paymentController.save(p); } return "/cashier/initial_fund_bill_print?faces-redirect=true"; @@ -565,7 +895,6 @@ private void createPaymentSummery() { if (paymentsFromShiftSratToNow == null) { return; } - paymentSummaryBundle = new ReportTemplateRowBundle(); Map aggregatedPayments = new HashMap<>(); Map keyMap = new HashMap<>(); @@ -607,11 +936,12 @@ private void createPaymentSummery() { keyMap.putIfAbsent(keyString, row); aggregatedPayments.merge(keyString, p.getPaidValue(), Double::sum); } + } List rows = aggregatedPayments.entrySet().stream().map(entry -> { ReportTemplateRow row = keyMap.get(entry.getKey()); - + if (row != null) { row.setRowValue(entry.getValue()); } @@ -619,9 +949,9 @@ private void createPaymentSummery() { return row; }).collect(Collectors.toList()); - if (paymentSummaryBundle != null) { - paymentSummaryBundle.getReportTemplateRows().addAll(rows); - } + getPaymentSummaryBundle().getReportTemplateRows().addAll(rows); + + } public String navigateToViewEndOfSelectedShiftStartSummaryBill(Bill startBill) { resetClassVariables(); @@ -634,79 +964,18 @@ public String navigateToViewEndOfSelectedShiftStartSummaryBill(Bill startBill) { return "/cashier/shift_end_summery_bill_of_selected_user_not_closed?faces-redirect=true"; } - public void processDayEndSummary() { - System.out.println("processDayEndSummary"); + public String navigateToViewStartToEndOfSelectedShiftStartSummaryBill(Bill startBill) { resetClassVariables(); - fillPaymentsForDateRange(); - createPaymentSummery(); - - } - - private void createPaymentSummery() { - System.out.println("createPaymentSummery"); - System.out.println("paymentsFromShiftSratToNow = " + paymentsFromShiftSratToNow); - - if (paymentsFromShiftSratToNow == null) { - return; + if (startBill == null) { + JsfUtil.addErrorMessage("No Start Bill"); + return null; } - - paymentSummaryBundle = new ReportTemplateRowBundle(); - Map aggregatedPayments = new HashMap<>(); - Map keyMap = new HashMap<>(); - - for (Payment p : paymentsFromShiftSratToNow) { - System.out.println("p = " + p); - - if (p == null || p.getBill() == null) { - continue; // Skip this iteration if p or p.getBill() is null - } - - ReportTemplateRow row = new ReportTemplateRow(); - - if (p.getBill().getCategory() != null) { - row.setCategory(p.getBill().getCategory()); - } - - if (p.getBill().getBillTypeAtomic() != null) { - row.setBillTypeAtomic(p.getBill().getBillTypeAtomic()); - - if (p.getBill().getBillTypeAtomic().getServiceType() != null) { - row.setServiceType(p.getBill().getBillTypeAtomic().getServiceType()); - } - } - - if (p.getBill().getCreditCompany() != null) { - row.setCreditCompany(p.getBill().getCreditCompany()); - } - - if (p.getBill().getToDepartment() != null) { - row.setToDepartment(p.getBill().getToDepartment()); - } - - row.setRowValue(p.getPaidValue()); - - String keyString = row.getCustomKey(); - - if (keyString != null) { - keyMap.putIfAbsent(keyString, row); - aggregatedPayments.merge(keyString, p.getPaidValue(), Double::sum); - } + Bill endBill; + if (startBill.getReferenceBill() == null) { + JsfUtil.addErrorMessage("No Start Bill"); + return null; } - List rows = aggregatedPayments.entrySet().stream().map(entry -> { - ReportTemplateRow row = keyMap.get(entry.getKey()); - - if (row != null) { - row.setRowValue(entry.getValue()); - } - - return row; - }).collect(Collectors.toList()); - - if (paymentSummaryBundle != null) { - paymentSummaryBundle.getReportTemplateRows().addAll(rows); - } - endBill = startBill.getReferenceBill(); nonClosedShiftStartFundBill = startBill; fillPaymentsFromShiftStartToEnd(startBill, endBill, startBill.getCreater()); @@ -775,6 +1044,65 @@ public void fillPaymentsForDateRange() { m.put("ret", true); System.out.println("m = " + m); System.out.println("jpql = " + jpql); + } + + public void fillPaymentsFromShiftStartToNow(Bill startBill, WebUser user) { + paymentsFromShiftSratToNow = new ArrayList<>(); + if (startBill == null) { + JsfUtil.addErrorMessage("No Start Bill"); + return; + } + if (user == null) { + JsfUtil.addErrorMessage("No User"); + return; + } + Long shiftStartBillId = startBill.getId(); + String jpql = "SELECT p " + + "FROM Payment p " + + "WHERE p.creater = :cr " + + "AND p.retired = :ret " + + "AND p.id > :cid " + + "ORDER BY p.id DESC"; + Map m = new HashMap<>(); + m.put("cr", user); + m.put("ret", false); + m.put("cid", shiftStartBillId); + paymentsFromShiftSratToNow = paymentFacade.findByJpql(jpql, m); + atomicBillTypeTotalsByPayments = new AtomicBillTypeTotals(); + for (Payment p : paymentsFromShiftSratToNow) { + if (p.getBill().getBillTypeAtomic() == null) { + } else { + atomicBillTypeTotalsByPayments.addOrUpdateAtomicRecord(p.getBill().getBillTypeAtomic(), p.getPaymentMethod(), p.getPaidValue()); + } + } + financialReportByPayments = new FinancialReport(atomicBillTypeTotalsByPayments); + } + + public void fillPaymentsFromShiftStartToEnd(Bill startBill, Bill endBill, WebUser user) { + paymentsFromShiftSratToNow = new ArrayList<>(); + if (startBill == null) { + JsfUtil.addErrorMessage("No Start Bill"); + return; + } + if (user == null) { + JsfUtil.addErrorMessage("No User"); + return; + } + Long shiftStartBillId = startBill.getId(); + Long shiftEndBillId = endBill.getId(); + String jpql = "SELECT p " + + "FROM Payment p " + + "WHERE p.creater = :cr " + + "AND p.retired = :ret " + + "AND p.id > :sid " + + "AND p.id < :eid " + + "ORDER BY p.id DESC"; + Map m = new HashMap<>(); + m.put("cr", user); + m.put("ret", false); + m.put("sid", shiftStartBillId); + m.put("eid", shiftEndBillId); + paymentsFromShiftSratToNow = paymentFacade.findByJpql(jpql, m); atomicBillTypeTotalsByPayments = new AtomicBillTypeTotals(); for (Payment p : paymentsFromShiftSratToNow) { @@ -1202,9 +1530,53 @@ public Payment getCurrentPayment() { if (currentPayment == null) { currentPayment = new Payment(); } + if (currentPayment.getCurrencyDenominations() == null) { + currentPayment.setCurrencyDenominations(configOptionApplicationController.getDenominations()); + } return currentPayment; } + public PaymentMethodData getPaymentMethodData() { + if (paymentMethodData == null) { + paymentMethodData = new PaymentMethodData(); + } + return paymentMethodData; + } + + public void setPaymentMethodData(PaymentMethodData paymentMethodData) { + this.paymentMethodData = paymentMethodData; + } + + public void updateCashDenominations(AjaxBehaviorEvent event) { + System.out.println("updateCashDenominations called"); + + if (currentPayment == null) { + System.out.println("currentPayment is null"); + return; + } + + double total = 0; + List denominations = currentPayment.getCurrencyDenominations(); + for (Denomination denomination : denominations) { + int value = denomination.getCount(); + System.out.println("Processing denomination: " + denomination.getValue() + " with count: " + value); + total += denomination.getValue() * value; + } + currentPayment.setPaidValue(total); + System.out.println("Total value calculated: " + total); + + // Serialize updated denominations to JSON + JSONArray jsonArray = new JSONArray(); + for (Denomination denomination : denominations) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("value", denomination.getValue()); + jsonObject.put("count", denomination.getCount()); + jsonArray.put(jsonObject); + } + currentPayment.setCurrencyDenominationsJson(jsonArray.toString()); + System.out.println("Updated currencyDenominationsJson: " + currentPayment.getCurrencyDenominationsJson()); + } + public void setCurrentPayment(Payment currentPayment) { this.currentPayment = currentPayment; } @@ -1598,6 +1970,7 @@ public ReportTemplateRowBundle getPaymentSummaryBundle() { public void setPaymentSummaryBundle(ReportTemplateRowBundle paymentSummaryBundle) { this.paymentSummaryBundle = paymentSummaryBundle; + } public List getShiaftStartBills() { return shiaftStartBills; @@ -1608,4 +1981,13 @@ public void setShiaftStartBills(List shiaftStartBills) { } + public List getPaymentsSelected() { + return paymentsSelected; + } + + public void setPaymentsSelected(List paymentsSelected) { + this.paymentsSelected = paymentsSelected; + + } + } diff --git a/src/main/java/com/divudi/bean/channel/ChannelBillController.java b/src/main/java/com/divudi/bean/channel/ChannelBillController.java index 794f513cb2..012cb3f8da 100644 --- a/src/main/java/com/divudi/bean/channel/ChannelBillController.java +++ b/src/main/java/com/divudi/bean/channel/ChannelBillController.java @@ -467,6 +467,7 @@ public BillSession settleCreditForOnlinePayments(BillSession bookingBillSession) bookingBillSession.getBill().setPaidAmount(newSettleBill.getPaidAmount()); bookingBillSession.getBill().setBalance(0.0); bookingBillSession.getBill().setPaidBill(newSettleBill); + bookingBillSession.setRetired(false); bookingBillSession.setPaidBillSession(newlyCreatedSettlingBillSession); getBillFacade().edit(bookingBillSession.getBill()); diff --git a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java index 24dde24f05..77747350b3 100644 --- a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java +++ b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java @@ -313,10 +313,9 @@ public void calculateDueFeesOld() { } } - - - public void debugDueFees() { - Date startTime = new Date(); + + public void debugDueFees() { + Date startTime = new Date(); if (getSpeciality() == null) { JsfUtil.addErrorMessage("Select Specility"); @@ -343,7 +342,7 @@ public void debugDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " -// + " and b.bill.singleBillSession.absent=false" + // + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.staff=:stf "; @@ -367,8 +366,7 @@ public void debugDueFees() { // + " order by b.bill.singleBillSession.serviceSession.sessionDate," // + " b.bill.singleBillSession.serviceSession.sessionTime," // + " b.bill.singleBillSession.serialNo "; - - sql += " order by b.bill.singleBillSession.serviceSession.sessionDate," + sql += " order by b.bill.singleBillSession.serviceSession.sessionDate," + " b.bill.singleBillSession.serviceSession.sessionTime," + " b.bill.singleBillSession.serialNo "; @@ -419,7 +417,7 @@ public void debugDueFees() { nonRefundableBillFees = billFeeFacade.findByJpql(sql, m, TemporalType.TIMESTAMP); dueBillFees.addAll(nonRefundableBillFees); - } + } public void calculateDueFees() { Date startTime = new Date(); @@ -449,7 +447,7 @@ public void calculateDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " -// + " and b.bill.singleBillSession.absent=false" + // + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.staff=:stf "; @@ -544,7 +542,7 @@ public void calculateSessionDueFees() { + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " -// + " and b.bill.singleBillSession.absent=false" + // + " and b.bill.singleBillSession.absent=false" + " and (b.feeValue - b.paidValue) > 0 " + " and b.bill.billType in :bt " + " and b.bill.singleBillSession.sessionInstance=:si" @@ -580,9 +578,8 @@ public void calculateSessionDueFees() { dueBillFees.addAll(nonRefundableBillFees); } - - - public void calculateSessionAllFees() { + + public void calculateSessionDoneFees() { Date startTime = new Date(); if (getSessionInstance() == null) { JsfUtil.addErrorMessage("Select Specility"); @@ -596,18 +593,18 @@ public void calculateSessionAllFees() { + " FROM BillFee b " + " where type(b.bill)=:class " + " and b.bill.retired=false " -// + " and b.bill.paidAmount!=0 " + + " and b.bill.paidAmount!=0 " + " and b.fee.feeType=:ftp" + " and b.bill.refunded=false " + " and b.bill.cancelled=false " -// + " and b.bill.singleBillSession.absent=false" -// + " and (b.feeValue - b.paidValue) > 0 " -// + " and b.bill.billType in :bt " + // + " and b.bill.singleBillSession.absent=false" + + " and (b.feeValue - b.paidValue) < 1 " + + " and b.bill.billType in :bt " + " and b.bill.singleBillSession.sessionInstance=:si" + " and b.bill.singleBillSession.completed=:com"; sql += " order by b.bill.singleBillSession.serialNo "; hm.put("si", getSessionInstance()); -// hm.put("bt", bts); + hm.put("bt", bts); hm.put("ftp", FeeType.Staff); hm.put("com", true); hm.put("class", BilledBill.class); @@ -626,7 +623,7 @@ public void calculateSessionAllFees() { + " and b.bill.billType in :bt " + " and b.bill.singleBillSession.sessionInstance=:si " + " and b.bill.singleBillSession.absent=true " - + " and b.bill.singleBillSession.sessionInstance.originatingSession.refundable=false "; + + " and b.bill.singleBillSession.serviceSession.originatingSession.refundable=false "; sql += " order by b.bill.singleBillSession.serialNo "; m.put("si", getSessionInstance()); m.put("bt", bts); @@ -637,6 +634,32 @@ public void calculateSessionAllFees() { } + public void calculateSessionAllFees() { + if (getSessionInstance() == null) { + JsfUtil.addErrorMessage("Select Specility"); + return; + } + + BillType[] billTypes = {BillType.ChannelAgent, BillType.ChannelCash, BillType.ChannelPaid}; + List bts = Arrays.asList(billTypes); + HashMap hm = new HashMap<>(); + String sql = " SELECT b " + + " FROM BillFee b " + + " where type(b.bill) in :classes " + + " and b.bill.retired=false " + + " and b.fee.feeType=:ftp" + + " and b.bill.singleBillSession.sessionInstance=:si"; + sql += " order by b.bill.singleBillSession.serialNo "; + List> classes = new ArrayList<>(); + classes.add(BilledBill.class); + + hm.put("si", getSessionInstance()); + hm.put("ftp", FeeType.Staff); + hm.put("classes", classes); + System.out.println("sql = " + sql); + System.out.println("hm = " + hm); + dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP); + } public void calculateDueFeesAgency() { Date startTime = new Date(); @@ -801,20 +824,20 @@ private Bill createPaymentBill() { return tmp; } - + public Payment createPaymentProPayment(Bill bill, PaymentMethod pm) { Payment p = new Payment(); p.setBill(bill); double valueToSet = 0 - Math.abs(bill.getNetTotal()); p.setPaidValue(valueToSet); - if(pm == null){ + if (pm == null) { pm = bill.getPaymentMethod(); } setPaymentMethodData(p, pm); return p; } - - public void setPaymentMethodData(Payment p, PaymentMethod pm) { + + public void setPaymentMethodData(Payment p, PaymentMethod pm) { p.setInstitution(getSessionController().getInstitution()); p.setDepartment(getSessionController().getDepartment()); p.setCreatedAt(new Date()); @@ -978,13 +1001,13 @@ public void settleBill() { Bill b = createPaymentBillForSession(); current = b; getBillFacade().create(b); - createPaymentProPayment(b,paymentMethod); + createPaymentProPayment(b, paymentMethod); saveBillItemsAndFees(b); if (sessionController.getDepartmentPreference().isSendSmsOnChannelBookingDocterPayment()) { sendSmsAfterDocPayment(); } printPreview = true; - currentStaff=null; + currentStaff = null; JsfUtil.addSuccessMessage("Successfully Paid"); //////// // System.out.println("Paid"); } @@ -995,7 +1018,7 @@ public void settleSessionPaymentBill() { } calculateTotalPay(); Bill b = createPaymentBill(); - + getBillFacade().create(b); createPaymentProPayment(b, paymentMethod); List bis = saveBillItemsAndFees(b); @@ -1009,7 +1032,7 @@ public void settleSessionPaymentBill() { sendSmsAfterSessionPayment(); } printPreview = true; - currentStaff=null; + currentStaff = null; JsfUtil.addSuccessMessage("Successfully Paid"); } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index e7d5b37cc4..1ee756bff4 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,14 +2,14 @@ - jdbc/demos + jdbc/sethma false - jdbc/demoaudit + jdbc/sethmaAudit false diff --git a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml index 329acdc195..c3fd03ff73 100644 --- a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml +++ b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml @@ -70,28 +70,36 @@
-
+
+
+ +
@@ -124,87 +132,53 @@ - + - - + + - + - - - - - - + - + - - - - - - - - - - - - - - + - - - - - + + + + + + - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - + + From 5b0833b20b00171a1ba823198305a6f608c6600e Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 22:29:44 +0530 Subject: [PATCH 16/21] Signed-off-by: buddhika75 --- pom.xml | 4 +- .../FinancialTransactionController.java | 271 ++- .../analytics/ReportTemplateController.java | 1477 +++++++++++++---- .../java/com/divudi/data/BillTypeAtomic.java | 30 +- .../java/com/divudi/data/FinancialReport.java | 12 + .../divudi/data/ReportTemplateRowBundle.java | 9 + .../data/analytics/ReportTemplateType.java | 1 + .../com/divudi/facade/AbstractFacade.java | 48 +- src/main/resources/META-INF/persistence.xml | 4 +- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- .../webapp/cashier/initial_fund_bill.xhtml | 177 +- .../cashier/initial_fund_bill_list.xhtml | 4 +- ...ift_end_report_bill_of_selected_user.xhtml | 184 ++ ...ft_end_summery_bill_of_selected_user.xhtml | 500 ++++++ ...ery_bill_of_selected_user_not_closed.xhtml | 38 - .../shift_end_summary_table_admin.xhtml | 450 ----- 16 files changed, 2196 insertions(+), 1015 deletions(-) create mode 100644 src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml create mode 100644 src/main/webapp/cashier/shift_end_summery_bill_of_selected_user.xhtml delete mode 100644 src/main/webapp/cashier/shift_end_summery_bill_of_selected_user_not_closed.xhtml delete mode 100644 src/main/webapp/resources/ezcomp/shift_end_summary_table_admin.xhtml diff --git a/pom.xml b/pom.xml index 65afc125dc..dca45d2719 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.divudi - sethma + sethmademo 3.0.0 war - sethma + sethmademo ${project.build.directory}/endorsed diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 5e2f98a257..eb27746abe 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -1,5 +1,6 @@ package com.divudi.bean.cashTransaction; +import com.divudi.bean.channel.analytics.ReportTemplateController; import java.util.HashMap; import com.divudi.bean.common.BillController; import com.divudi.bean.common.BillSearch; @@ -14,6 +15,7 @@ import com.divudi.facade.PaymentFacade; import com.divudi.bean.common.util.JsfUtil; import com.divudi.data.AtomicBillTypeTotals; +import com.divudi.data.BillCategory; import com.divudi.data.BillFinanceType; import com.divudi.data.BillTypeAtomic; import com.divudi.data.Denomination; @@ -23,12 +25,17 @@ import com.divudi.data.ReportTemplateRow; import com.divudi.data.ReportTemplateRowBundle; +import com.divudi.data.ServiceType; +import com.divudi.data.analytics.ReportTemplateType; import com.divudi.data.dataStructure.PaymentMethodData; import com.divudi.entity.WebUser; import com.divudi.java.CommonFunctions; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import java.io.Serializable; +import java.time.Duration; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -61,6 +68,8 @@ public class FinancialTransactionController implements Serializable { @Inject SessionController sessionController; @Inject + ReportTemplateController reportTemplateController; + @Inject BillController billController; @Inject PaymentController paymentController; @@ -74,6 +83,19 @@ public class FinancialTransactionController implements Serializable { // private Bill currentBill; + private ReportTemplateRowBundle reportTemplateRowBundle; + private ReportTemplateRowBundle opdServiceBundle; + private ReportTemplateRowBundle channellingBundle; + private ReportTemplateRowBundle opdDocPayment; + private ReportTemplateRowBundle channellingDocPayment; + + private ReportTemplateRowBundle opdBilled; + private ReportTemplateRowBundle opdReturns; + private ReportTemplateRowBundle channellingBilled; + private ReportTemplateRowBundle channellingReturns; + private ReportTemplateRowBundle pharmacyBilld; + private ReportTemplateRowBundle pharmacyReturned; + private Payment currentPayment; private PaymentMethodData paymentMethodData; private Payment removingPayment; @@ -158,6 +180,126 @@ public String navigateToCreateNewInitialFundBill() { return "/cashier/initial_fund_bill?faces-redirect=true;"; } + // Method to calculate duration between two Date objects + public String calculateDuration(Date startDate, Date endDate) { + if (startDate == null || endDate == null) { + return "N/A"; + } + + LocalDateTime startDateTime = convertToLocalDateTime(startDate); + LocalDateTime endDateTime = convertToLocalDateTime(endDate); + + Duration duration = Duration.between(startDateTime, endDateTime); + long hours = duration.toHours(); + long minutes = duration.minusHours(hours).toMinutes(); + + return String.format("%d hours, %d minutes", hours, minutes); + } + + // Helper method to convert Date to LocalDateTime + private LocalDateTime convertToLocalDateTime(Date date) { + return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + } + + public void processShiftEndReport() { + channellingBilled = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.CHANNELLING, BillFinanceType.CASH_IN), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + channellingReturns = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdBilled = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdReturns = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_OUT), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + channellingDocPayment = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findBillTypeAtomic(ServiceType.CHANNELLING, BillCategory.PAYMENTS), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdDocPayment = reportTemplateController.generateReport( + ReportTemplateType.BILL_NET_TOTAL, + BillTypeAtomic.findBillTypeAtomic(ServiceType.OPD, BillCategory.PAYMENTS), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + } + public String navigateToListShiftEndSummaries() { resetClassVariables(); return "/cashier/initial_fund_bill_list?faces-redirect=true;"; @@ -194,6 +336,10 @@ public String navigateToCashierSummary() { return "/cashier/cashier_summary?faces-redirect=true"; } + public String navigateToCashierReport() { + return "/cashier/shift_end_report_bill_of_selected_user?faces-redirect=true"; + } + public String navigateToCashierSummaryBreakdown() { return "/cashier/shift_end_summary_breakdown?faces-redirect=true"; } @@ -941,7 +1087,7 @@ private void createPaymentSummery() { List rows = aggregatedPayments.entrySet().stream().map(entry -> { ReportTemplateRow row = keyMap.get(entry.getKey()); - + if (row != null) { row.setRowValue(entry.getValue()); } @@ -953,33 +1099,40 @@ private void createPaymentSummery() { } - public String navigateToViewEndOfSelectedShiftStartSummaryBill(Bill startBill) { + public String navigateToViewShiftSratToNow(Bill startBill) { resetClassVariables(); if (startBill == null) { JsfUtil.addErrorMessage("No Start Bill"); return null; } + if (startBill.getCreater() == null) { + JsfUtil.addErrorMessage("No User"); + return null; + } nonClosedShiftStartFundBill = startBill; fillPaymentsFromShiftStartToNow(startBill, startBill.getCreater()); - return "/cashier/shift_end_summery_bill_of_selected_user_not_closed?faces-redirect=true"; + return "/cashier/shift_end_summery_bill_of_selected_user?faces-redirect=true"; } - public String navigateToViewStartToEndOfSelectedShiftStartSummaryBill(Bill startBill) { + public String navigateToViewShiftSrartToEnd(Bill startBill) { resetClassVariables(); if (startBill == null) { JsfUtil.addErrorMessage("No Start Bill"); return null; } + if (startBill.getCreater() == null) { + JsfUtil.addErrorMessage("No User"); + return null; + } Bill endBill; if (startBill.getReferenceBill() == null) { JsfUtil.addErrorMessage("No Start Bill"); return null; } - endBill = startBill.getReferenceBill(); nonClosedShiftStartFundBill = startBill; fillPaymentsFromShiftStartToEnd(startBill, endBill, startBill.getCreater()); - return "/cashier/shift_end_summery_bill_of_selected_user_not_closed?faces-redirect=true"; + return "/cashier/shift_end_summery_bill_of_selected_user?faces-redirect=true"; } public String navigateToCreateShiftEndSummaryBillByBills() { @@ -1362,15 +1515,15 @@ public String settleShiftEndFundBill() { } // -// + // /** * * User click to Crete Transfer Bill Add (fromStaff 0 the user) Select User * to transfer (toStaff) settle to print * */ -// -// + // + // /** * * pavan @@ -1440,8 +1593,8 @@ public String settleFundTransferReceiveBill() { return "/cashier/fund_transfer_receive_bill_print?faces-redirect=true"; } -// -// + // + // //Lawan public void addPaymentToFundDepositBill() { if (currentBill == null) { @@ -1499,8 +1652,8 @@ public String settleFundDepositBill() { } return "/cashier/deposit_funds_print?faces-redirect=true"; } -// -// + // + // public String navigateToCreateNewFundWithdrawalBill() { prepareToAddNewWithdrawalProcessingBill(); @@ -1515,8 +1668,8 @@ private void prepareToAddNewWithdrawalProcessingBill() { currentBill.setBillClassType(BillClassType.Bill); } -//Damith -// + //Damith + // // public Bill getCurrentBill() { return currentBill; @@ -1990,4 +2143,92 @@ public void setPaymentsSelected(List paymentsSelected) { } + public ReportTemplateRowBundle getReportTemplateRowBundle() { + return reportTemplateRowBundle; + } + + public void setReportTemplateRowBundle(ReportTemplateRowBundle reportTemplateRowBundle) { + this.reportTemplateRowBundle = reportTemplateRowBundle; + } + + public ReportTemplateRowBundle getOpdServiceBundle() { + return opdServiceBundle; + } + + public void setOpdServiceBundle(ReportTemplateRowBundle opdServiceBundle) { + this.opdServiceBundle = opdServiceBundle; + } + + public ReportTemplateRowBundle getChannellingBundle() { + return channellingBundle; + } + + public void setChannellingBundle(ReportTemplateRowBundle channellingBundle) { + this.channellingBundle = channellingBundle; + } + + public ReportTemplateRowBundle getOpdDocPayment() { + return opdDocPayment; + } + + public void setOpdDocPayment(ReportTemplateRowBundle opdDocPayment) { + this.opdDocPayment = opdDocPayment; + } + + public ReportTemplateRowBundle getChannellingDocPayment() { + return channellingDocPayment; + } + + public void setChannellingDocPayment(ReportTemplateRowBundle channellingDocPayment) { + this.channellingDocPayment = channellingDocPayment; + } + + public ReportTemplateRowBundle getOpdBilled() { + return opdBilled; + } + + public void setOpdBilled(ReportTemplateRowBundle opdBilled) { + this.opdBilled = opdBilled; + } + + public ReportTemplateRowBundle getOpdReturns() { + return opdReturns; + } + + public void setOpdReturns(ReportTemplateRowBundle opdReturns) { + this.opdReturns = opdReturns; + } + + public ReportTemplateRowBundle getChannellingBilled() { + return channellingBilled; + } + + public void setChannellingBilled(ReportTemplateRowBundle channellingBilled) { + this.channellingBilled = channellingBilled; + } + + public ReportTemplateRowBundle getChannellingReturns() { + return channellingReturns; + } + + public void setChannellingReturns(ReportTemplateRowBundle channellingReturns) { + this.channellingReturns = channellingReturns; + } + + public ReportTemplateRowBundle getPharmacyBilld() { + return pharmacyBilld; + } + + public void setPharmacyBilld(ReportTemplateRowBundle pharmacyBilld) { + this.pharmacyBilld = pharmacyBilld; + } + + public ReportTemplateRowBundle getPharmacyReturned() { + return pharmacyReturned; + } + + public void setPharmacyReturned(ReportTemplateRowBundle pharmacyReturned) { + this.pharmacyReturned = pharmacyReturned; + } + } diff --git a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java index ef87761544..f9050ac8ae 100644 --- a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java +++ b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java @@ -10,6 +10,7 @@ import com.divudi.bean.common.*; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.data.AtomicBillTypeTotals; import com.divudi.data.BillTypeAtomic; import com.divudi.data.ReportTemplateRow; import com.divudi.data.ReportTemplateRowBundle; @@ -58,8 +59,7 @@ public class ReportTemplateController implements Serializable { private ReportTemplateFacade ejbFacade; private ReportTemplate current; private List items = null; - - + private Date date; private Date fromDate; private Date toDate; @@ -67,7 +67,8 @@ public class ReportTemplateController implements Serializable { private Department department; private WebUser user; private Staff staff; - + private Long startId; + private Long endId; private Institution creditCompany; private Institution fromInstitution; @@ -93,10 +94,6 @@ public void save(ReportTemplate reportTemplate) { } } - - - - public ReportTemplate findReportTemplateByName(String name) { if (name == null) { return null; @@ -139,98 +136,439 @@ public void recreateModel() { items = null; } - public String processReport() { - if (current == null) { - JsfUtil.addErrorMessage("Nothing Selected"); - return null; - } - if (current.getReportTemplateType() == null) { - JsfUtil.addErrorMessage("No report Type"); - return ""; - } - switch (current.getReportTemplateType()) { + public ReportTemplateRowBundle generateReport( + ReportTemplateType type, + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + ReportTemplateRowBundle bundle; + + switch (type) { + case BILL_NET_TOTAL: + bundle = handleBillTypeAtomicTotalUsingBills( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); + break; case BILLT_TYPE_AND_PAYMENT_METHOD_SUMMARY_PAYMENTS: - handleBillTypeAndPaymentMethodSummaryPayments(); + bundle = handleBillTypeAndPaymentMethodSummaryPayments( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILLT_TYPE_AND_PAYMENT_METHOD_SUMMARY_USING_BILLS: - handleBillTypeAndPaymentMethodSummaryUsingBills(); + bundle = handleBillTypeAndPaymentMethodSummaryUsingBills( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_TYPE_ATOMIC_SUMMARY_USING_FEES: - handleBillFeeGroupedByBillTypeAtomic(); + bundle = handleBillFeeGroupedByBillTypeAtomic( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_FEE_GROUPED_BY_TO_DEPARTMENT_AND_CATEGORY: - handleBillFeeGroupedByToDepartmentAndCategory(); + bundle = handleBillFeeGroupedByToDepartmentAndCategory( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_FEE_LIST: - handleBillFeeList(); + bundle = handleBillFeeList( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_ITEM_LIST: - handleBillItemList(); + bundle = handleBillItemList( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_LIST: - handleBillList(); + bundle = handleBillList( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_TYPE_ATOMIC_SUMMARY_USING_BILLS: - handleBillTypeAtomicSummaryUsingBills(); + bundle = handleBillTypeAtomicSummaryUsingBills( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case BILL_TYPE_ATOMIC_SUMMARY_USING_PAYMENTS: - handleBillTypeAtomicSummaryUsingPayments(); + bundle = handleBillTypeAtomicSummaryUsingPayments( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case ENCOUNTER_LIST: - handleEncounterList(); + bundle = handleEncounterList( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case PATIENT_LIST: - handlePatientList(); + bundle = handlePatientList( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case PAYMENT_METHOD_SUMMARY_USING_BILLS: - handlePaymentMethodSummaryUsingBills(); + bundle = handlePaymentMethodSummaryUsingBills( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case PAYMENT_METHOD_SUMMARY_USING_PAYMENTS: - handlePaymentMethodSummaryUsingPayments(); + bundle = handlePaymentMethodSummaryUsingPayments( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case PAYMENT_TYPE_SUMMARY_PAYMENTS: - handlePaymentTypeSummaryPayments(); + bundle = handlePaymentTypeSummaryPayments( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case PAYMENT_TYPE_SUMMARY_USING_BILLS: - handlePaymentTypeSummaryUsingBills(); + bundle = handlePaymentTypeSummaryUsingBills( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case ITEM_CATEGORY_SUMMARY_BY_BILL_FEE: - handleItemCategorySummaryByBillFee(); + bundle = handleItemCategorySummaryByBillFee( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM: - handleItemCategorySummaryByBillItem(); + bundle = handleItemCategorySummaryByBillItem( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case ITEM_CATEGORY_SUMMARY_BY_BILL: - handleItemCategorySummaryByBill(); + bundle = handleItemCategorySummaryByBill( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case TO_DEPARTMENT_SUMMARY_BY_BILL_FEE: - handleToDepartmentSummaryByBillFee(); + bundle = handleToDepartmentSummaryByBillFee( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case TO_DEPARTMENT_SUMMARY_BY_BILL_ITEM: - handleToDepartmentSummaryByBillItem(); + bundle = handleToDepartmentSummaryByBillItem( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; case TO_DEPARTMENT_SUMMARY_BY_BILL: - handleToDepartmentSummaryByBill(); + bundle = handleToDepartmentSummaryByBill( + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); break; default: JsfUtil.addErrorMessage("Unknown Report Type"); - return ""; + return null; } - return ""; + return bundle; } - private void handleBillTypeAndPaymentMethodSummaryPayments() { - // Method implementation here - } - - private void handleBillTypeAndPaymentMethodSummaryUsingBills() { - // Method implementation here + public String processReport() { + if (current == null) { + JsfUtil.addErrorMessage("Nothing Selected"); + return null; + } + if (current.getReportTemplateType() == null) { + JsfUtil.addErrorMessage("No report Type"); + return ""; + } + reportTemplateRowBundle = generateReport(current.getReportTemplateType(), current.getBillTypeAtomics(), date, fromDate, toDate, institution, department, fromInstitution, fromDepartment, toInstitution, toDepartment, user, creditCompany, startId, endId); + return ""; } - private void handleBillFeeGroupedByBillTypeAtomic() { + private ReportTemplateRowBundle handleBillFeeGroupedByBillTypeAtomic( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); String jpql; Map parameters = new HashMap<>(); - reportTemplateRowBundle = new ReportTemplateRowBundle(); jpql = "select new com.divudi.data.ReportTemplateRow(" + " bill.billTypeAtomic, sum(bf.feeValue)) " @@ -243,56 +581,69 @@ private void handleBillFeeGroupedByBillTypeAtomic() { parameters.put("bir", true); parameters.put("br", true); - if (current.getBillTypeAtomics() != null) { + if (btas != null) { jpql += " and bill.billTypeAtomic in :btas "; - parameters.put("btas", current.getBillTypeAtomics()); + parameters.put("btas", btas); } - for (ReportTemplateFilter f : current.getReportFilters()) { - switch (f) { - case DATE: - jpql += " and bill.billDate=:bd "; - parameters.put("bd", date); - break; - case TO_DATE: - jpql += " and bill.billDate < :td "; - parameters.put("td", toDate); - break; - case FROM_DATE: - jpql += " and bill.billDate > :fd "; - parameters.put("fd", fromDate); - break; - case INSTITUTION: - jpql += " and bill.institution=:ins "; - parameters.put("ins", institution); - break; - case DEPARTMENT: - jpql += " and bill.department=:dep "; - parameters.put("dep", department); - break; - case FROM_INSTITUTION: - jpql += " and bill.fromInstitution=:fins "; - parameters.put("fins", fromInstitution); - break; - case FROM_DEPARTMENT: - jpql += " and bill.fromDepartment=:fdep "; - parameters.put("fdep", fromDepartment); - break; - case TO_INSTITUTION: - jpql += " and bill.toInstitution=:tins "; - parameters.put("tins", toInstitution); - break; - case TO_DEPARTMENT: - jpql += " and bill.toDepartment=:tdep "; - parameters.put("tdep", toDepartment); - break; - case CREDIT_COMPANY: - jpql += " and bill.creditCompany=:creditCompany "; - parameters.put("creditCompany", creditCompany); - break; - default: - throw new AssertionError(); - } + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:cc "; + parameters.put("cc", paramCreditCompany); } jpql += " group by bill.billTypeAtomic"; @@ -312,13 +663,29 @@ private void handleBillFeeGroupedByBillTypeAtomic() { for (ReportTemplateRow row : rs) { row.setId(idCounter++); } - reportTemplateRowBundle.setReportTemplateRows(rs); - } - - private void handleBillFeeGroupedByToDepartmentAndCategory() { + bundle.setReportTemplateRows(rs); + return bundle; + } + + private ReportTemplateRowBundle handleBillFeeGroupedByToDepartmentAndCategory( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); String jpql; Map parameters = new HashMap<>(); - reportTemplateRowBundle = new ReportTemplateRowBundle(); jpql = "select new com.divudi.data.ReportTemplateRow(" + " bill.billTypeAtomic, sum(bf.feeValue)) " @@ -331,52 +698,69 @@ private void handleBillFeeGroupedByToDepartmentAndCategory() { parameters.put("bir", true); parameters.put("br", true); - if (current.getBillTypeAtomics() != null) { + if (btas != null) { jpql += " and bill.billTypeAtomic in :btas "; - parameters.put("btas", current.getBillTypeAtomics()); + parameters.put("btas", btas); } - for (ReportTemplateFilter f : current.getReportFilters()) { - switch (f) { - case DATE: - jpql += " and bill.billDate=:bd "; - parameters.put("bd", date); - break; - case TO_DATE: - jpql += " and bill.billDate < :td "; - parameters.put("td", toDate); - break; - case FROM_DATE: - jpql += " and bill.billDate > :fd "; - parameters.put("fd", fromDate); - break; - case INSTITUTION: - jpql += " and bill.institution=:ins "; - parameters.put("ins", institution); - break; - case DEPARTMENT: - jpql += " and bill.department=:dep "; - parameters.put("dep", department); - break; - case FROM_INSTITUTION: - jpql += " and bill.fromInstitution=:fins "; - parameters.put("fins", fromInstitution); - break; - case FROM_DEPARTMENT: - jpql += " and bill.fromDepartment=:fdep "; - parameters.put("fdep", fromDepartment); - break; - case TO_INSTITUTION: - jpql += " and bill.toInstitution=:tins "; - parameters.put("tins", toInstitution); - break; - case TO_DEPARTMENT: - jpql += " and bill.toDepartment=:tdep "; - parameters.put("tdep", toDepartment); - break; - default: - throw new AssertionError(); - } + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:cc "; + parameters.put("cc", paramCreditCompany); } jpql += " group by bill.billTypeAtomic"; @@ -396,25 +780,29 @@ private void handleBillFeeGroupedByToDepartmentAndCategory() { for (ReportTemplateRow row : rs) { row.setId(idCounter++); } - reportTemplateRowBundle.setReportTemplateRows(rs); - } - - private void handleBillFeeList() { - // Method implementation here - } - - private void handleBillItemList() { - // Method implementation here - } - - private void handleBillList() { - // Method implementation here - } - - private void handleBillTypeAtomicSummaryUsingBills() { + bundle.setReportTemplateRows(rs); + return bundle; + } + + private ReportTemplateRowBundle handleBillTypeAtomicSummaryUsingBills( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); String jpql; Map parameters = new HashMap<>(); - reportTemplateRowBundle = new ReportTemplateRowBundle(); jpql = "select new com.divudi.data.ReportTemplateRow(" + " bill.billTypeAtomic, sum(bill.netTotal)) " @@ -422,56 +810,69 @@ private void handleBillTypeAtomicSummaryUsingBills() { + " where bill.retired<>:br "; parameters.put("br", true); - if (current.getBillTypeAtomics() != null) { + if (btas != null) { jpql += " and bill.billTypeAtomic in :btas "; - parameters.put("btas", current.getBillTypeAtomics()); + parameters.put("btas", btas); } - for (ReportTemplateFilter f : current.getReportFilters()) { - switch (f) { - case DATE: - jpql += " and bill.billDate=:bd "; - parameters.put("bd", date); - break; - case TO_DATE: - jpql += " and bill.billDate < :td "; - parameters.put("td", toDate); - break; - case FROM_DATE: - jpql += " and bill.billDate > :fd "; - parameters.put("fd", fromDate); - break; - case INSTITUTION: - jpql += " and bill.institution=:ins "; - parameters.put("ins", institution); - break; - case DEPARTMENT: - jpql += " and bill.department=:dep "; - parameters.put("dep", department); - break; - case FROM_INSTITUTION: - jpql += " and bill.fromInstitution=:fins "; - parameters.put("fins", fromInstitution); - break; - case FROM_DEPARTMENT: - jpql += " and bill.fromDepartment=:fdep "; - parameters.put("fdep", fromDepartment); - break; - case TO_INSTITUTION: - jpql += " and bill.toInstitution=:tins "; - parameters.put("tins", toInstitution); - break; - case TO_DEPARTMENT: - jpql += " and bill.toDepartment=:tdep "; - parameters.put("tdep", toDepartment); - break; - case CREDIT_COMPANY: - jpql += " and bill.creditCompany=:creditCompany "; - parameters.put("creditCompany", creditCompany); - break; - default: - throw new AssertionError(); - } + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:cc "; + parameters.put("cc", paramCreditCompany); } jpql += " group by bill.billTypeAtomic"; @@ -491,36 +892,545 @@ private void handleBillTypeAtomicSummaryUsingBills() { for (ReportTemplateRow row : rs) { row.setId(idCounter++); } - reportTemplateRowBundle.setReportTemplateRows(rs); + bundle.setReportTemplateRows(rs); + return bundle; + } + + private ReportTemplateRowBundle handleBillTypeAtomicTotalUsingBills( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); + String jpql; + Map parameters = new HashMap<>(); - } + // Initialize the total to 0 + double totalNetAmount = 0.0; - private void handleBillTypeAtomicSummaryUsingPayments() { - // Method implementation here - } + jpql = "select sum(bill.netTotal) " + + " from Bill bill " + + " where bill.retired<>:br "; + parameters.put("br", true); - private void handleEncounterList() { - // Method implementation here - } + if (btas != null) { + jpql += " and bill.billTypeAtomic in :btas "; + parameters.put("btas", btas); + } - private void handlePatientList() { - // Method implementation here - } + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } - private void handlePaymentMethodSummaryUsingBills() { - // Method implementation here - } + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } - private void handlePaymentMethodSummaryUsingPayments() { - // Method implementation here - } + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } - private void handlePaymentTypeSummaryPayments() { - // Method implementation here - } + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:cc "; + parameters.put("cc", paramCreditCompany); + } + + if (paramUser != null) { + jpql += " and bill.creater=:wu "; + parameters.put("wu", paramUser); + } + + System.out.println("jpql = " + jpql); + System.out.println("parameters = " + parameters); + + + Double sumResult = ejbFacade.findSingleResultByJpql(jpql, parameters, TemporalType.DATE); + + + if (sumResult != null) { + totalNetAmount = sumResult; + } + + bundle.setTotal(totalNetAmount); + + return bundle; + } + + private ReportTemplateRowBundle handleBillTypeAndPaymentMethodSummaryPayments( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleBillTypeAndPaymentMethodSummaryUsingBills( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleBillFeeList( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleBillItemList( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleBillList( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleBillTypeAtomicSummaryUsingPayments( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleEncounterList( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handlePatientList( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handlePaymentMethodSummaryUsingBills( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handlePaymentMethodSummaryUsingPayments( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handlePaymentTypeSummaryPayments( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handlePaymentTypeSummaryUsingBills( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleItemCategorySummaryByBillFee( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleItemCategorySummaryByBillItem( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { - private void handlePaymentTypeSummaryUsingBills() { + String jpql; + Map parameters = new HashMap<>(); + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); + + jpql = "select new com.divudi.data.ReportTemplateRow(" + + " bi.item.category.name, sum(bi.netValue)) " + + " from BillItem bi" + + " join bi.bill bill " + + " where bill.retired<>:br " + + " and bi.retired<>:br "; + parameters.put("br", true); + + if (btas != null) { + jpql += " and bill.billTypeAtomic in :btas "; + parameters.put("btas", btas); + } + + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:creditCompany "; + parameters.put("creditCompany", paramCreditCompany); + } + + jpql += " and bi.item is not null " + + " and bi.item.category is not null "; + + jpql += " group by bi.item.category "; + + System.out.println("jpql = " + jpql); + System.out.println("parameters = " + parameters); + + List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE); + + if (rs == null || rs.isEmpty()) { + System.out.println("No results found."); + } else { + System.out.println("Results found: " + rs.size()); + } + + long idCounter = 1; + for (ReportTemplateRow row : rs) { + row.setId(idCounter++); + } + bundle.setReportTemplateRows(rs); + return bundle; + } + + private ReportTemplateRowBundle handleItemCategorySummaryByBill( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleToDepartmentSummaryByBillFee( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleToDepartmentSummaryByBillItem( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); + } + + private ReportTemplateRowBundle handleToDepartmentSummaryByBill( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + return new ReportTemplateRowBundle(); } public void saveSelected() { @@ -819,118 +1729,23 @@ public Institution getCreditCompany() { public void setCreditCompany(Institution creditCompany) { this.creditCompany = creditCompany; } - /** - * - */ - private void handleItemCategorySummaryByBillFee() { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - private void handleItemCategorySummaryByBillItem() { - String jpql; - Map parameters = new HashMap<>(); - reportTemplateRowBundle = new ReportTemplateRowBundle(); - - jpql = "select new com.divudi.data.ReportTemplateRow(" - + " bi.item.category.name, sum(bi.netValue)) " - + " from BillItem bi" - + " join bi.bill bill " - + " where bill.retired<>:br " - + " and bi.retired<>:br "; - parameters.put("br", true); - - if (current.getBillTypeAtomics() != null) { - jpql += " and bill.billTypeAtomic in :btas "; - parameters.put("btas", current.getBillTypeAtomics()); - } - - for (ReportTemplateFilter f : current.getReportFilters()) { - switch (f) { - case DATE: - jpql += " and bill.billDate=:bd "; - parameters.put("bd", date); - break; - case TO_DATE: - jpql += " and bill.billDate < :td "; - parameters.put("td", toDate); - break; - case FROM_DATE: - jpql += " and bill.billDate > :fd "; - parameters.put("fd", fromDate); - break; - case INSTITUTION: - jpql += " and bill.institution=:ins "; - parameters.put("ins", institution); - break; - case DEPARTMENT: - jpql += " and bill.department=:dep "; - parameters.put("dep", department); - break; - case FROM_INSTITUTION: - jpql += " and bill.fromInstitution=:fins "; - parameters.put("fins", fromInstitution); - break; - case FROM_DEPARTMENT: - jpql += " and bill.fromDepartment=:fdep "; - parameters.put("fdep", fromDepartment); - break; - case TO_INSTITUTION: - jpql += " and bill.toInstitution=:tins "; - parameters.put("tins", toInstitution); - break; - case TO_DEPARTMENT: - jpql += " and bill.toDepartment=:tdep "; - parameters.put("tdep", toDepartment); - break; - case CREDIT_COMPANY: - jpql += " and bill.creditCompany=:creditCompany "; - parameters.put("creditCompany", creditCompany); - break; - default: - throw new AssertionError(); - } - } - - jpql += " and bi.item is not null " - + " and bi.item.category is not null "; - - jpql += " group by bi.item.category "; - - System.out.println("jpql = " + jpql); - System.out.println("parameters = " + parameters); - - List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE); - - if (rs == null || rs.isEmpty()) { - System.out.println("No results found."); - } else { - System.out.println("Results found: " + rs.size()); - } - - long idCounter = 1; - for (ReportTemplateRow row : rs) { - row.setId(idCounter++); - } - reportTemplateRowBundle.setReportTemplateRows(rs); - } - private void handleItemCategorySummaryByBill() { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + public Long getStartId() { + return startId; } - private void handleToDepartmentSummaryByBillFee() { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + public void setStartId(Long startId) { + this.startId = startId; } - private void handleToDepartmentSummaryByBillItem() { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + public Long getEndId() { + return endId; } - private void handleToDepartmentSummaryByBill() { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + public void setEndId(Long endId) { + this.endId = endId; } - public static class ReportTemplateConverter implements Converter { @Override diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java index 14f721a1aa..2a0c32ec4b 100644 --- a/src/main/java/com/divudi/data/BillTypeAtomic.java +++ b/src/main/java/com/divudi/data/BillTypeAtomic.java @@ -35,7 +35,6 @@ public enum BillTypeAtomic { STORE_GRN_CANCELLED("Store GRN Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT), STORE_GRN_REFUND("Store GRN Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT), STORE_GRN_RETURN("Store GRN Return", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_IN), - // Pharmacy PHARMACY_RETAIL_SALE("Pharmacy Retail Sale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), PHARMACY_RETAIL_SALE_PRE("Pharmacy Retail Sale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), @@ -158,10 +157,10 @@ public enum BillTypeAtomic { FUND_WITHDRAWAL_BILL("Withdrawal Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_IN), FUND_WITHDRAWAL_BILL_CANCELLED("Withdrawal Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_OUT), // Professional Payments - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_IN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_IN), PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT), PETTY_CASH_ISSUE("Petty Cash Issue", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT), PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN), @@ -208,4 +207,25 @@ public static List findByCategory(BillCategory category) { .filter(e -> e.getBillCategory() == category) .collect(Collectors.toList()); } + + // Method to find BillTypeAtomic by ServiceType + public static List findByServiceType(ServiceType serviceType) { + return Arrays.stream(BillTypeAtomic.values()) + .filter(e -> e.getServiceType() == serviceType) + .collect(Collectors.toList()); + } + +// Method to find BillTypeAtomic by ServiceType and BillFinanceType + public static List findByServiceTypeAndFinanceType(ServiceType serviceType, BillFinanceType financeType) { + return Arrays.stream(BillTypeAtomic.values()) + .filter(e -> e.getServiceType() == serviceType && e.getBillFinanceType() == financeType) + .collect(Collectors.toList()); + } + + public static List findBillTypeAtomic(ServiceType serviceType, BillCategory billCategory) { + return Arrays.stream(BillTypeAtomic.values()) + .filter(e -> e.getServiceType() == serviceType && e.getBillCategory() == billCategory) + .collect(Collectors.toList()); + } + } diff --git a/src/main/java/com/divudi/data/FinancialReport.java b/src/main/java/com/divudi/data/FinancialReport.java index df070a8c71..a6d3335563 100644 --- a/src/main/java/com/divudi/data/FinancialReport.java +++ b/src/main/java/com/divudi/data/FinancialReport.java @@ -363,6 +363,16 @@ public List getBillTypesForCollectedCash() { } return billTypesForCollectedCash; } + + public List getBillTypesForChannelCollected() { + List cc = new ArrayList<>(); + BillTypeAtomic.findByFinanceType(BillFinanceType.CASH_IN); + if (billTypesForCollectedCash == null) { + billTypesForCollectedCash = new ArrayList<>(); + billTypesForCollectedCash = BillTypeAtomic.findByFinanceType(BillFinanceType.CASH_IN); + } + return billTypesForCollectedCash; + } public List getPaymentMethodsForRefundedCash() { if (paymentMethodsForRefundedCash == null) { @@ -919,5 +929,7 @@ public List getBillTypesForShortExcess() { } return billTypesForShortExcess; } + + } diff --git a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java index 5064db5b99..64c6f2a08e 100644 --- a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java +++ b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java @@ -12,6 +12,7 @@ public class ReportTemplateRowBundle { private ReportTemplate reportTemplate; private List reportTemplateRows; + private Double total; public ReportTemplate getReportTemplate() { return reportTemplate; @@ -32,6 +33,14 @@ public void setReportTemplateRows(List reportTemplateRows) { this.reportTemplateRows = reportTemplateRows; } + public Double getTotal() { + return total; + } + + public void setTotal(Double total) { + this.total = total; + } + diff --git a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java index d52b6ceb15..cda5be1e92 100644 --- a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java +++ b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java @@ -6,6 +6,7 @@ */ public enum ReportTemplateType { BILL_LIST("Bill List"), + BILL_NET_TOTAL("Bill Net Total"), BILL_ITEM_LIST("Bill Item List"), BILL_FEE_LIST("Bill Fee List"), PATIENT_LIST("Patient List"), diff --git a/src/main/java/com/divudi/facade/AbstractFacade.java b/src/main/java/com/divudi/facade/AbstractFacade.java index cb49d3ba8c..f1093bc4c3 100644 --- a/src/main/java/com/divudi/facade/AbstractFacade.java +++ b/src/main/java/com/divudi/facade/AbstractFacade.java @@ -369,9 +369,7 @@ public List findLightsByJpql(String jpql, Map parameters, Tem return resultList; } - - - + public List findLightsByJpql(String jpql, Map parameters, TemporalType tt, int maxRecords) { Query qry = getEntityManager().createQuery(jpql); Set> entries = parameters.entrySet(); @@ -1036,6 +1034,28 @@ public List findAggregates(String jpql) { } } + public Double findSingleResultByJpql(String jpql, Map parameters, TemporalType tt) { + TypedQuery qry = getEntityManager().createQuery(jpql, Double.class); + Set> entries = parameters.entrySet(); + + for (Map.Entry entry : entries) { + String paramName = entry.getKey(); + Object paramValue = entry.getValue(); + + if (paramValue instanceof Date) { + qry.setParameter(paramName, (Date) paramValue, tt); + } else { + qry.setParameter(paramName, paramValue); + } + } + + try { + return qry.getSingleResult(); + } catch (NoResultException e) { + return null; + } + } + public List findAggregates(String jpql, Map parameters, TemporalType tt) { TypedQuery qry = getEntityManager().createQuery(jpql, Object[].class); Set s = parameters.entrySet(); @@ -1127,6 +1147,28 @@ public Object[] findSingleAggregate(String jpql, Map parameters) return findSingleAggregate(jpql, parameters, TemporalType.DATE); } + public Double findSingleResultByJpql(String jpql, Map parameters) { + TypedQuery qry = getEntityManager().createQuery(jpql, Double.class); + Set> entries = parameters.entrySet(); + + for (Map.Entry entry : entries) { + String paramName = entry.getKey(); + Object paramValue = entry.getValue(); + + if (paramValue instanceof Date) { + qry.setParameter(paramName, (Date) paramValue, TemporalType.DATE); + } else { + qry.setParameter(paramName, paramValue); + } + } + + try { + return qry.getSingleResult(); + } catch (NoResultException e) { + return null; + } + } + public Object[] findSingleAggregate(String jpql, Map parameters, TemporalType tt) { // //////// // System.out.println("find aggregates 3"); TypedQuery qry = getEntityManager().createQuery(jpql, Object[].class); diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 1ee756bff4..e7d5b37cc4 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,14 +2,14 @@ - jdbc/sethma + jdbc/demos false - jdbc/sethmaAudit + jdbc/demoaudit false diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 2ef047d83a..d92795745e 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /sethma + /sethmademo diff --git a/src/main/webapp/cashier/initial_fund_bill.xhtml b/src/main/webapp/cashier/initial_fund_bill.xhtml index cb67355dff..1cbf1d878a 100644 --- a/src/main/webapp/cashier/initial_fund_bill.xhtml +++ b/src/main/webapp/cashier/initial_fund_bill.xhtml @@ -5,12 +5,15 @@ xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:prints="http://xmlns.jcp.org/jsf/composite/ezcomp/prints" + xmlns:ftm="http://xmlns.jcp.org/jsf/composite/ezcomp/ftm" + xmlns:pa="http://xmlns.jcp.org/jsf/composite/paymentMethod" xmlns:f="http://xmlns.jcp.org/jsf/core"> + @@ -40,111 +43,11 @@
- - - -
- - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- + - - + + +
- - - - - - - - - - - - - - - - - -
Total Value - -
Denominations
- - - - - -
- - - - - - - - - - - - - - - - - - - - + + -
- - - -
-
- -
-
- - - -
-
-
-
+ + + - - - - - - -
- -
-
- -
-
- - - -
-
-
- - - - - - - -
-
- #{bp.currencyDenominationsJson} -
- - - - - - -
-
+ + diff --git a/src/main/webapp/cashier/initial_fund_bill_list.xhtml b/src/main/webapp/cashier/initial_fund_bill_list.xhtml index 624a2a7437..97ce2d8a01 100644 --- a/src/main/webapp/cashier/initial_fund_bill_list.xhtml +++ b/src/main/webapp/cashier/initial_fund_bill_list.xhtml @@ -79,7 +79,7 @@ ajax="false" class="ui-button-danger" value="View Summery - Not Closed" - action="#{financialTransactionController.navigateToViewStartToEndOfSelectedShiftStartSummaryBill(ssb)}" + action="#{financialTransactionController.navigateToViewShiftSratToNow(ssb)}" > @@ -87,7 +87,7 @@ ajax="false" class="ui-button-success" value="View Closed Summery" - action="#{financialTransactionController.navigateToViewEndOfSelectedShiftStartSummaryBill(ssb)}" + action="#{financialTransactionController.navigateToViewShiftSrartToEnd(ssb)}" > diff --git a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml new file mode 100644 index 0000000000..bd4bc0f5fc --- /dev/null +++ b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + +
+
+    + +
+
+ +
+
+ +
+ + + +
+
+ Staff Details +
+
+

Staff: #{financialTransactionController.nonClosedShiftStartFundBill.staff.person.nameWithTitle}

+

Total Value: + + + +

+

Duration: + #{financialTransactionController.calculateDuration( + financialTransactionController.nonClosedShiftStartFundBill.createdAt, + financialTransactionController.nonClosedShiftStartFundBill.referenceBill.createdAt)} +

+
+
+
+ + +
+
+ Shift Start +
+
+

Start Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.id}

+

Start: + + + +

+
+
+
+ + +
+
+ Shift End +
+
+

End Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.referenceBill.id}

+

End: + + + +

+
+
+
+ + +
+
+ Shift Status +
+
+

Shift is not yet ended.

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Service + + Collected + + Refunds + + Payments + + Net +
+ Channelling + + + + + + + + + + + + + + + + +
+ OPD + + + + + + + + + + + + + + + + +
+
+ + +
+ + + +
+
+
+ +
+ diff --git a/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user.xhtml b/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user.xhtml new file mode 100644 index 0000000000..ef79f99a58 --- /dev/null +++ b/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user.xhtml @@ -0,0 +1,500 @@ + + + + + + + + + + + + + + + + + + +
+
+ Staff Details +
+
+

Staff: #{financialTransactionController.nonClosedShiftStartFundBill.staff.person.nameWithTitle}

+

Total Value: + + + +

+

Duration: + #{financialTransactionController.calculateDuration( + financialTransactionController.nonClosedShiftStartFundBill.createdAt, + financialTransactionController.nonClosedShiftStartFundBill.referenceBill.createdAt)} +

+
+
+
+ + +
+
+ Shift Start +
+
+

Start Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.id}

+

Start: + + + +

+
+
+
+ + +
+
+ Shift End +
+
+

End Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.referenceBill.id}

+

End: + + + +

+
+
+
+ + +
+
+ Shift Status +
+
+

Shift is not yet ended.

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CategoryInOutNet TotalNet Cash Total
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Float My-Safe (Start Funds) + + + + + + + + + +
Float Collected Handovers + + + + + + + + + + + + + + + + +
Bank Transaction + + + + + + + + + + + + + + + + + +
Cash In / Outs + + + + + + + + + + + + + + + + + +
Total + + + + + +
Short/Excess + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + +
+
+
+ +
+ diff --git a/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user_not_closed.xhtml b/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user_not_closed.xhtml deleted file mode 100644 index dbc4eeee0a..0000000000 --- a/src/main/webapp/cashier/shift_end_summery_bill_of_selected_user_not_closed.xhtml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - -
- -
-
- - - -
-
- No Start Fund Bill Available to Close -
-
-
-
- - -
-
-
- -
- diff --git a/src/main/webapp/resources/ezcomp/shift_end_summary_table_admin.xhtml b/src/main/webapp/resources/ezcomp/shift_end_summary_table_admin.xhtml deleted file mode 100644 index d645c87dc7..0000000000 --- a/src/main/webapp/resources/ezcomp/shift_end_summary_table_admin.xhtml +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - -
-
-    - -
-
- -
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CategoryInOutNet TotalNet Cash Total
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Float My-Safe (Start Funds) - - - - - - - - - -
Float Collected Handovers - - - - - - - - - - - - - - - - -
Bank Transaction - - - - - - - - - - - - - - - - - -
Cash In / Outs - - - - - - - - - - - - - - - - - -
Total - - - - - -
Short/Excess - - - - - - - - - - -
- - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- \ No newline at end of file From f6a80bfa3a93d7f5d1469b7ee8246fd175017f20 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Mon, 22 Jul 2024 23:38:06 +0530 Subject: [PATCH 17/21] Signed-off-by: buddhika75 --- .../bean/cashTransaction/FinancialTransactionController.java | 3 +-- src/main/webapp/cashier/initial_fund_bill_list.xhtml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index eb27746abe..7c122d7f2c 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -22,7 +22,6 @@ import com.divudi.data.FinancialReport; import com.divudi.data.PaymentMethod; import com.divudi.data.PaymentMethodValues; - import com.divudi.data.ReportTemplateRow; import com.divudi.data.ReportTemplateRowBundle; import com.divudi.data.ServiceType; @@ -43,7 +42,6 @@ import java.util.stream.Collectors; import javax.ejb.EJB; import javax.faces.event.AjaxBehaviorEvent; -import javax.faces.event.ValueChangeEvent; import javax.inject.Inject; import javax.persistence.TemporalType; import org.json.JSONArray; @@ -1770,6 +1768,7 @@ public void setSelectedBill(Bill selectedBill) { } // + public List getFundBillsForClosureBills() { return fundBillsForClosureBills; } diff --git a/src/main/webapp/cashier/initial_fund_bill_list.xhtml b/src/main/webapp/cashier/initial_fund_bill_list.xhtml index 97ce2d8a01..8b9d2e1560 100644 --- a/src/main/webapp/cashier/initial_fund_bill_list.xhtml +++ b/src/main/webapp/cashier/initial_fund_bill_list.xhtml @@ -4,7 +4,6 @@ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui" - xmlns:prints="http://xmlns.jcp.org/jsf/composite/ezcomp/prints" xmlns:f="http://xmlns.jcp.org/jsf/core"> From 59cde4526c10e4d89218da4c44f4d6601184feea Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Tue, 23 Jul 2024 07:43:07 +0530 Subject: [PATCH 18/21] Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 117 ++++++- .../analytics/ReportTemplateController.java | 114 ++++++- .../java/com/divudi/data/BillTypeAtomic.java | 321 +++++++++--------- .../com/divudi/data/CountedServiceType.java | 28 ++ .../com/divudi/data/ReportTemplateRow.java | 55 +++ .../divudi/data/ReportTemplateRowBundle.java | 49 +++ ...ift_end_report_bill_of_selected_user.xhtml | 4 +- ...end_report_bill_of_selected_user_opd.xhtml | 141 ++++++++ 8 files changed, 667 insertions(+), 162 deletions(-) create mode 100644 src/main/java/com/divudi/data/CountedServiceType.java create mode 100644 src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 7c122d7f2c..52bb58c0c1 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -18,6 +18,7 @@ import com.divudi.data.BillCategory; import com.divudi.data.BillFinanceType; import com.divudi.data.BillTypeAtomic; +import com.divudi.data.CountedServiceType; import com.divudi.data.Denomination; import com.divudi.data.FinancialReport; import com.divudi.data.PaymentMethod; @@ -27,6 +28,7 @@ import com.divudi.data.ServiceType; import com.divudi.data.analytics.ReportTemplateType; import com.divudi.data.dataStructure.PaymentMethodData; +import com.divudi.entity.Category; import com.divudi.entity.WebUser; import com.divudi.java.CommonFunctions; import javax.inject.Named; @@ -89,6 +91,7 @@ public class FinancialTransactionController implements Serializable { private ReportTemplateRowBundle opdBilled; private ReportTemplateRowBundle opdReturns; + private ReportTemplateRowBundle opdBundle; private ReportTemplateRowBundle channellingBilled; private ReportTemplateRowBundle channellingReturns; private ReportTemplateRowBundle pharmacyBilld; @@ -298,6 +301,107 @@ public void processShiftEndReport() { nonClosedShiftStartFundBill.getReferenceBill().getId()); } + private ReportTemplateRowBundle combineBundlesByCategory(ReportTemplateRowBundle inBundle, ReportTemplateRowBundle outBundle) { + ReportTemplateRowBundle temOutBundle = new ReportTemplateRowBundle(); + Map combinedRows = new HashMap<>(); + + if (inBundle != null && inBundle.getReportTemplateRows() != null) { + for (ReportTemplateRow inRow : inBundle.getReportTemplateRows()) { + if (inRow != null) { + Category c = inRow.getCategory(); + if (c != null) { + if (!combinedRows.containsKey(c)) { + combinedRows.put(c, new ReportTemplateRow(c)); + } + ReportTemplateRow combinedRow = combinedRows.get(c); + combinedRow.setRowCountIn((combinedRow.getRowCountIn() != null ? combinedRow.getRowCountIn() : 0L) + (inRow.getRowCount() != null ? inRow.getRowCount() : 0L)); + combinedRow.setRowValueIn((combinedRow.getRowValueIn() != null ? combinedRow.getRowValueIn() : 0.0) + (inRow.getRowValue() != null ? inRow.getRowValue() : 0.0)); + } + } + } + } + + if (outBundle != null && outBundle.getReportTemplateRows() != null) { + for (ReportTemplateRow outRow : outBundle.getReportTemplateRows()) { + if (outRow != null) { + Category c = outRow.getCategory(); + if (c != null) { + if (!combinedRows.containsKey(c)) { + combinedRows.put(c, new ReportTemplateRow(c)); + } + ReportTemplateRow combinedRow = combinedRows.get(c); + combinedRow.setRowCountOut((combinedRow.getRowCountOut() != null ? combinedRow.getRowCountOut() : 0L) + (outRow.getRowCount() != null ? outRow.getRowCount() : 0L)); + combinedRow.setRowValueOut((combinedRow.getRowValueOut() != null ? combinedRow.getRowValueOut() : 0.0) + (outRow.getRowValue() != null ? outRow.getRowValue() : 0.0)); + } + } + } + } + + long totalInCount = 0; + long totalOutCount = 0; + double totalInValue = 0.0; + double totalOutValue = 0.0; + + for (ReportTemplateRow row : combinedRows.values()) { + row.setRowCount((row.getRowCountIn() != null ? row.getRowCountIn() : 0L) + (row.getRowCountOut() != null ? row.getRowCountOut() : 0L)); + row.setRowValue((row.getRowValueIn() != null ? row.getRowValueIn() : 0.0) + (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0)); + temOutBundle.getReportTemplateRows().add(row); + + totalInCount += (row.getRowCountIn() != null ? row.getRowCountIn() : 0L); + totalOutCount += (row.getRowCountOut() != null ? row.getRowCountOut() : 0L); + totalInValue += (row.getRowValueIn() != null ? row.getRowValueIn() : 0.0); + totalOutValue += (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0); + } + + temOutBundle.setCountIn(totalInCount); + temOutBundle.setCountOut(totalOutCount); + temOutBundle.setCount(totalInCount + totalOutCount); + temOutBundle.setTotalIn(totalInValue); + temOutBundle.setTotalOut(totalOutValue); + temOutBundle.setTotal(totalInValue + totalOutValue); + + return temOutBundle; + } + + public void processShiftEndReportOpdCategory() { + List bts = new ArrayList<>(); + bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN)); + bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD)); + opdBilled = reportTemplateController.generateReport( + ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL, + BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdReturns = reportTemplateController.generateReport( + ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL, + BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdBundle = combineBundlesByCategory(opdBilled, opdReturns); + } + public String navigateToListShiftEndSummaries() { resetClassVariables(); return "/cashier/initial_fund_bill_list?faces-redirect=true;"; @@ -338,6 +442,10 @@ public String navigateToCashierReport() { return "/cashier/shift_end_report_bill_of_selected_user?faces-redirect=true"; } + public String navigateToCashierReportOpd() { + return "/cashier/shift_end_report_bill_of_selected_user_opd?faces-redirect=true"; + } + public String navigateToCashierSummaryBreakdown() { return "/cashier/shift_end_summary_breakdown?faces-redirect=true"; } @@ -1768,7 +1876,6 @@ public void setSelectedBill(Bill selectedBill) { } // - public List getFundBillsForClosureBills() { return fundBillsForClosureBills; } @@ -2230,4 +2337,12 @@ public void setPharmacyReturned(ReportTemplateRowBundle pharmacyReturned) { this.pharmacyReturned = pharmacyReturned; } + public ReportTemplateRowBundle getOpdBundle() { + return opdBundle; + } + + public void setOpdBundle(ReportTemplateRowBundle opdBundle) { + this.opdBundle = opdBundle; + } + } diff --git a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java index f9050ac8ae..48efd2f292 100644 --- a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java +++ b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java @@ -988,8 +988,8 @@ private ReportTemplateRowBundle handleBillTypeAtomicTotalUsingBills( jpql += " and bill.creditCompany=:cc "; parameters.put("cc", paramCreditCompany); } - - if (paramUser != null) { + + if (paramUser != null) { jpql += " and bill.creater=:wu "; parameters.put("wu", paramUser); } @@ -997,10 +997,8 @@ private ReportTemplateRowBundle handleBillTypeAtomicTotalUsingBills( System.out.println("jpql = " + jpql); System.out.println("parameters = " + parameters); - Double sumResult = ejbFacade.findSingleResultByJpql(jpql, parameters, TemporalType.DATE); - if (sumResult != null) { totalNetAmount = sumResult; } @@ -1376,7 +1374,113 @@ private ReportTemplateRowBundle handleItemCategorySummaryByBill( Institution paramCreditCompany, Long paramStartId, Long paramEndId) { - return new ReportTemplateRowBundle(); + + String jpql; + Map parameters = new HashMap<>(); + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); + + jpql = "select new com.divudi.data.ReportTemplateRow(" + + " bi.item.category, count(bi), sum(bi.netValue)) " + + " from BillItem bi" + + " join bi.bill bill " + + " where bill.retired<>:br " + + " and bi.retired<>:br "; + parameters.put("br", true); + + if (btas != null) { + jpql += " and bill.billTypeAtomic in :btas "; + parameters.put("btas", btas); + } + + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramUser != null) { + jpql += " and bill.creater=:wu "; + parameters.put("wu", paramUser); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:creditCompany "; + parameters.put("creditCompany", paramCreditCompany); + } + + jpql += " and bi.item is not null " + + " and bi.item.category is not null "; + + jpql += " group by bi.item.category "; + + System.out.println("jpql = " + jpql); + System.out.println("parameters = " + parameters); + + List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE); + + if (rs == null || rs.isEmpty()) { + System.out.println("No results found."); + } else { + System.out.println("Results found: " + rs.size()); + } + + long idCounter = 1; + Double total = 0.0; + for (ReportTemplateRow row : rs) { + row.setId(idCounter++); + total = row.getRowValue(); + } + bundle.setReportTemplateRows(rs); + return bundle; } private ReportTemplateRowBundle handleToDepartmentSummaryByBillFee( diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java index 2a0c32ec4b..831d4ae081 100644 --- a/src/main/java/com/divudi/data/BillTypeAtomic.java +++ b/src/main/java/com/divudi/data/BillTypeAtomic.java @@ -1,7 +1,3 @@ -/* - * Dr M H B Ariyaratne - * buddhika.ari@gmail.com - */ package com.divudi.data; import java.util.Arrays; @@ -9,174 +5,177 @@ import java.util.stream.Collectors; /** - * @author Buddhika + * Enumerates types of bills for atomic billing purposes. + * Includes categorization by service type and finance type. */ public enum BillTypeAtomic { - //INWARD - INWARD_PHARMACY_REQUEST("Inward Request Medicines From Pharmacy", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BATCH_BILL("Inward Service Batch Bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BATCH_BILL_CANCELLATION("Inward Service Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BILL("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_BATCH_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - INWARD_SERVICE_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - //Store - STORE_ORDER("Store Order", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN), - STORE_ORDER_PRE("Store Order Pre", BillCategory.BILL, ServiceType.STORE, BillFinanceType.NO_FINANCE_TRANSACTIONS), - STORE_ORDER_CANCELLED("Store Order Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_ORDER_APPROVAL("Store Order Approval", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN), - STORE_ORDER_APPROVAL_CANCELLED("Store Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_DIRECT_PURCHASE("Store Direct Purchase", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN), - STORE_DIRECT_PURCHASE_CANCELLED("Store Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_DIRECT_PURCHASE_REFUND("Store Direct Purchase Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_GRN("Store GRN", BillCategory.PAYMENTS, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_GRN_CANCELLED("Store GRN Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_GRN_REFUND("Store GRN Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT), - STORE_GRN_RETURN("Store GRN Return", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_IN), - // Pharmacy - PHARMACY_RETAIL_SALE("Pharmacy Retail Sale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_RETAIL_SALE_PRE("Pharmacy Retail Sale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), + // INWARD + INWARD_PHARMACY_REQUEST("Inward Request Medicines From Pharmacy", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BATCH_BILL("Inward Service Batch Bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BATCH_BILL_CANCELLATION("Inward Service Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BILL("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_BATCH_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + INWARD_SERVICE_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD), + // STORE + STORE_ORDER("Store Order", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE), + STORE_ORDER_PRE("Store Order Pre", BillCategory.BILL, ServiceType.STORE, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.STORE), + STORE_ORDER_CANCELLED("Store Order Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_ORDER_APPROVAL("Store Order Approval", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE), + STORE_ORDER_APPROVAL_CANCELLED("Store Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_DIRECT_PURCHASE("Store Direct Purchase", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE), + STORE_DIRECT_PURCHASE_CANCELLED("Store Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_DIRECT_PURCHASE_REFUND("Store Direct Purchase Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_GRN("Store GRN", BillCategory.PAYMENTS, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_GRN_CANCELLED("Store GRN Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_GRN_REFUND("Store GRN Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE), + STORE_GRN_RETURN("Store GRN Return", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE), + // PHARMACY + PHARMACY_RETAIL_SALE("Pharmacy Retail Sale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_PRE("Pharmacy Retail Sale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), @Deprecated - PHARMACY_RETAIL_SALE_PRE_SETTLE_AT_CASHIER("NOT USED - Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_RETAIL_SALE_PREBILL_SETTLED_AT_CASHIER("Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER("Pharmacy Retail Sale Pre Bill To Settle At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_RETAIL_SALE_CANCELLED("Pharmacy Retail Sale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_RETAIL_SALE_REFUND("Pharmacy Retail Sale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_RETAIL_SALE_RETURN_ITEMS_ONLY("Pharmacy Retail Sale Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_RETAIL_SALE_RETURN_ITEM_PAYMENTS("Pharmacy Retail Sale Return Item Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_RETAIL_SALE_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Retail Sale Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_SALE_WITHOUT_STOCK("Pharmacy Sale Without Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_SALE_WITHOUT_STOCK_PRE("Pharmacy Sale Without Stock Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_SALE_WITHOUT_STOCK_CANCELLED("Pharmacy Sale Without Stock Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_SALE_WITHOUT_STOCK_REFUND("Pharmacy Sale Without Stock Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_RETAIL_SALE_PRE_ADD_TO_STOCK("Pharmacy Retail Sale Pre Bill Add to Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_WHOLESALE("Pharmacy Wholesale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_WHOLESALE_PRE("Pharmacy Wholesale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_WHOLESALE_CANCELLED("Pharmacy Wholesale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_WHOLESALE_REFUND("Pharmacy Wholesale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_ORDER("Pharmacy Order", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_ORDER_PRE("Pharmacy Order Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_ORDER_CANCELLED("Pharmacy Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_ORDER_APPROVAL("Pharmacy Order Approval", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_ORDER_APPROVAL_CANCELLED("Pharmacy Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_DIRECT_PURCHASE("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_DIRECT_PURCHASE_CANCELLED("Pharmacy Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_DIRECT_PURCHASE_REFUND("Pharmacy Direct Purchase Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_GRN("Pharmacy GRN", BillCategory.PAYMENTS, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_GRN_PRE("Pharmacy GRN Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_GRN_WHOLESALE("Pharmacy Wholesale GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_GRN_CANCELLED("Pharmacy GRN Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_GRN_REFUND("Pharmacy GRN Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_GRN_RETURN("Pharmacy GRN Return", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_CANCELLED("Pharmacy Direct Purchase - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_REFUND("Pharmacy Direct Purchase - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_WHOLESALE_GRN_BILL("Pharmacy GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_WHOLESALE_GRN_BILL_CANCELLED("Pharmacy GRN - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_WHOLESALE_GRN_BILL_REFUND("Pharmacy GRN - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_GRN_PAYMENT("GRN Payment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - PHARMACY_GRN_PAYMENT_CANCELLED("GRN Payment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_ADJUSTMENT("Pharmacy Adjustment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_ADJUSTMENT_CANCELLED("Pharmacy Adjustment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_TRANSFER_REQUEST("Pharmacy Transfer Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_TRANSFER_REQUEST_PRE("Pharmacy Transfer Request Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_TRANSFER_REQUEST_CANCELLED("Pharmacy Transfer Request Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_ISSUE("Pharmacy Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_ISSUE_CANCELLED("Pharmacy Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_DIRECT_ISSUE("Pharmacy Direct Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_DIRECT_ISSUE_CANCELLED("Pharmacy Direct Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_RECEIVE_PRE("Pharmacy Receive Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), + PHARMACY_RETAIL_SALE_PRE_SETTLE_AT_CASHIER("NOT USED - Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_PREBILL_SETTLED_AT_CASHIER("Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER("Pharmacy Retail Sale Pre Bill To Settle At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_CANCELLED("Pharmacy Retail Sale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_REFUND("Pharmacy Retail Sale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_RETURN_ITEMS_ONLY("Pharmacy Retail Sale Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_RETURN_ITEM_PAYMENTS("Pharmacy Retail Sale Return Item Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Retail Sale Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_SALE_WITHOUT_STOCK("Pharmacy Sale Without Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_SALE_WITHOUT_STOCK_PRE("Pharmacy Sale Without Stock Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_SALE_WITHOUT_STOCK_CANCELLED("Pharmacy Sale Without Stock Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_SALE_WITHOUT_STOCK_REFUND("Pharmacy Sale Without Stock Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_RETAIL_SALE_PRE_ADD_TO_STOCK("Pharmacy Retail Sale Pre Bill Add to Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE("Pharmacy Wholesale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_PRE("Pharmacy Wholesale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_CANCELLED("Pharmacy Wholesale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_REFUND("Pharmacy Wholesale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_ORDER("Pharmacy Order", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_ORDER_PRE("Pharmacy Order Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_ORDER_CANCELLED("Pharmacy Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_ORDER_APPROVAL("Pharmacy Order Approval", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_ORDER_APPROVAL_CANCELLED("Pharmacy Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_DIRECT_PURCHASE("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_DIRECT_PURCHASE_CANCELLED("Pharmacy Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_DIRECT_PURCHASE_REFUND("Pharmacy Direct Purchase Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_GRN("Pharmacy GRN", BillCategory.PAYMENTS, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_GRN_PRE("Pharmacy GRN Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_GRN_WHOLESALE("Pharmacy Wholesale GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_GRN_CANCELLED("Pharmacy GRN Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_GRN_REFUND("Pharmacy GRN Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_GRN_RETURN("Pharmacy GRN Return", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_CANCELLED("Pharmacy Direct Purchase - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_REFUND("Pharmacy Direct Purchase - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_GRN_BILL("Pharmacy GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_GRN_BILL_CANCELLED("Pharmacy GRN - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_WHOLESALE_GRN_BILL_REFUND("Pharmacy GRN - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_GRN_PAYMENT("GRN Payment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + PHARMACY_GRN_PAYMENT_CANCELLED("GRN Payment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_ADJUSTMENT("Pharmacy Adjustment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_ADJUSTMENT_CANCELLED("Pharmacy Adjustment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_TRANSFER_REQUEST("Pharmacy Transfer Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_TRANSFER_REQUEST_PRE("Pharmacy Transfer Request Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_TRANSFER_REQUEST_CANCELLED("Pharmacy Transfer Request Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_ISSUE("Pharmacy Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_ISSUE_CANCELLED("Pharmacy Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_DIRECT_ISSUE("Pharmacy Direct Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_DIRECT_ISSUE_CANCELLED("Pharmacy Direct Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_RECEIVE_PRE("Pharmacy Receive Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), + PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), @Deprecated - PHARMACY_RETURN_ITEMS_Only("Pharmacy Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), + PHARMACY_RETURN_ITEMS_Only("Pharmacy Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), @Deprecated - PHARMACY_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT), - PHARMACY_RETURN_ITEMS_AND_PAYMENTS_CANCELLATION("Pharmacy Return Items And Payments Cancellation", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_IN), - MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL("Multiple Pharmacy Purchase Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), + PHARMACY_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY), + PHARMACY_RETURN_ITEMS_AND_PAYMENTS_CANCELLATION("Pharmacy Return Items And Payments Cancellation", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY), + MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL("Multiple Pharmacy Purchase Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY), // CHANNELLING - CHANNEL_BOOKING_WITH_PAYMENT("Channel Booking and Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN), - CHANNEL_BOOKING_FOR_PAYMENT_ONLINE_PENDING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), - CHANNEL_RESHEDULE_WITH_PAYMENT("Channel Reshedule for paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), - CHANNEL_RESHEDULE_WITH_OUT_PAYMENT("Channel Reshedule For Non Paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), + CHANNEL_BOOKING_WITH_PAYMENT("Channel Booking and Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN, CountedServiceType.CHANNELLING), + CHANNEL_BOOKING_FOR_PAYMENT_ONLINE_PENDING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), + CHANNEL_RESHEDULE_WITH_PAYMENT("Channel Reshedule for paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), + CHANNEL_RESHEDULE_WITH_OUT_PAYMENT("Channel Reshedule For Non Paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), @Deprecated - CHANNEL_BOOKING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), - CHANNEL_BOOKING_WITH_PAYMENT_ONLINE("Channel Booking Online Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.ONLINE_PAYMENT_IN), - CHANNEL_BOOKING_WITHOUT_PAYMENT("Channel Booking without Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), - CHANNEL_PAYMENT_FOR_BOOKING_BILL("Channel Payment for Booking", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN), - CHANNEL_CANCELLATION_WITH_PAYMENT("Channel Cancellation with Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - CHANNEL_CANCELLATION_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Cancellation with Payment for Bills Where Credit Payment was Settled", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - CHANNEL_REFUND_WITH_PAYMENT("Channel Refund with Payment", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - CHANNEL_REFUND_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Refund with Payment for Bills where Credit Payment was Settled", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - CHANNEL_CANCELLATION_WITHOUT_PAYMENT("Channel Cancellation without Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), - CHANNEL_REFUND("Channel Refund", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), + CHANNEL_BOOKING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), + CHANNEL_BOOKING_WITH_PAYMENT_ONLINE("Channel Booking Online Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.ONLINE_PAYMENT_IN, CountedServiceType.CHANNELLING), + CHANNEL_BOOKING_WITHOUT_PAYMENT("Channel Booking without Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), + CHANNEL_PAYMENT_FOR_BOOKING_BILL("Channel Payment for Booking", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN, CountedServiceType.CHANNELLING), + CHANNEL_CANCELLATION_WITH_PAYMENT("Channel Cancellation with Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + CHANNEL_CANCELLATION_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Cancellation with Payment for Bills Where Credit Payment was Settled", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + CHANNEL_REFUND_WITH_PAYMENT("Channel Refund with Payment", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + CHANNEL_REFUND_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Refund with Payment for Bills where Credit Payment was Settled", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + CHANNEL_CANCELLATION_WITHOUT_PAYMENT("Channel Cancellation without Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING), + CHANNEL_REFUND("Channel Refund", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), // OPD - OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN), - OPD_BATCH_BILL_WITH_PAYMENT("Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN), - OPD_BATCH_BILL_CANCELLATION("Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - OPD_BILL_WITH_PAYMENT("OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - OPD_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT), - OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT), - OPD_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT), - OPD_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_OUT), + OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE), + OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.NONE), + OPD_BATCH_BILL_WITH_PAYMENT("Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.NONE), + OPD_BATCH_BILL_CANCELLATION("Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE), + OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE), + OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + OPD_BILL_WITH_PAYMENT("OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + OPD_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), + OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), + OPD_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), + OPD_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_PROFESSIONAL_PAYMENT), @Deprecated - OPD_BILL_WITH_PAYMENT_UNDER_BATCH_BILL("OPD Bill with payment under batch bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - //Packages - PACKAGE_OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PACKAGE_OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN), - PACKAGE_OPD_BATCH_BILL_WITH_PAYMENT("Package Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN), - PACKAGE_OPD_BATCH_BILL_CANCELLATION("Package Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PACKAGE_OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PACKAGE_OPD_BILL_WITH_PAYMENT("Package OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS), - PACKAGE_OPD_BILL_CANCELLATION("Package Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT), - PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Package Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT), - PACKAGE_OPD_BILL_REFUND("Package Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT), - // Collecting Centre - CC_BATCH_BILL("Collecting Centre Batch Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN), - CC_BATCH_BILL_CANCELLATION("Collecting Centre Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT), - CC_BILL("Collecting Centre Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN), - CC_BILL_CANCELLATION("Collecting Centre Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT), - CC_BILL_REFUND("Collecting Centre Bill Refund", BillCategory.REFUND, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT), - // Float Transactions - FUND_SHIFT_START_BILL("Shift Start Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE), - FUND_SHIFT_START_BILL_CANCELLED("Shift Start Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE), - FUND_SHIFT_END_BILL("Shift End Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE), - FUND_SHIFT_END_BILL_CANCELLED("Shift End Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE), - FUND_TRANSFER_BILL("Fund Transfer Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE), - FUND_TRANSFER_BILL_CANCELLED("Fund Transfer Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE), - FUND_TRANSFER_RECEIVED_BILL("Fund Transfer Received Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE), - FUND_TRANSFER_RECEIVED_BILL_CANCELLED("Fund Transfer Received Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE), - FUND_DEPOSIT_BILL("Deposit Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_OUT), - FUND_DEPOSIT_BILL_CANCELLED("Deposit Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_IN), - FUND_WITHDRAWAL_BILL("Withdrawal Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_IN), - FUND_WITHDRAWAL_BILL_CANCELLED("Withdrawal Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_OUT), - // Professional Payments - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_IN), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_IN), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT), - PETTY_CASH_ISSUE("Petty Cash Issue", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT), - PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN), - IOU_CASH_ISSUE("Iou Cash Issue", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_OUT), - IOU_CASH_RETURN("Iou Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN); + OPD_BILL_WITH_PAYMENT_UNDER_BATCH_BILL("OPD Bill with payment under batch bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + // PACKAGES + PACKAGE_OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + PACKAGE_OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD), + PACKAGE_OPD_BATCH_BILL_WITH_PAYMENT("Package Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD), + PACKAGE_OPD_BATCH_BILL_CANCELLATION("Package Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + PACKAGE_OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + PACKAGE_OPD_BILL_WITH_PAYMENT("Package OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD), + PACKAGE_OPD_BILL_CANCELLATION("Package Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD), + PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Package Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD), + PACKAGE_OPD_BILL_REFUND("Package Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD), + // COLLECTING CENTRE + CC_BATCH_BILL("Collecting Centre Batch Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN, CountedServiceType.COLLECTING_CENTRE), + CC_BATCH_BILL_CANCELLATION("Collecting Centre Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE), + CC_BILL("Collecting Centre Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN, CountedServiceType.COLLECTING_CENTRE), + CC_BILL_CANCELLATION("Collecting Centre Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE), + CC_BILL_REFUND("Collecting Centre Bill Refund", BillCategory.REFUND, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE), + // FLOAT TRANSACTIONS + FUND_SHIFT_START_BILL("Shift Start Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE, CountedServiceType.OTHER), + FUND_SHIFT_START_BILL_CANCELLED("Shift Start Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE, CountedServiceType.OTHER), + FUND_SHIFT_END_BILL("Shift End Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE, CountedServiceType.OTHER), + FUND_SHIFT_END_BILL_CANCELLED("Shift End Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE, CountedServiceType.OTHER), + FUND_TRANSFER_BILL("Fund Transfer Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE, CountedServiceType.OTHER), + FUND_TRANSFER_BILL_CANCELLED("Fund Transfer Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE, CountedServiceType.OTHER), + FUND_TRANSFER_RECEIVED_BILL("Fund Transfer Received Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE, CountedServiceType.OTHER), + FUND_TRANSFER_RECEIVED_BILL_CANCELLED("Fund Transfer Received Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE, CountedServiceType.OTHER), + FUND_DEPOSIT_BILL("Deposit Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_OUT, CountedServiceType.OTHER), + FUND_DEPOSIT_BILL_CANCELLED("Deposit Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_IN, CountedServiceType.OTHER), + FUND_WITHDRAWAL_BILL("Withdrawal Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_IN, CountedServiceType.OTHER), + FUND_WITHDRAWAL_BILL_CANCELLED("Withdrawal Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_OUT, CountedServiceType.OTHER), + // PROFESSIONAL PAYMENTS + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_IN, CountedServiceType.INWARD), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD), + PETTY_CASH_ISSUE("Petty Cash Issue", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), + PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), + IOU_CASH_ISSUE("Iou Cash Issue", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), + IOU_CASH_RETURN("Iou Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER); private final String label; private final BillCategory billCategory; private final ServiceType serviceType; private final BillFinanceType billFinanceType; + private final CountedServiceType countedServiceType; - BillTypeAtomic(String label, BillCategory billCategory, ServiceType serviceType, BillFinanceType billFinanceType) { + BillTypeAtomic(String label, BillCategory billCategory, ServiceType serviceType, BillFinanceType billFinanceType, CountedServiceType countedServiceType) { this.label = label; this.billCategory = billCategory; this.serviceType = serviceType; this.billFinanceType = billFinanceType; + this.countedServiceType = countedServiceType; } public String getLabel() { @@ -192,7 +191,11 @@ public ServiceType getServiceType() { } public BillFinanceType getBillFinanceType() { - return billFinanceType; // This is the getter method you need + return billFinanceType; + } + + public CountedServiceType getCountedServiceType() { + return countedServiceType; } // Method to find BillTypeAtomic by BillFinanceType @@ -202,6 +205,7 @@ public static List findByFinanceType(BillFinanceType financeType .collect(Collectors.toList()); } + // Method to find BillTypeAtomic by BillCategory public static List findByCategory(BillCategory category) { return Arrays.stream(BillTypeAtomic.values()) .filter(e -> e.getBillCategory() == category) @@ -214,18 +218,25 @@ public static List findByServiceType(ServiceType serviceType) { .filter(e -> e.getServiceType() == serviceType) .collect(Collectors.toList()); } + + // Method to find BillTypeAtomic by ServiceType + public static List findByCountedServiceType(CountedServiceType counterServiceType) { + return Arrays.stream(BillTypeAtomic.values()) + .filter(e -> e.getCountedServiceType() == counterServiceType) + .collect(Collectors.toList()); + } -// Method to find BillTypeAtomic by ServiceType and BillFinanceType + // Method to find BillTypeAtomic by ServiceType and BillFinanceType public static List findByServiceTypeAndFinanceType(ServiceType serviceType, BillFinanceType financeType) { return Arrays.stream(BillTypeAtomic.values()) .filter(e -> e.getServiceType() == serviceType && e.getBillFinanceType() == financeType) .collect(Collectors.toList()); } + // Method to find BillTypeAtomic by ServiceType and BillCategory public static List findBillTypeAtomic(ServiceType serviceType, BillCategory billCategory) { return Arrays.stream(BillTypeAtomic.values()) .filter(e -> e.getServiceType() == serviceType && e.getBillCategory() == billCategory) .collect(Collectors.toList()); } - } diff --git a/src/main/java/com/divudi/data/CountedServiceType.java b/src/main/java/com/divudi/data/CountedServiceType.java new file mode 100644 index 0000000000..8594ce6689 --- /dev/null +++ b/src/main/java/com/divudi/data/CountedServiceType.java @@ -0,0 +1,28 @@ +package com.divudi.data; + +/** + * Enumerates types of services for billing purposes, categorizing bills by the type of service provided. + */ +public enum CountedServiceType { + + OPD("Outpatient Department"), + OPD_OUT("Outpatient Department - Cancellation or Refunds"), + OPD_PROFESSIONAL_PAYMENT("Outpatient Department - Professional Payment"), + NONE("NONE"), + PHARMACY("Pharmacy"), + STORE("Store"), + CHANNELLING("Channelling"), + COLLECTING_CENTRE("Colelcting Centre"), + OTHER("Other"), + INWARD("Inward"); + + private final String label; + + CountedServiceType(String label) { + this.label = label; + } + + public String getLabel() { + return label; + } +} diff --git a/src/main/java/com/divudi/data/ReportTemplateRow.java b/src/main/java/com/divudi/data/ReportTemplateRow.java index 965710e6d9..0fa0e6158e 100644 --- a/src/main/java/com/divudi/data/ReportTemplateRow.java +++ b/src/main/java/com/divudi/data/ReportTemplateRow.java @@ -16,6 +16,10 @@ public class ReportTemplateRow { private String itemName; private String paymentName; private Double rowValue; + private Double rowValueIn; + private Double rowValueOut; + private Long rowCountIn; + private Long rowCountOut; private Long rowCount; private Long id; @@ -25,6 +29,13 @@ public class ReportTemplateRow { private Institution creditCompany; private Department toDepartment; + public ReportTemplateRow(Category c) { + this.category = c; + } + + + + public void setFeeName(String feeName) { this.feeName = feeName; } @@ -87,6 +98,18 @@ public ReportTemplateRow(String feeName, String categoryName, String toDepartmen this.rowCount = rowCount; } + public ReportTemplateRow(String categoryName, Long rowCount, Double rowValue) { + this.categoryName = categoryName; + this.rowValue = rowValue; + this.rowCount = rowCount; + } + + public ReportTemplateRow(Category category, Long rowCount, Double rowValue) { + this.category = category; + this.rowValue = rowValue; + this.rowCount = rowCount; + } + public ReportTemplateRow(String categoryName, Double rowValue) { this.categoryName = categoryName; this.rowValue = rowValue; @@ -173,4 +196,36 @@ public String getFeeName() { return feeName; } + public Double getRowValueIn() { + return rowValueIn; + } + + public void setRowValueIn(Double rowValueIn) { + this.rowValueIn = rowValueIn; + } + + public Double getRowValueOut() { + return rowValueOut; + } + + public void setRowValueOut(Double rowValueOut) { + this.rowValueOut = rowValueOut; + } + + public Long getRowCountIn() { + return rowCountIn; + } + + public void setRowCountIn(Long rowCountIn) { + this.rowCountIn = rowCountIn; + } + + public Long getRowCountOut() { + return rowCountOut; + } + + public void setRowCountOut(Long rowCountOut) { + this.rowCountOut = rowCountOut; + } + } diff --git a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java index 64c6f2a08e..f48f2f9685 100644 --- a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java +++ b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java @@ -13,7 +13,16 @@ public class ReportTemplateRowBundle { private ReportTemplate reportTemplate; private List reportTemplateRows; private Double total; + private Double totalIn; + private Double totalOut; + private Long countIn; + private Long countOut; + private Long count; + + + + public ReportTemplate getReportTemplate() { return reportTemplate; } @@ -41,6 +50,46 @@ public void setTotal(Double total) { this.total = total; } + public Double getTotalIn() { + return totalIn; + } + + public void setTotalIn(Double totalIn) { + this.totalIn = totalIn; + } + + public Double getTotalOut() { + return totalOut; + } + + public void setTotalOut(Double totalOut) { + this.totalOut = totalOut; + } + + public Long getCountIn() { + return countIn; + } + + public void setCountIn(Long countIn) { + this.countIn = countIn; + } + + public Long getCountOut() { + return countOut; + } + + public void setCountOut(Long countOut) { + this.countOut = countOut; + } + + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + diff --git a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml index bd4bc0f5fc..04623bc714 100644 --- a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml +++ b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml @@ -145,7 +145,9 @@ - OPD + + diff --git a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml new file mode 100644 index 0000000000..882281f506 --- /dev/null +++ b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + +
+
+    + +
+
+ +
+
+ +
+ + + +
+
+ Staff Details +
+
+

Staff: #{financialTransactionController.nonClosedShiftStartFundBill.staff.person.nameWithTitle}

+

Total Value: + + + +

+

Duration: + #{financialTransactionController.calculateDuration( + financialTransactionController.nonClosedShiftStartFundBill.createdAt, + financialTransactionController.nonClosedShiftStartFundBill.referenceBill.createdAt)} +

+
+
+
+ + +
+
+ Shift Start +
+
+

Start Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.id}

+

Start: + + + +

+
+
+
+ + +
+
+ Shift End +
+
+

End Bill ID: #{financialTransactionController.nonClosedShiftStartFundBill.referenceBill.id}

+

End: + + + +

+
+
+
+ + +
+
+ Shift Status +
+
+

Shift is not yet ended.

+
+
+
+
+ +

#{financialTransactionController.opdBilled.reportTemplateRows}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+ +
+ From 7a46eb68f0cf035a3c34cc6a51540fe8451db67e Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Tue, 23 Jul 2024 08:50:08 +0530 Subject: [PATCH 19/21] Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 73 +++++- .../analytics/ReportTemplateController.java | 133 ++++++++++- .../com/divudi/data/ReportTemplateRow.java | 18 ++ .../data/analytics/ReportTemplateType.java | 1 + ...end_report_bill_of_selected_user_opd.xhtml | 207 ++++++++++++++++-- 5 files changed, 410 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 52bb58c0c1..1817f53dae 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -83,6 +83,7 @@ public class FinancialTransactionController implements Serializable { // private Bill currentBill; + private ReportTemplateType reportTemplateType; private ReportTemplateRowBundle reportTemplateRowBundle; private ReportTemplateRowBundle opdServiceBundle; private ReportTemplateRowBundle channellingBundle; @@ -364,11 +365,12 @@ private ReportTemplateRowBundle combineBundlesByCategory(ReportTemplateRowBundle } public void processShiftEndReportOpdCategory() { + reportTemplateType=ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM; List bts = new ArrayList<>(); bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN)); bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD)); opdBilled = reportTemplateController.generateReport( - ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL, + ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM, BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD), null, null, @@ -384,7 +386,47 @@ public void processShiftEndReportOpdCategory() { nonClosedShiftStartFundBill.getId(), nonClosedShiftStartFundBill.getReferenceBill().getId()); opdReturns = reportTemplateController.generateReport( - ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL, + ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM, + BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdBundle = combineBundlesByCategory(opdBilled, opdReturns); + } + + public void processShiftEndReportOpdItem() { + reportTemplateType=ReportTemplateType.ITEM_SUMMARY_BY_BILL; + List bts = new ArrayList<>(); + bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN)); + bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD)); + opdBilled = reportTemplateController.generateReport( + ReportTemplateType.ITEM_SUMMARY_BY_BILL, + BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD), + null, + null, + null, + null, + null, + null, + null, + null, + null, + nonClosedShiftStartFundBill.getCreater(), + null, + nonClosedShiftStartFundBill.getId(), + nonClosedShiftStartFundBill.getReferenceBill().getId()); + opdReturns = reportTemplateController.generateReport( + ReportTemplateType.ITEM_SUMMARY_BY_BILL, BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT), null, null, @@ -439,10 +481,12 @@ public String navigateToCashierSummary() { } public String navigateToCashierReport() { + processShiftEndReport(); return "/cashier/shift_end_report_bill_of_selected_user?faces-redirect=true"; } public String navigateToCashierReportOpd() { + resetBundles(); return "/cashier/shift_end_report_bill_of_selected_user_opd?faces-redirect=true"; } @@ -2226,6 +2270,8 @@ public ReportTemplateRowBundle getPaymentSummaryBundle() { } return paymentSummaryBundle; } + + public void setPaymentSummaryBundle(ReportTemplateRowBundle paymentSummaryBundle) { this.paymentSummaryBundle = paymentSummaryBundle; @@ -2345,4 +2391,27 @@ public void setOpdBundle(ReportTemplateRowBundle opdBundle) { this.opdBundle = opdBundle; } + private void resetBundles() { + reportTemplateRowBundle = new ReportTemplateRowBundle(); + opdServiceBundle = new ReportTemplateRowBundle(); + channellingBundle = new ReportTemplateRowBundle(); + opdDocPayment = new ReportTemplateRowBundle(); + channellingDocPayment = new ReportTemplateRowBundle(); + opdBilled = new ReportTemplateRowBundle(); + opdReturns = new ReportTemplateRowBundle(); + opdBundle = new ReportTemplateRowBundle(); + channellingBilled = new ReportTemplateRowBundle(); + channellingReturns = new ReportTemplateRowBundle(); + pharmacyBilld = new ReportTemplateRowBundle(); + pharmacyReturned = new ReportTemplateRowBundle(); + } + + public ReportTemplateType getReportTemplateType() { + return reportTemplateType; + } + + public void setReportTemplateType(ReportTemplateType reportTemplateType) { + this.reportTemplateType = reportTemplateType; + } + } diff --git a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java index 48efd2f292..b5c36190e8 100644 --- a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java +++ b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java @@ -445,9 +445,8 @@ public ReportTemplateRowBundle generateReport( paramStartId, paramEndId); break; - case ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM: - bundle = handleItemCategorySummaryByBillItem( - btas, + case ITEM_SUMMARY_BY_BILL: + bundle =handleItemSummaryByBill(btas, paramDate, paramFromDate, paramToDate, @@ -462,6 +461,7 @@ public ReportTemplateRowBundle generateReport( paramStartId, paramEndId); break; + case ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM: case ITEM_CATEGORY_SUMMARY_BY_BILL: bundle = handleItemCategorySummaryByBill( btas, @@ -513,6 +513,7 @@ public ReportTemplateRowBundle generateReport( paramStartId, paramEndId); break; + case TO_DEPARTMENT_SUMMARY_BY_BILL: bundle = handleToDepartmentSummaryByBill( btas, @@ -1483,6 +1484,132 @@ private ReportTemplateRowBundle handleItemCategorySummaryByBill( return bundle; } + + private ReportTemplateRowBundle handleItemSummaryByBill( + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + + String jpql; + Map parameters = new HashMap<>(); + ReportTemplateRowBundle bundle = new ReportTemplateRowBundle(); + + jpql = "select new com.divudi.data.ReportTemplateRow(" + + " bi.item, count(bi), sum(bi.netValue)) " + + " from BillItem bi" + + " join bi.bill bill " + + " where bill.retired<>:br " + + " and bi.retired<>:br "; + parameters.put("br", true); + + if (btas != null) { + jpql += " and bill.billTypeAtomic in :btas "; + parameters.put("btas", btas); + } + + if (paramDate != null) { + jpql += " and bill.billDate=:bd "; + parameters.put("bd", paramDate); + } + + if (paramToDate != null) { + jpql += " and bill.billDate < :td "; + parameters.put("td", paramToDate); + } + + if (paramFromDate != null) { + jpql += " and bill.billDate > :fd "; + parameters.put("fd", paramFromDate); + } + + if (paramStartId != null) { + jpql += " and bill.id > :sid "; + parameters.put("sid", paramStartId); + } + + if (paramEndId != null) { + jpql += " and bill.id < :eid "; + parameters.put("eid", paramEndId); + } + + if (paramInstitution != null) { + jpql += " and bill.institution=:ins "; + parameters.put("ins", paramInstitution); + } + + if (paramDepartment != null) { + jpql += " and bill.department=:dep "; + parameters.put("dep", paramDepartment); + } + + if (paramFromInstitution != null) { + jpql += " and bill.fromInstitution=:fins "; + parameters.put("fins", paramFromInstitution); + } + + if (paramFromDepartment != null) { + jpql += " and bill.fromDepartment=:fdep "; + parameters.put("fdep", paramFromDepartment); + } + + if (paramToInstitution != null) { + jpql += " and bill.toInstitution=:tins "; + parameters.put("tins", paramToInstitution); + } + + if (paramToDepartment != null) { + jpql += " and bill.toDepartment=:tdep "; + parameters.put("tdep", paramToDepartment); + } + + if (paramUser != null) { + jpql += " and bill.creater=:wu "; + parameters.put("wu", paramUser); + } + + if (paramCreditCompany != null) { + jpql += " and bill.creditCompany=:creditCompany "; + parameters.put("creditCompany", paramCreditCompany); + } + + jpql += " and bi.item is not null "; + + jpql += " group by bi.item "; + + System.out.println("jpql = " + jpql); + System.out.println("parameters = " + parameters); + + List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE); + + if (rs == null || rs.isEmpty()) { + System.out.println("No results found."); + } else { + System.out.println("Results found: " + rs.size()); + } + + long idCounter = 1; + Double total = 0.0; + for (ReportTemplateRow row : rs) { + row.setId(idCounter++); + total = row.getRowValue(); + } + bundle.setReportTemplateRows(rs); + return bundle; + } + + + private ReportTemplateRowBundle handleToDepartmentSummaryByBillFee( List btas, Date paramDate, diff --git a/src/main/java/com/divudi/data/ReportTemplateRow.java b/src/main/java/com/divudi/data/ReportTemplateRow.java index 0fa0e6158e..d473d30b5a 100644 --- a/src/main/java/com/divudi/data/ReportTemplateRow.java +++ b/src/main/java/com/divudi/data/ReportTemplateRow.java @@ -3,6 +3,7 @@ import com.divudi.entity.Category; import com.divudi.entity.Department; import com.divudi.entity.Institution; +import com.divudi.entity.Item; /** * @@ -24,6 +25,7 @@ public class ReportTemplateRow { private Long id; private Category category; + private Item item; private ServiceType serviceType; private BillTypeAtomic billTypeAtomic; private Institution creditCompany; @@ -109,6 +111,12 @@ public ReportTemplateRow(Category category, Long rowCount, Double rowValue) { this.rowValue = rowValue; this.rowCount = rowCount; } + + public ReportTemplateRow(Item item, Long rowCount, Double rowValue) { + this.item = item; + this.rowValue = rowValue; + this.rowCount = rowCount; + } public ReportTemplateRow(String categoryName, Double rowValue) { this.categoryName = categoryName; @@ -146,6 +154,8 @@ public void setId(Long id) { public Category getCategory() { return category; } + + public void setCategory(Category category) { this.category = category; @@ -228,4 +238,12 @@ public void setRowCountOut(Long rowCountOut) { this.rowCountOut = rowCountOut; } + public Item getItem() { + return item; + } + + public void setItem(Item item) { + this.item = item; + } + } diff --git a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java index cda5be1e92..d5126234a5 100644 --- a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java +++ b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java @@ -24,6 +24,7 @@ public enum ReportTemplateType { ITEM_CATEGORY_SUMMARY_BY_BILL_FEE("Item Category Summary by Bill Fee"), ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM("Item Category Summary by Bill Item"), ITEM_CATEGORY_SUMMARY_BY_BILL("Item Category Summary by Bill"), + ITEM_SUMMARY_BY_BILL("Item Summary by Bill"), TO_DEPARTMENT_SUMMARY_BY_BILL_FEE("To Department Summary by Bill Fee"), TO_DEPARTMENT_SUMMARY_BY_BILL_ITEM("To Department Summary by Bill Item"), TO_DEPARTMENT_SUMMARY_BY_BILL("To Department Summary by Bill"); diff --git a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml index 882281f506..0eabcd6d9f 100644 --- a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml +++ b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user_opd.xhtml @@ -27,6 +27,10 @@ ajax="false" value="Process by Category" action="#{financialTransactionController.processShiftEndReportOpdCategory()}" > +
@@ -98,34 +102,203 @@ -

#{financialTransactionController.opdBilled.reportTemplateRows}

- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - + + + - - + + + - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + From 54d661215bb4f1e173ab0887e7de31e52d53b9d3 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Tue, 23 Jul 2024 09:04:44 +0530 Subject: [PATCH 20/21] Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 75 +++++++++++++++++-- .../com/divudi/data/ReportTemplateRow.java | 25 +++---- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 1817f53dae..51b327f53d 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -29,6 +29,7 @@ import com.divudi.data.analytics.ReportTemplateType; import com.divudi.data.dataStructure.PaymentMethodData; import com.divudi.entity.Category; +import com.divudi.entity.Item; import com.divudi.entity.WebUser; import com.divudi.java.CommonFunctions; import javax.inject.Named; @@ -302,6 +303,68 @@ public void processShiftEndReport() { nonClosedShiftStartFundBill.getReferenceBill().getId()); } + private ReportTemplateRowBundle combineBundlesByItem(ReportTemplateRowBundle inBundle, ReportTemplateRowBundle outBundle) { + ReportTemplateRowBundle temOutBundle = new ReportTemplateRowBundle(); + Map combinedRows = new HashMap<>(); + + if (inBundle != null && inBundle.getReportTemplateRows() != null) { + for (ReportTemplateRow inRow : inBundle.getReportTemplateRows()) { + if (inRow != null) { + Item item = inRow.getItem(); + if (item != null) { + if (!combinedRows.containsKey(item)) { + combinedRows.put(item, new ReportTemplateRow(item)); + } + ReportTemplateRow combinedRow = combinedRows.get(item); + combinedRow.setRowCountIn((combinedRow.getRowCountIn() != null ? combinedRow.getRowCountIn() : 0L) + (inRow.getRowCount() != null ? inRow.getRowCount() : 0L)); + combinedRow.setRowValueIn((combinedRow.getRowValueIn() != null ? combinedRow.getRowValueIn() : 0.0) + (inRow.getRowValue() != null ? inRow.getRowValue() : 0.0)); + } + } + } + } + + if (outBundle != null && outBundle.getReportTemplateRows() != null) { + for (ReportTemplateRow outRow : outBundle.getReportTemplateRows()) { + if (outRow != null) { + Item item = outRow.getItem(); + if (item != null) { + if (!combinedRows.containsKey(item)) { + combinedRows.put(item, new ReportTemplateRow(item)); + } + ReportTemplateRow combinedRow = combinedRows.get(item); + combinedRow.setRowCountOut((combinedRow.getRowCountOut() != null ? combinedRow.getRowCountOut() : 0L) + (outRow.getRowCount() != null ? outRow.getRowCount() : 0L)); + combinedRow.setRowValueOut((combinedRow.getRowValueOut() != null ? combinedRow.getRowValueOut() : 0.0) + (outRow.getRowValue() != null ? outRow.getRowValue() : 0.0)); + } + } + } + } + + long totalInCount = 0; + long totalOutCount = 0; + double totalInValue = 0.0; + double totalOutValue = 0.0; + + for (ReportTemplateRow row : combinedRows.values()) { + row.setRowCount((row.getRowCountIn() != null ? row.getRowCountIn() : 0L) + (row.getRowCountOut() != null ? row.getRowCountOut() : 0L)); + row.setRowValue((row.getRowValueIn() != null ? row.getRowValueIn() : 0.0) + (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0)); + temOutBundle.getReportTemplateRows().add(row); + + totalInCount += (row.getRowCountIn() != null ? row.getRowCountIn() : 0L); + totalOutCount += (row.getRowCountOut() != null ? row.getRowCountOut() : 0L); + totalInValue += (row.getRowValueIn() != null ? row.getRowValueIn() : 0.0); + totalOutValue += (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0); + } + + temOutBundle.setCountIn(totalInCount); + temOutBundle.setCountOut(totalOutCount); + temOutBundle.setCount(totalInCount + totalOutCount); + temOutBundle.setTotalIn(totalInValue); + temOutBundle.setTotalOut(totalOutValue); + temOutBundle.setTotal(totalInValue + totalOutValue); + + return temOutBundle; + } + private ReportTemplateRowBundle combineBundlesByCategory(ReportTemplateRowBundle inBundle, ReportTemplateRowBundle outBundle) { ReportTemplateRowBundle temOutBundle = new ReportTemplateRowBundle(); Map combinedRows = new HashMap<>(); @@ -365,7 +428,7 @@ private ReportTemplateRowBundle combineBundlesByCategory(ReportTemplateRowBundle } public void processShiftEndReportOpdCategory() { - reportTemplateType=ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM; + reportTemplateType = ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM; List bts = new ArrayList<>(); bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN)); bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD)); @@ -403,9 +466,9 @@ public void processShiftEndReportOpdCategory() { nonClosedShiftStartFundBill.getReferenceBill().getId()); opdBundle = combineBundlesByCategory(opdBilled, opdReturns); } - - public void processShiftEndReportOpdItem() { - reportTemplateType=ReportTemplateType.ITEM_SUMMARY_BY_BILL; + + public void processShiftEndReportOpdItem() { + reportTemplateType = ReportTemplateType.ITEM_SUMMARY_BY_BILL; List bts = new ArrayList<>(); bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN)); bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD)); @@ -441,7 +504,7 @@ public void processShiftEndReportOpdItem() { null, nonClosedShiftStartFundBill.getId(), nonClosedShiftStartFundBill.getReferenceBill().getId()); - opdBundle = combineBundlesByCategory(opdBilled, opdReturns); + opdBundle = combineBundlesByItem(opdBilled, opdReturns); } public String navigateToListShiftEndSummaries() { @@ -2270,8 +2333,6 @@ public ReportTemplateRowBundle getPaymentSummaryBundle() { } return paymentSummaryBundle; } - - public void setPaymentSummaryBundle(ReportTemplateRowBundle paymentSummaryBundle) { this.paymentSummaryBundle = paymentSummaryBundle; diff --git a/src/main/java/com/divudi/data/ReportTemplateRow.java b/src/main/java/com/divudi/data/ReportTemplateRow.java index d473d30b5a..af872807d9 100644 --- a/src/main/java/com/divudi/data/ReportTemplateRow.java +++ b/src/main/java/com/divudi/data/ReportTemplateRow.java @@ -34,9 +34,11 @@ public class ReportTemplateRow { public ReportTemplateRow(Category c) { this.category = c; } - - - + + public ReportTemplateRow(Item item) { + this.item = item; + + } public void setFeeName(String feeName) { this.feeName = feeName; @@ -99,30 +101,30 @@ public ReportTemplateRow(String feeName, String categoryName, String toDepartmen this.rowValue = rowValue; this.rowCount = rowCount; } - + public ReportTemplateRow(String categoryName, Long rowCount, Double rowValue) { this.categoryName = categoryName; this.rowValue = rowValue; this.rowCount = rowCount; } - - public ReportTemplateRow(Category category, Long rowCount, Double rowValue) { + + public ReportTemplateRow(Category category, Long rowCount, Double rowValue) { this.category = category; this.rowValue = rowValue; this.rowCount = rowCount; } - - public ReportTemplateRow(Item item, Long rowCount, Double rowValue) { + + public ReportTemplateRow(Item item, Long rowCount, Double rowValue) { this.item = item; this.rowValue = rowValue; this.rowCount = rowCount; } - + public ReportTemplateRow(String categoryName, Double rowValue) { this.categoryName = categoryName; this.rowValue = rowValue; } - + public ReportTemplateRow(BillTypeAtomic billTypeAtomic, String categoryName, String toDepartmentName, Double rowValue) { this.billTypeAtomic = billTypeAtomic; this.categoryName = categoryName; @@ -135,7 +137,6 @@ public ReportTemplateRow(BillTypeAtomic billTypeAtomic, Double rowValue) { this.rowValue = rowValue; } - public ReportTemplateRow(Double rowValue) { this.rowValue = rowValue; } @@ -154,8 +155,6 @@ public void setId(Long id) { public Category getCategory() { return category; } - - public void setCategory(Category category) { this.category = category; From 9ca0ae3d4f86e7bd5dcecfe849b704a32d49c6ed Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Tue, 23 Jul 2024 20:28:31 +0530 Subject: [PATCH 21/21] closes#6508 --- .../divudi/bean/common/SearchController.java | 2 +- src/main/resources/META-INF/persistence.xml | 4 +- .../pharmacy/pharmacy_search_issue_bill.xhtml | 23 ++-- .../pharmacy_search_issue_bill_item.xhtml | 106 +++++++++--------- 4 files changed, 64 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index ac6e2a3754..96aa4f769c 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -3330,7 +3330,7 @@ public void createPharmacyIssueBillItemTable() { sql += " order by bi.id desc "; - billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); + billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP); } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index e7d5b37cc4..6d8623993e 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,14 +2,14 @@ - jdbc/demos + jdbc/arogya false - jdbc/demoaudit + jdbc/arogyaAudit false diff --git a/src/main/webapp/pharmacy/pharmacy_search_issue_bill.xhtml b/src/main/webapp/pharmacy/pharmacy_search_issue_bill.xhtml index 8063598ba3..c56bd65fa7 100644 --- a/src/main/webapp/pharmacy/pharmacy_search_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_search_issue_bill.xhtml @@ -70,9 +70,16 @@ > - + + + + + @@ -167,10 +174,6 @@ - -
@@ -193,20 +196,14 @@
- + - - - - - - + diff --git a/src/main/webapp/pharmacy/pharmacy_search_issue_bill_item.xhtml b/src/main/webapp/pharmacy/pharmacy_search_issue_bill_item.xhtml index 6bac039b8c..fdb77b5aac 100644 --- a/src/main/webapp/pharmacy/pharmacy_search_issue_bill_item.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_search_issue_bill_item.xhtml @@ -13,51 +13,51 @@ - +
- - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
- + + + - +  -  - - - - + + @@ -121,16 +124,9 @@ - + - - - - - -