From 6f2836aba3434e1341d6b40f6e7c2026f401c91f Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Tue, 6 Aug 2024 12:53:42 +0530 Subject: [PATCH] closes#6784 Signed-off-by: DamithDeshan --- .../divudi/bean/common/SearchController.java | 34 +++-- .../resources/store/inward/issueBill.xhtml | 2 - .../webapp/store/store_retail_sale_bht.xhtml | 25 ++-- .../store/store_search_sale_bill_bht.xhtml | 124 ++++++++++-------- 4 files changed, 101 insertions(+), 84 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index 74524d00ee..5940c30192 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -2375,7 +2375,7 @@ public void listPharmacyBills(BillType bt, Class bc) { sql += " and ((b.department.name) like :dep )"; m.put("dep", "%" + getSearchKeyword().getDepartment().trim().toUpperCase() + "%"); } - + if (getSearchKeyword().getToDepartment() != null && !getSearchKeyword().getToDepartment().trim().equals("")) { sql += " and ((b.toDepartment.name) like :dep )"; m.put("dep", "%" + getSearchKeyword().getToDepartment().trim().toUpperCase() + "%"); @@ -2473,7 +2473,6 @@ public void createTableBht(BillType btp) { m.put("fd", getFromDate()); m.put("td", getToDate()); m.put("ins", getSessionController().getInstitution()); - m.put("dep", getSessionController().getDepartment()); String sql; sql = "Select b from Bill b " @@ -2482,9 +2481,18 @@ public void createTableBht(BillType btp) { + " and b.createdAt between :fd and :td " + " and b.billType=:bt" + " and b.institution=:ins " - + " and b.department=:dep " + " and type(b)=:class "; + if (webUserController.hasPrivilege("StoreAdministration")) { + if (getSearchKeyword().getDepartment() != null && !getSearchKeyword().getDepartment().trim().equals("")) { + sql += " and ((b.department.name) like :dep )"; + m.put("dep", "%" + getSearchKeyword().getDepartment().trim().toUpperCase() + "%"); + } + } else { + sql += "and b.department=:dep "; + m.put("dep", getSessionController().getDepartment()); + + } if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) { sql += " and ((b.patientEncounter.patient.person.name) like :patientName )"; m.put("patientName", "%" + getSearchKeyword().getPatientName().trim().toUpperCase() + "%"); @@ -3434,12 +3442,12 @@ public void createStoreIssueBillItemTable() { + " and bi.bill.billType=:bType " + " and bi.createdAt between :fromDate and :toDate "; - if (getSearchKeyword().getToDepartment()!= null && !getSearchKeyword().getToDepartment().trim().equals("")) { + if (getSearchKeyword().getToDepartment() != null && !getSearchKeyword().getToDepartment().trim().equals("")) { sql += " and ((bi.bill.toDepartment.name) like :todept )"; m.put("todept", "%" + getSearchKeyword().getToDepartment().trim().toUpperCase() + "%"); } - - if (getSearchKeyword().getFromDepartment()!= null && !getSearchKeyword().getFromDepartment().trim().equals("")) { + + if (getSearchKeyword().getFromDepartment() != null && !getSearchKeyword().getFromDepartment().trim().equals("")) { sql += " and ((bi.bill.fromDepartment.name) like :fromdept )"; m.put("fromdept", "%" + getSearchKeyword().getFromDepartment().trim().toUpperCase() + "%"); } @@ -4482,7 +4490,7 @@ public void createDueFeeTable() { sql += " and ((b.billItem.item.name) like :staff )"; temMap.put("staff", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%"); } - + if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) { sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )"; temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%"); @@ -4555,7 +4563,7 @@ public void createDueFeeTableAll() { sql += " and ((b.billItem.item.name) like :staff )"; temMap.put("staff", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%"); } - + if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) { sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )"; temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%"); @@ -5150,7 +5158,7 @@ public void createPaymentTable() { sql += " and b.paidForBillFee.bill.creditCompany=:cc "; temMap.put("cc", getReportKeyWord().getInstitution()); } - + if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) { sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )"; temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%"); @@ -5219,7 +5227,7 @@ public void createPaymentTableAll() { sql += " and b.paidForBillFee.bill.creditCompany=:cc "; temMap.put("cc", getReportKeyWord().getInstitution()); } - + if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) { sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )"; temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%"); @@ -7114,18 +7122,18 @@ public void createStaffCreditBillList() { + "and b.cancelled = false " + "and b.refunded = false "; jpql += " and b.billTypeAtomic in :btas "; - + btas.addAll(BillTypeAtomic.findByServiceType(ServiceType.OPD)); btas.addAll(BillTypeAtomic.findByServiceType(ServiceType.CHANNELLING)); btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.PAYMENTS)); btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.CANCELLATION)); btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.REFUND)); - + jpql += " order by b.createdAt desc"; m.put("fromDate", fromDate); m.put("toDate", toDate); - m.put("btas", btas); + m.put("btas", btas); System.out.println("m = " + m); System.out.println("jpql = " + jpql); diff --git a/src/main/webapp/resources/store/inward/issueBill.xhtml b/src/main/webapp/resources/store/inward/issueBill.xhtml index 7e947e49a6..4ded7130db 100644 --- a/src/main/webapp/resources/store/inward/issueBill.xhtml +++ b/src/main/webapp/resources/store/inward/issueBill.xhtml @@ -207,8 +207,6 @@ - -
diff --git a/src/main/webapp/store/store_retail_sale_bht.xhtml b/src/main/webapp/store/store_retail_sale_bht.xhtml index f76e051f1d..34ff5fb2e5 100644 --- a/src/main/webapp/store/store_retail_sale_bht.xhtml +++ b/src/main/webapp/store/store_retail_sale_bht.xhtml @@ -103,7 +103,7 @@
-
+
- - + - + - - - + + + - + - + @@ -141,9 +144,9 @@ autocomplete="off" accesskey="q" id="txtQty" + style="width: 150px;" value="#{storeSaleBhtController.qty}" placeholder="Quantity" - class="mx-5" > diff --git a/src/main/webapp/store/store_search_sale_bill_bht.xhtml b/src/main/webapp/store/store_search_sale_bill_bht.xhtml index 6999455310..289b9fbc49 100644 --- a/src/main/webapp/store/store_search_sale_bill_bht.xhtml +++ b/src/main/webapp/store/store_search_sale_bill_bht.xhtml @@ -14,64 +14,79 @@ - - - - - - - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + + + - + - - - - - + + +
+
- + - - + + + + @@ -82,7 +97,7 @@ - + @@ -90,13 +105,13 @@ - +
- +
@@ -111,20 +126,12 @@
- + - - - - - - @@ -168,8 +175,9 @@
- - +
+
+