From e10ff4847caee3da7870b9dbc383e469262eb42d Mon Sep 17 00:00:00 2001 From: Senula88 Date: Thu, 18 Apr 2024 08:42:29 +0530 Subject: [PATCH 1/4] Signed-off-by: Senula88 --- src/main/resources/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/version.txt b/src/main/resources/version.txt index 23b593ca7d..041265944c 100644 --- a/src/main/resources/version.txt +++ b/src/main/resources/version.txt @@ -1 +1 @@ -3.0.0.20240417.7 +3.0.0.20240417.12 From d1e44dcf9e4f36dc053cb3d48df54156dc3592b6 Mon Sep 17 00:00:00 2001 From: Senula88 Date: Thu, 18 Apr 2024 15:26:48 +0530 Subject: [PATCH 2/4] Signed-off-by: Senula88 --- .../divudi/bean/common/SearchController.java | 64 ++++++++- .../bean/pharmacy/PharmacyBillSearch.java | 74 +++++++++- ...armacy_purhcase_order_list_to_cancel.xhtml | 130 ++++++++++++++++++ src/main/webapp/resources/ezcomp/menu.xhtml | 6 + 4 files changed, 266 insertions(+), 8 deletions(-) create mode 100644 src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index b1d13c3108..edb122d6be 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -2292,7 +2292,6 @@ private Bill getActiveRefBillnotApprove(Bill b, BillType billType) { public void makeNull() { searchKeyword = null; bills = null; - } public void createTableByBillType() { @@ -3421,10 +3420,57 @@ public void createApproved(InstitutionType institutionType, BillType bt) { public void createNotApprovedPharmacy() { Date startTime = new Date(); - createNotApproved(InstitutionType.Dealer, BillType.PharmacyOrder); + } + + public void fillOnlySavedPharmacyPo() { + bills =null; + HashMap tmp = new HashMap(); + String sql ; + sql = "Select b From BilledBill b where " + + " b.referenceBill is null " + + " and b.toInstitution.institutionType=:insTp " + + " and b.createdAt between :fromDate and :toDate " + + " and b.retired=false " + + " and b.billType= :bTp " + + " and b.checkedBy is null"; + + sql += " order by b.createdAt desc "; + + tmp.put("toDate", getToDate()); + tmp.put("fromDate", getFromDate()); + tmp.put("insTp", InstitutionType.Dealer); + tmp.put("bTp", BillType.PharmacyOrder); + + bills = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); + + + } + + public void fillOnlyFinalizedPharmacyPo() { + bills =null; + HashMap tmp = new HashMap(); + String sql ; + sql = "Select b From BilledBill b where " + + " b.referenceBill is null " + + " and b.toInstitution.institutionType=:insTp " + + " and b.createdAt between :fromDate and :toDate " + + " and b.retired=false " + + " and b.billType= :bTp " + + " and b.checkedBy is not null"; + + sql += " order by b.createdAt desc "; + + tmp.put("toDate", getToDate()); + tmp.put("fromDate", getFromDate()); + tmp.put("insTp", InstitutionType.Dealer); + tmp.put("bTp", BillType.PharmacyOrder); + + bills = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); + + } public void createNotApprovedStore() { @@ -8477,6 +8523,17 @@ public void sendSmsAll() { } } + + public String navigateToCancelPurchaseOrder() { + makeNull(); + Calendar c1 = Calendar.getInstance(); + c1.set(Calendar.MONTH, c1.get(Calendar.MONTH) - 2); + fromDate = c1.getTime(); + Calendar c2 = Calendar.getInstance(); + c2.set(Calendar.MONTH, c2.get(Calendar.MONTH) - 1); + toDate = c2.getTime(); + return "/pharmacy/pharmacy_purhcase_order_list_to_cancel?faces-redirect=true"; + } public void createDocPaymentDue() { if (getReportKeyWord().getString().equals("0")) { @@ -8868,6 +8925,9 @@ public void setMaxResult(int maxResult) { } public List getSelectedBills() { + if(selectedBills == null){ + selectedBills = new ArrayList<>(); + } return selectedBills; } diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java index 396e319792..65f106bd9d 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java @@ -85,6 +85,7 @@ public class PharmacyBillSearch implements Serializable { private boolean printPreview = false; private double refundAmount; String txtSearch; + private String comment; Bill bill; PaymentMethod paymentMethod; PaymentScheme paymentScheme; @@ -478,12 +479,66 @@ public void calTotalSaleRate(Bill bill) { bill.setTransTotalSaleValue(tmp); } - - - public String navigateToViewPharmacyGrn(){ + + private boolean errorsPresentOnPoBillCancellation() { + if (getBill().isCancelled()) { + JsfUtil.addErrorMessage("Already Cancelled. Can not cancel again"); + return true; + } + + if (getBill().isRefunded()) { + JsfUtil.addErrorMessage("Already Returned. Can not cancel."); + return true; + } + + return false; + } + + public String cancelPoBill() { + if (getSelectedBills() == null || getSelectedBills().isEmpty()) { + JsfUtil.addErrorMessage("Please select Bills"); + return ""; + } + if (getComment() == null || getComment().trim().equals("")) { + JsfUtil.addErrorMessage("Please enter a comment"); + return ""; + } + for (Bill selected : selectedBills) { + System.out.println("bill = " + selected.getId()); + setBill(selected); + if (getBill() == null) { + JsfUtil.addErrorMessage("No bill"); + continue; + } + if (getBill().getId() == null) { + JsfUtil.addErrorMessage("No Saved bill"); + continue; + } + + if (errorsPresentOnPoBillCancellation()) { + continue; + } + + CancelledBill cancellationBill = pharmacyCreateCancelBill(); + cancellationBill.setDeptId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getDepartment(), BillType.PharmacyPurchaseBill, BillClassType.CancelledBill, BillNumberSuffix.GRNCAN)); + cancellationBill.setInsId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getInstitution(), BillType.PharmacyPurchaseBill, BillClassType.CancelledBill, BillNumberSuffix.GRNCAN)); + + if (cancellationBill.getId() == null) { + getBillFacade().create(cancellationBill); + } + getBill().setCancelled(true); + getBill().setCancelledBill(cancellationBill); + getBillFacade().edit(getBill()); + JsfUtil.addSuccessMessage("Cancelled"); + + } + + return ""; + } + + public String navigateToViewPharmacyGrn() { return "/pharmacy/pharmacy_reprint_grn?faces-redirect=true;"; } - public String navigateToViewPurchaseOrder() { if (bill == null) { @@ -863,8 +918,7 @@ private CancelledBill pharmacyCreateCancelBill() { cb.setDepartment(getSessionController().getLoggedUser().getDepartment()); cb.setInstitution(getSessionController().getInstitution()); - cb.setComments(getBill().getComments()); - cb.setPaymentMethod(paymentMethod); + cb.setComments(getComment()); return cb; } @@ -3005,4 +3059,12 @@ public void setBillFeePaymentFacade(BillFeePaymentFacade billFeePaymentFacade) { this.billFeePaymentFacade = billFeePaymentFacade; } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + } diff --git a/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml b/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml new file mode 100644 index 0000000000..7eb9920462 --- /dev/null +++ b/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml @@ -0,0 +1,130 @@ + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + +
+ +
+ + + + + + + + + +
+ + + + + + +
+ + + + + + + +
+ + + + + +
+ + + + #{b.toInstitution.name} + + + + + + + #{b.department.name} + + + + + + + + + + +
+
+ +
+
+
+
+
+ +
diff --git a/src/main/webapp/resources/ezcomp/menu.xhtml b/src/main/webapp/resources/ezcomp/menu.xhtml index dc1ca88d57..8a52d6cd99 100644 --- a/src/main/webapp/resources/ezcomp/menu.xhtml +++ b/src/main/webapp/resources/ezcomp/menu.xhtml @@ -575,6 +575,12 @@ icon="fas fa-exchange-alt" rendered="#{webUserController.hasPrivilege('ReturnWithoutRecipt')}" actionListener="#{pharmacyPurchaseController.makeNull()}" > + From e6578564b096895846cb5cb3e7a22e89bc65c532 Mon Sep 17 00:00:00 2001 From: Senula88 Date: Thu, 18 Apr 2024 21:51:33 +0530 Subject: [PATCH 3/4] Signed-off-by: Senula88 --- .../divudi/bean/common/SearchController.java | 240 +++++------------- .../bean/pharmacy/PharmacyBillSearch.java | 2 +- ...armacy_purhcase_order_list_to_cancel.xhtml | 13 +- src/main/webapp/resources/ezcomp/menu.xhtml | 4 +- 4 files changed, 76 insertions(+), 183 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index edb122d6be..87db6f94ab 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -235,7 +235,7 @@ public Bill searchBillFromBillId(Long currentTokenId) { public String settleBillByBarcode() { currentBill = searchBillFromBillId(currentTokenId); String action; - + if (currentBill == null) { JsfUtil.addErrorMessage("No Bill Found"); return ""; @@ -363,7 +363,7 @@ public String toListAllBills() { bills = null; return "/dataAdmin/list_bills?faces-redirect=true"; } - + public String toListAllPayments() { bills = null; return "/dataAdmin/list_payments?faces-redirect=true"; @@ -379,7 +379,7 @@ public void listAllBills() { temMap.put("fromDate", getFromDate()); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); } - + public void listAllPayments() { String sql; Map temMap = new HashMap(); @@ -482,8 +482,6 @@ public void createPatientInvestigationsTableAllTest() { patientInvestigations = getPatientInvestigationFacade().findByJpql(sql, 10); checkRefundBillItems(patientInvestigations); - - } public String navigatToopdSearchProfessionalPaymentDue1() { @@ -647,7 +645,6 @@ public void fillToMyDepartmentPatientInvestigations() { patientInvestigations = getPatientInvestigationFacade().findByJpql(jpql, temMap, TemporalType.TIMESTAMP, 50); checkRefundBillItems(patientInvestigations); - } public void fillToDepartmentPatientInvestigations() { @@ -698,7 +695,6 @@ public void fillToDepartmentPatientInvestigations() { patientInvestigations = getPatientInvestigationFacade().findByJpql(jpql, temMap, TemporalType.TIMESTAMP, 50); checkRefundBillItems(patientInvestigations); - } public void createPreRefundTable() { @@ -750,7 +746,6 @@ public void createPreRefundTable() { bills = getBillFacade().findByJpqlWithoutCache(sql, temMap, TemporalType.TIMESTAMP, 50); Date startTime = new Date(); - } @@ -804,7 +799,6 @@ public void createPreRefundOpdTable() { bills = getBillFacade().findByJpqlWithoutCache(sql, temMap, TemporalType.TIMESTAMP, 50); Date startTime = new Date(); - } @@ -812,14 +806,12 @@ public void reportSettledOPDBills() { Date startTime = new Date(); settledBills(billType.OpdBill); - } public void reportSettledPharmacyBills() { Date startTime = new Date(); settledBills(billType.PharmacyWholeSale); - } public void settledBills(BillType bt) { @@ -862,7 +854,6 @@ public void createCreditBillsWithOPDBill() { Date startTime = new Date(); createCreditBillsWithBill(billType.OpdBill); - } public void createCreditBillsWithPharmacyBill() { @@ -870,7 +861,6 @@ public void createCreditBillsWithPharmacyBill() { createCreditBillsWithBill(billType.PharmacyWholeSale); - } public void createCreditBillsWithBill(BillType refBillType) { @@ -1163,8 +1153,6 @@ public void createReturnSaleBills() { createReturnSaleBills(BillType.PharmacyPre, true); - - } public void createReturnSaleAllBills() { @@ -1172,7 +1160,6 @@ public void createReturnSaleAllBills() { createReturnSaleBills(BillType.PharmacyPre, false); - } public void createReturnWholeSaleBills() { @@ -1271,7 +1258,6 @@ public void createTableByKeywordToPayBills() { //System.err.println("Sql " + sql); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - } public void createTablePharmacyCreditToPayBills() { @@ -1317,8 +1303,6 @@ public void createTablePharmacyCreditToPayBills() { //System.err.println("Sql " + sql); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - - } public void createReturnBhtBills() { @@ -1326,8 +1310,6 @@ public void createReturnBhtBills() { createReturnBhtBills(BillType.PharmacyBhtPre); - - } public void createReturnBhtBillsStore() { @@ -1421,7 +1403,6 @@ public void createVariantReportSearch() { tmp.put("bTp", BillType.PharmacyMajorAdjustment); bills = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP); - } public Department getDepartment() { @@ -1469,8 +1450,6 @@ public void createPharmacyPrescriptionBillTable() { prescreptionBills = getBillFacade().findByJpql(sql, m, TemporalType.TIMESTAMP); - - } public void createPharmacyRetailBills() { @@ -1478,7 +1457,6 @@ public void createPharmacyRetailBills() { createPharmacyRetailBills(BillType.PharmacyPre, true); - } public void createPharmacyWholesaleBills() { @@ -1534,8 +1512,6 @@ public void createPharmacyWholeTableRe() { // //////System.out.println("sql = " + sql); bills = getBillFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void createPharmacyRetailAllBills() { @@ -1543,8 +1519,6 @@ public void createPharmacyRetailAllBills() { createPharmacyRetailBills(BillType.PharmacyPre, false); - - } public void createPharmacyWholesaleAllBills() { @@ -1709,7 +1683,6 @@ public void createPharmacyStaffBill() { auditEvent.setEventStatus("Completed"); auditEventApplicationController.logAuditEvent(auditEvent); - } public void createPharmacyTableRe() { @@ -1755,19 +1728,17 @@ public void createPharmacyTableRe() { sql += " and ((b.total) like :total )"; m.put("total", "%" + getSearchKeyword().getTotal().trim().toUpperCase() + "%"); } - + if (getSearchKeyword().getPatientPhone() != null && !getSearchKeyword().getPatientPhone().trim().equals("")) { sql += " and ((b.patient.person.phone) like :phone )"; m.put("phone", "%" + getSearchKeyword().getPatientPhone().trim().toUpperCase() + "%"); } - + sql += " order by b.createdAt desc "; // // //////System.out.println("sql = " + sql); bills = getBillFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void listPharmacyIssue() { @@ -1775,14 +1746,12 @@ public void listPharmacyIssue() { listPharmacyPreBills(BillType.PharmacyIssue); - } public void listStoreIssue() { Date startTime = new Date(); listPharmacyPreBills(BillType.StoreIssue); - } public void listPharmacyCancelled() { @@ -1794,14 +1763,12 @@ public void listPharmacyReturns() { listPharmacyStoreReturnedBills(BillType.PharmacyIssue); - } public void listStoreReturns() { Date startTime = new Date(); listPharmacyStoreReturnedBills(BillType.StoreIssue); - } public void listPharmacyBilledBills(BillType bt) { @@ -1940,7 +1907,6 @@ public void createPharmacyTableBht() { createTableBht(BillType.PharmacyBhtPre); - } public void createStoreTableIssue() { @@ -1951,7 +1917,6 @@ public void createStoreTableBht() { Date startTime = new Date(); createTableBht(BillType.StoreBhtPre); - } public void createTableBht(BillType btp) { @@ -2048,8 +2013,6 @@ public void createIssueTable() { } - - } public void createIssueReport1() { @@ -2103,7 +2066,6 @@ public void createIssuePharmacyReport() { // fetchPharmacyBills(BillType.PharmacyTransferIssue, BillType.PharmacyTransferReceive); fetchPharmacyBillsNew(BillType.PharmacyTransferIssue, BillType.PharmacyTransferReceive); - } public void createIssueStoreReport() { @@ -2115,7 +2077,6 @@ public void createPoNotPharmacyApproveReport() { fetchPharmacyBills(BillType.PharmacyOrder, BillType.PharmacyAdjustment); - } public void createPoNotStoreApproveReport() { @@ -2251,8 +2212,6 @@ public void createIssueTableStore() { } - - } private Bill getRefBill(Bill b) { @@ -2382,7 +2341,6 @@ public void createTableByBillType() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, maxResult); // //System.err.println("SIZE : " + lst.size()); - } public void createGRNRegistory() { @@ -2562,8 +2520,6 @@ public void createRequestTable() { b.setListOfBill(getIssudBills(b)); } - - } public void createInwardBHTRequestTable() { @@ -2599,8 +2555,6 @@ public void createInwardBHTRequestTable() { b.setListOfBill(getBHTIssudBills(b)); } - - } public void createInwardBHTForIssueTableAll() { @@ -2682,8 +2636,6 @@ public void createInwardBHTForIssueTable(Boolean bool) { } } - - } public long createInwardBHTForIssueBillCount() { @@ -2749,8 +2701,6 @@ public void createRequestTableStore() { b.setListOfBill(getIssudBills(b)); } - - } public void createListToCashRecieve() { @@ -2794,7 +2744,6 @@ public void createPharmacyBillItemTable() { createPharmacyBillItemTable(BillType.PharmacyPre, BillType.PharmacySale); - } public void createPharmacyWholeBillItemTable() { @@ -2897,8 +2846,6 @@ public void createPharmacyIssueBillItemTable() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void createStoreIssueBillItemTable() { @@ -2947,8 +2894,6 @@ public void createStoreIssueBillItemTable() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void createErronousStoreIssueBillItemTable() { @@ -2999,8 +2944,6 @@ public void createErronousStoreIssueBillItemTable() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void createPharmacyAdjustmentBillItemTable() { @@ -3055,7 +2998,6 @@ public void createPharmacyAdjustmentBillItemTable() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - } public void createPharmacyAdjustmentBillItemTableForStockTaking() { @@ -3232,8 +3174,6 @@ public void createStoreAdjustmentBillItemTable() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); - - } public void createDrawerAdjustmentTable() { @@ -3272,7 +3212,6 @@ public void createPharmacyBillItemTableBht() { createBillItemTableBht(BillType.PharmacyBhtPre); - } public void createStoreBillItemTableBht() { @@ -3344,15 +3283,12 @@ public void createPoRequestedAndApprovedPharmacy() { createPoRequestedAndApproved(InstitutionType.Dealer, BillType.PharmacyOrder); - } public void createPoRequestedAndApprovedStore() { Date startTime = new Date(); createPoRequestedAndApproved(InstitutionType.StoreDealor, BillType.StoreOrder); - - } public void createPoRequestedAndApproved(InstitutionType institutionType, BillType bt) { @@ -3383,14 +3319,12 @@ public void createApprovedPharmacy() { createApproved(InstitutionType.Dealer, BillType.PharmacyOrder); - } public void createApprovedStore() { Date startTime = new Date(); createApproved(InstitutionType.StoreDealor, BillType.StoreOrder); - } public void createApproved(InstitutionType institutionType, BillType bt) { @@ -3422,13 +3356,12 @@ public void createNotApprovedPharmacy() { Date startTime = new Date(); createNotApproved(InstitutionType.Dealer, BillType.PharmacyOrder); - } - + public void fillOnlySavedPharmacyPo() { - bills =null; + bills = null; HashMap tmp = new HashMap(); - String sql ; + String sql; sql = "Select b From BilledBill b where " + " b.referenceBill is null " + " and b.toInstitution.institutionType=:insTp " @@ -3437,8 +3370,9 @@ public void fillOnlySavedPharmacyPo() { + " and b.billType= :bTp " + " and b.checkedBy is null"; + sql += createKeySqlSearchForPoCancel(tmp); + sql += " order by b.createdAt desc "; - tmp.put("toDate", getToDate()); tmp.put("fromDate", getFromDate()); tmp.put("insTp", InstitutionType.Dealer); @@ -3446,13 +3380,12 @@ public void fillOnlySavedPharmacyPo() { bills = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); - } - + public void fillOnlyFinalizedPharmacyPo() { - bills =null; + bills = null; HashMap tmp = new HashMap(); - String sql ; + String sql; sql = "Select b From BilledBill b where " + " b.referenceBill is null " + " and b.toInstitution.institutionType=:insTp " @@ -3460,9 +3393,9 @@ public void fillOnlyFinalizedPharmacyPo() { + " and b.retired=false " + " and b.billType= :bTp " + " and b.checkedBy is not null"; + sql += createKeySqlSearchForPoCancel(tmp); sql += " order by b.createdAt desc "; - tmp.put("toDate", getToDate()); tmp.put("fromDate", getFromDate()); tmp.put("insTp", InstitutionType.Dealer); @@ -3470,7 +3403,6 @@ public void fillOnlyFinalizedPharmacyPo() { bills = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); - } public void createNotApprovedStore() { @@ -3478,7 +3410,6 @@ public void createNotApprovedStore() { createNotApproved(InstitutionType.StoreDealor, BillType.StoreOrder); - } public void createNotApproved(InstitutionType institutionType, BillType bt) { @@ -3523,6 +3454,10 @@ public void createNotApproved(InstitutionType institutionType, BillType bt) { + " and b.billType= :bTp "; sql += createKeySql(tmp); + if (getSearchKeyword().getRefBillNo() != null && !getSearchKeyword().getRefBillNo().trim().equals("")) { + sql += " and ((b.deptId) like :billNo )"; + tmp.put("billNo", "%" + getSearchKeyword().getRefBillNo().trim().toUpperCase() + "%"); + } sql += " order by b.createdAt desc "; List lst3 = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); @@ -3532,6 +3467,42 @@ public void createNotApproved(InstitutionType institutionType, BillType bt) { bills = lst1; + } + + private String createKeySqlSearchForPoCancel(HashMap tmp) { + String sql = ""; + if (getSearchKeyword().getToInstitution() != null && !getSearchKeyword().getToInstitution().trim().equals("")) { + sql += " and ((b.toInstitution.name) like :toIns )"; + tmp.put("toIns", "%" + getSearchKeyword().getToInstitution().trim().toUpperCase() + "%"); + } + + if (getSearchKeyword().getCreator() != null && !getSearchKeyword().getCreator().trim().equals("")) { + sql += " and ((b.creater.webUserPerson.name) like :crt )"; + tmp.put("crt", "%" + getSearchKeyword().getCreator().trim().toUpperCase() + "%"); + } + + if (getSearchKeyword().getDepartment() != null && !getSearchKeyword().getDepartment().trim().equals("")) { + sql += " and ((b.department.name) like :crt )"; + tmp.put("crt", "%" + getSearchKeyword().getDepartment().trim().toUpperCase() + "%"); + } + + if (getSearchKeyword().getRefBillNo() != null && !getSearchKeyword().getRefBillNo().trim().equals("")) { + sql += " and ((b.deptId) like :billNo )"; + tmp.put("billNo", "%" + getSearchKeyword().getRefBillNo().trim().toUpperCase() + "%"); + } + + if (getSearchKeyword().getTotal() != null && !getSearchKeyword().getTotal().trim().equals("")) { + sql += " and ((b.netTotal) like :reqTotal )"; + tmp.put("reqTotal", "%" + getSearchKeyword().getTotal().trim().toUpperCase() + "%"); + } + + if (getSearchKeyword().getNetTotal() != null && !getSearchKeyword().getNetTotal().trim().equals("")) { + sql += " and ((b.referenceBill.netTotal) like :appTotal )"; + tmp.put("appTotal", "%" + getSearchKeyword().getNetTotal().trim().toUpperCase() + "%"); + } + + return sql; + } private String createKeySql(HashMap tmp) { @@ -3630,8 +3601,6 @@ public void createGrnTable() { b.setListOfBill(getReturnBill(b, BillType.PharmacyGrnReturn)); } - - } public void createGrnTableStore() { @@ -3659,8 +3628,6 @@ public void createGrnTableStore() { b.setListOfBill(getReturnBill(b, BillType.StoreGrnReturn)); } - - } public void createGrnTableAllIns() { @@ -3687,8 +3654,6 @@ public void createGrnTableAllIns() { b.setListOfBill(getReturnBill(b, BillType.PharmacyGrnReturn)); } - - } public void createGrnTableAllInsStore() { @@ -3715,8 +3680,6 @@ public void createGrnTableAllInsStore() { b.setListOfBill(getReturnBill(b, BillType.StoreGrnReturn)); } - - } private List getReturnBill(Bill b, BillType bt) { @@ -3734,7 +3697,6 @@ public void createPoTablePharmacy() { createPoTable(InstitutionType.Dealer, BillType.PharmacyOrderApprove, BillType.PharmacyGrnBill); - } public void createPoTableStore() { @@ -3742,7 +3704,6 @@ public void createPoTableStore() { createPoTable(InstitutionType.StoreDealor, BillType.StoreOrderApprove, BillType.StoreGrnBill); - } public void createPoTable(InstitutionType institutionType, BillType bt, BillType referenceBillType) { @@ -3900,7 +3861,6 @@ public void createDueFeeTable() { billFees.removeAll(removeingBillFees); calTotal(); - } public void createDueFeeTableAll() { @@ -3967,7 +3927,6 @@ public void createDueFeeTableAll() { billFees.removeAll(removeingBillFees); calTotal(); - } public void createDueFeeTableAndPaidFeeTable() { @@ -4062,7 +4021,6 @@ public void createDueFeeTableAndPaidFeeTable() { doneTotal += bf2.getFeeValue(); } - } double totalPaying; @@ -4106,8 +4064,6 @@ public void fillDocPayingBillFee() { totalPaying += dFee.getPaidForBillFee().getFeeValue(); } - - } public void fillDocPayingBill() { @@ -4229,7 +4185,6 @@ public void createDueFeeTableInward() { billFees.removeAll(removeingBillFees); calTotal(); - } public void createDueFeeTableInwardAll() { @@ -4313,7 +4268,6 @@ public void createDueFeeTableInwardAll() { billFees.removeAll(removeingBillFees); calTotal(); - } public void createDueFeeTableInwardAllWithCancelled() { @@ -4485,7 +4439,6 @@ public void createDueFeeReportInward() { billFees = getBillFeeFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - } public void createPaymentTable() { @@ -4552,8 +4505,6 @@ public void createPaymentTable() { billItems = getBillItemFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createPaymentTableAll() { @@ -4689,8 +4640,6 @@ public void createProfessionalPaymentTableInward() { billItems = getBillItemFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createProfessionalPaymentTableInwardAll() { @@ -4804,7 +4753,6 @@ public void createBillItemTableByKeyword() { checkLabReportsApprovedBillItem(billItems); // searchBillItems = new LazyBillItem(tmp); - } public String toCreateBillItemListForCreditCompany() { @@ -4875,7 +4823,6 @@ public void createBillItemTableByKeywordAll() { checkLabReportsApprovedBillItem(billItems); // searchBillItems = new LazyBillItem(tmp); - } public void createPatientInvestigationsTable() { @@ -4936,7 +4883,6 @@ public void createPatientInvestigationsTable() { patientInvestigations = getPatientInvestigationFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); checkRefundBillItems(patientInvestigations); - } public void createPatientInvestigationsTableByLoggedInstitution() { @@ -5049,7 +4995,6 @@ public void searchPatientInvestigations() { temMap.put("fromDate", getFromDate()); patientInvestigations = getPatientInvestigationFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - } public String fillUserPatientReportMobile() { @@ -5184,8 +5129,6 @@ public void createPatientInvestigationsTableAll() { patientInvestigations = getPatientInvestigationFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); checkRefundBillItems(patientInvestigations); - - } public void searchApprovedReportsWithCancelledOrReturnedBills() { @@ -5318,7 +5261,6 @@ public void createPreBillsForReturn() { createPreBillsForReturn(BillType.PharmacyPre, BillType.PharmacySale); - } public void createWholePreBillsForReturn() { @@ -5404,8 +5346,6 @@ public void addToStock() { createPreBillsNotPaid(); - - } public void cancelIssueToUnitBills() { @@ -5493,7 +5433,6 @@ public void createOpdBathcBillPreTable() { //System.err.println("Sql " + sql); aceptPaymentBills = getBillFacade().findByJpqlWithoutCache(sql, temMap, TemporalType.TIMESTAMP, 25); - } public void createOpdBillSearch() { @@ -5501,7 +5440,6 @@ public void createOpdBillSearch() { createTableByKeyword(BillType.OpdBill); // checkLabReportsApproved(bills); - } public void createOpdBathcBillPreTablePaidOnly() { @@ -5529,7 +5467,6 @@ public void createOpdBathcBillPreTablePaidOnly() { //System.err.println("Sql " + sql); aceptPaymentBills = getBillFacade().findByJpqlWithoutCache(sql, temMap, TemporalType.TIMESTAMP, 25); - } public void createOpdBathcBillPreTableNotPaidOly() { @@ -5584,7 +5521,6 @@ public void createOpdBathcBillPreTableNotPaidOly() { abs.removeAll(pbs); aceptPaymentBills.addAll(abs); - } public String createOpdPreTable() { @@ -5629,19 +5565,19 @@ public String createOpdPreTablePaid() { public void createPharmacyPreTable() { Date startTime = new Date(); createPreTable(BillType.PharmacyPre); - + } public void createPharmacyPreTableNotPaid() { Date startTime = new Date(); createPreTableNotPaid(BillType.PharmacyPre); - + } public void createPharmacyPreTablePaid() { Date startTime = new Date(); createPreTablePaid(BillType.PharmacyPre); - + } public void createPreTable(BillType bt) { @@ -5885,8 +5821,6 @@ public void createPharmacyPayment() { InstitutionType[] institutionTypes = {InstitutionType.Dealer}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPayment); - - } public void createStorePayment() { @@ -5895,7 +5829,6 @@ public void createStorePayment() { InstitutionType[] institutionTypes = {InstitutionType.StoreDealor}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPayment); - } public void createStorePaharmacyPayment() { @@ -5904,7 +5837,6 @@ public void createStorePaharmacyPayment() { InstitutionType[] institutionTypes = {InstitutionType.Dealer, InstitutionType.StoreDealor}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPayment); - } public void createPharmacyPaymentPre() { @@ -5913,7 +5845,6 @@ public void createPharmacyPaymentPre() { InstitutionType[] institutionTypes = {InstitutionType.Dealer}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPaymentPre); - } public void createStorePaymentPre() { @@ -5922,7 +5853,6 @@ public void createStorePaymentPre() { InstitutionType[] institutionTypes = {InstitutionType.StoreDealor}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPaymentPre); - } public void createStorePaharmacyPaymentPre() { @@ -5931,7 +5861,6 @@ public void createStorePaharmacyPaymentPre() { InstitutionType[] institutionTypes = {InstitutionType.Dealer, InstitutionType.StoreDealor}; createGrnPaymentTable(Arrays.asList(institutionTypes), BillType.GrnPaymentPre); - } private void createGrnPaymentTable(List institutionTypes, BillType billType) { @@ -6060,27 +5989,27 @@ public void searchDepartmentOpdBills() { createTableByKeyword(BillType.OpdBill, null, sessionController.getDepartment()); checkLabReportsApproved(bills); - + } public void searchDepartmentOpdBillLights() { Date startTime = new Date(); fillBills(BillType.OpdBill, null, sessionController.getDepartment()); - + } public void searchOpdBatchBills() { Date startTime = new Date(); createTableByKeyword(BillType.OpdBathcBill, institution, department, fromInstitution, fromDepartment, toInstitution, toDepartment); checkLabReportsApproved(bills); - + } public void searchOpdBills() { Date startTime = new Date(); createTableByKeyword(BillType.OpdBill, institution, department, fromInstitution, fromDepartment, toInstitution, toDepartment); checkLabReportsApproved(bills); - + } public void listOpdBatcuBills() { @@ -6094,14 +6023,13 @@ public void listOpdBills() { createTableByKeyword(BillType.OpdBill); checkLabReportsApproved(bills); - } public void createCollectingCentreBillSearch() { Date startTime = new Date(); createTableByKeyword(BillType.CollectingCentreBill); checkLabReportsApproved(bills); - + } public void listOpdBilledBills() { @@ -6991,8 +6919,6 @@ public void createCreditTable() { //System.err.println("Sql " + sql); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createCreditTableBillItemAll() { @@ -7000,21 +6926,18 @@ public void createCreditTableBillItemAll() { createCreditTableBillItem(null, true); - } public void createCreditTableBillItemOpd() { Date startTime = new Date(); createCreditTableBillItem(BillType.OpdBill, false); - } public void createCreditTableBillItemBht() { Date startTime = new Date(); createCreditTableBillItem(null, false); - } public void createCreditTableBillItem(BillType billType, boolean all) { @@ -7177,8 +7100,6 @@ public void channelPaymentBills() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); } - - } public void channelPaymentBillsNew() { @@ -7246,8 +7167,6 @@ public void channelPaymentBillsNew() { billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50); } - - } public void channelAgentPaymentBills() { @@ -7270,8 +7189,6 @@ public void channelAgentPaymentBills() { m.put("bt", BillType.ChannelAgencyPayment); billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP); - - } public void createChannelDueBillFeeOld() { @@ -7359,8 +7276,6 @@ public void createChannelDueBillFee() { billFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP, 50); } - - } public void createChannelDueBillFeeByAgent() { @@ -7407,7 +7322,6 @@ public void createChannelAgencyPaymentTable() { createAgentPaymentTable(BillType.AgentPaymentReceiveBill); - } public void createChannelAgencyCreditNoteTable() { @@ -7438,7 +7352,6 @@ public void createCollectingCentrePaymentTable() { Date startTime = new Date(); createAgentPaymentTable(BillType.CollectingCentrePaymentReceiveBill); - } public void createAgentPaymentTable(BillType billType) { @@ -7531,8 +7444,6 @@ public void createInwardServiceTable() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - - } public void createInwardServiceTablebyLoggedDepartment() { @@ -7584,8 +7495,6 @@ public void createInwardServiceTablebyLoggedDepartment() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - - } public void createInwardServiceTableDischarged() { @@ -7681,8 +7590,6 @@ public void createInwardFinalBillsCheck() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createInwardFinalBills() { @@ -7737,7 +7644,6 @@ public void createInwardFinalBills() { // bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); // } - } public void createCancelledInwardFinalBills() { @@ -7787,7 +7693,6 @@ public void createCancelledInwardFinalBills() { // bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); // } - } public void createInwardIntrimBills() { @@ -7833,8 +7738,6 @@ public void createInwardIntrimBills() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createInwardPaymentBills() { @@ -7880,8 +7783,6 @@ public void createInwardPaymentBills() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createInwardRefundBills() { @@ -7928,7 +7829,6 @@ public void createInwardRefundBills() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - } public void searchSurgery() { @@ -7999,8 +7899,6 @@ public void searchSurgery() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); } - - } public void createInwardSurgeryBills() { @@ -8077,8 +7975,6 @@ public void createInwardSurgeryBills() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); } - - } public void createInwardSurgeryBillsReport() { @@ -8231,8 +8127,6 @@ public void createInwardProBills() { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); - - } public void createInwardProBillsDischarged() { @@ -8328,8 +8222,6 @@ public void createPettyTable() { //System.err.println("Sql " + sql); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createIncomeBillTable() { @@ -8387,8 +8279,6 @@ public void fetchBillTable(BillType billType) { //System.err.println("Sql " + sql); bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); - - } public void createAllBillContacts() { @@ -8523,7 +8413,7 @@ public void sendSmsAll() { } } - + public String navigateToCancelPurchaseOrder() { makeNull(); Calendar c1 = Calendar.getInstance(); @@ -8925,7 +8815,7 @@ public void setMaxResult(int maxResult) { } public List getSelectedBills() { - if(selectedBills == null){ + if (selectedBills == null) { selectedBills = new ArrayList<>(); } return selectedBills; @@ -9274,7 +9164,5 @@ public List getPharmacyAdjustmentRows() { public void setPharmacyAdjustmentRows(List pharmacyAdjustmentRows) { this.pharmacyAdjustmentRows = pharmacyAdjustmentRows; } - - } diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java index 65f106bd9d..3534f14ef8 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java @@ -532,7 +532,7 @@ public String cancelPoBill() { JsfUtil.addSuccessMessage("Cancelled"); } - + selectedBills = null; return ""; } diff --git a/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml b/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml index 7eb9920462..dcda2bb42f 100644 --- a/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_purhcase_order_list_to_cancel.xhtml @@ -31,8 +31,6 @@ - - @@ -45,9 +43,9 @@
@@ -82,6 +80,13 @@ + + + #{b.deptId} + + + + diff --git a/src/main/webapp/resources/ezcomp/menu.xhtml b/src/main/webapp/resources/ezcomp/menu.xhtml index 8a52d6cd99..dd4499ea3f 100644 --- a/src/main/webapp/resources/ezcomp/menu.xhtml +++ b/src/main/webapp/resources/ezcomp/menu.xhtml @@ -578,9 +578,9 @@ + icon="fas fa-cancel"> From 88f7c4d181acc0db99b5cecfea6bcc1142553a73 Mon Sep 17 00:00:00 2001 From: Senula88 Date: Fri, 19 Apr 2024 09:05:21 +0530 Subject: [PATCH 4/4] Closes #4634 Signed-off-by: Senula88 --- .../com/divudi/bean/common/SearchController.java | 4 ---- .../divudi/bean/pharmacy/PharmacyBillSearch.java | 2 ++ src/main/java/com/divudi/data/BillTypeAtomic.java | 1 + src/main/java/com/divudi/data/Icon.java | 1 + src/main/webapp/home.xhtml | 15 +++++++++++++++ .../webapp/resources/image/home/ban-solid.svg | 1 + 6 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/main/webapp/resources/image/home/ban-solid.svg diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index 87db6f94ab..0965241e45 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -3454,10 +3454,6 @@ public void createNotApproved(InstitutionType institutionType, BillType bt) { + " and b.billType= :bTp "; sql += createKeySql(tmp); - if (getSearchKeyword().getRefBillNo() != null && !getSearchKeyword().getRefBillNo().trim().equals("")) { - sql += " and ((b.deptId) like :billNo )"; - tmp.put("billNo", "%" + getSearchKeyword().getRefBillNo().trim().toUpperCase() + "%"); - } sql += " order by b.createdAt desc "; List lst3 = getBillFacade().findByJpql(sql, tmp, TemporalType.TIMESTAMP, maxResult); diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java index 3534f14ef8..77dfee4c38 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyBillSearch.java @@ -44,6 +44,7 @@ import com.divudi.facade.ItemBatchFacade; import com.divudi.facade.PharmaceuticalBillItemFacade; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.data.BillTypeAtomic; import com.divudi.java.CommonFunctions; import java.io.Serializable; import java.util.ArrayList; @@ -522,6 +523,7 @@ public String cancelPoBill() { CancelledBill cancellationBill = pharmacyCreateCancelBill(); cancellationBill.setDeptId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getDepartment(), BillType.PharmacyPurchaseBill, BillClassType.CancelledBill, BillNumberSuffix.GRNCAN)); cancellationBill.setInsId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getInstitution(), BillType.PharmacyPurchaseBill, BillClassType.CancelledBill, BillNumberSuffix.GRNCAN)); + cancellationBill.setBillTypeAtomic(BillTypeAtomic.MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL); if (cancellationBill.getId() == null) { getBillFacade().create(cancellationBill); diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java index bfa31d9fa3..ecede1c1ae 100644 --- a/src/main/java/com/divudi/data/BillTypeAtomic.java +++ b/src/main/java/com/divudi/data/BillTypeAtomic.java @@ -56,6 +56,7 @@ public enum BillTypeAtomic { PHARMACY_ISSUE_CANCELLED("Pharmacy Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), + MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL("Multiple Pharmacy Purchase Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS), // CHANNELLING CHANNEL_BOOKING_WITH_PAYMENT("Channel Booking and Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN), CHANNEL_BOOKING_WITHOUT_PAYMENT("Channel Booking without Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS), diff --git a/src/main/java/com/divudi/data/Icon.java b/src/main/java/com/divudi/data/Icon.java index db906510a2..c262176cb7 100644 --- a/src/main/java/com/divudi/data/Icon.java +++ b/src/main/java/com/divudi/data/Icon.java @@ -84,6 +84,7 @@ public enum Icon { Goods_Receipt("Goods Receipt"), Return_Received_Goods("Return Received Goods"), Return_without_Receipt("Return without Receipt"), + Multiple_Purchase_Order_Cancellation("Multiple Purchase Order Cancellation"), pharmacy_issue("Pharmacy - Issue"), pharmacy_search_issue_bill("Pharmacy - Search Issue Bill"), diff --git a/src/main/webapp/home.xhtml b/src/main/webapp/home.xhtml index cc5cb592bd..52b9d61fcc 100644 --- a/src/main/webapp/home.xhtml +++ b/src/main/webapp/home.xhtml @@ -1035,6 +1035,21 @@ + + + + + + + + + + + diff --git a/src/main/webapp/resources/image/home/ban-solid.svg b/src/main/webapp/resources/image/home/ban-solid.svg new file mode 100644 index 0000000000..d277950938 --- /dev/null +++ b/src/main/webapp/resources/image/home/ban-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file