From ed54e16d676f8f2842d894d9b0f8ef34a07100bc Mon Sep 17 00:00:00 2001 From: Piyankara N W M G P Date: Sat, 3 Aug 2024 13:55:37 +0530 Subject: [PATCH 01/10] closes Issue#6731 Signed-off-by: Piyankara N W M G P --- .../store/store_adjustment_department.xhtml | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/store/store_adjustment_department.xhtml b/src/main/webapp/store/store_adjustment_department.xhtml index 494049e982..2976f41dce 100644 --- a/src/main/webapp/store/store_adjustment_department.xhtml +++ b/src/main/webapp/store/store_adjustment_department.xhtml @@ -9,7 +9,6 @@ - @@ -31,6 +30,10 @@ var="i" itemLabel="#{i.itemBatch.item.name}" itemValue="#{i}" > + @@ -72,6 +75,45 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -176,11 +218,7 @@ - - - - From c27882452ffc0cfc8bcc23304c01abd11b122316 Mon Sep 17 00:00:00 2001 From: Piyankara N W M G P Date: Sat, 3 Aug 2024 17:18:57 +0530 Subject: [PATCH 02/10] Signed-off-by: Piyankara N W M G P --- .../bean/store/StoreAdjustmentController.java | 15 +++++++++++++++ .../store/store_adjustment_department.xhtml | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java index bbd2be82d1..2173d4a8e3 100644 --- a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java +++ b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java @@ -628,4 +628,19 @@ public void setYearMonthDay(YearMonthDay yearMonthDay) { this.yearMonthDay = yearMonthDay; } + public void fillSelectStock(){ + List items = new ArrayList<>(); + + String sql; + Map m = new HashMap(); + sql = "select i " + + " from Stock i " + + " where i.department=:d " + + " order by i.stock desc"; + m.put("d", sessionController.getDepartment()); + + items = getStockFacade().findByJpql(sql, m); + + + } } diff --git a/src/main/webapp/store/store_adjustment_department.xhtml b/src/main/webapp/store/store_adjustment_department.xhtml index 2976f41dce..b4f8380b88 100644 --- a/src/main/webapp/store/store_adjustment_department.xhtml +++ b/src/main/webapp/store/store_adjustment_department.xhtml @@ -32,7 +32,7 @@ itemValue="#{i}" > @@ -75,7 +75,6 @@ - Date: Sat, 3 Aug 2024 20:29:46 +0530 Subject: [PATCH 03/10] Closes#6734 Signed-off-by: DamithDeshan --- .../com/divudi/bean/common/BillSearch.java | 77 +++++++++++++++---- .../bean/common/OpdPreSettleController.java | 36 +++++++-- src/main/resources/META-INF/persistence.xml | 1 - src/main/webapp/opd/bill_refund.xhtml | 2 +- src/main/webapp/resources/ezcomp/menu.xhtml | 2 +- 5 files changed, 93 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/BillSearch.java b/src/main/java/com/divudi/bean/common/BillSearch.java index 0be95d9e11..01f0c2e606 100644 --- a/src/main/java/com/divudi/bean/common/BillSearch.java +++ b/src/main/java/com/divudi/bean/common/BillSearch.java @@ -79,6 +79,8 @@ import com.divudi.data.ServiceType; import com.divudi.entity.Doctor; import com.divudi.facade.FeeFacade; +import com.divudi.facade.PatientFacade; +import com.divudi.facade.StaffFacade; import com.divudi.java.CommonFunctions; import com.divudi.light.common.BillLight; import java.io.Serializable; @@ -157,6 +159,8 @@ public class BillSearch implements Serializable { private EmailFacade emailFacade; @EJB FeeFacade feeFacade; + @EJB + private StaffFacade staffFacade; /** * Controllers */ @@ -1267,9 +1271,9 @@ public boolean calculateRefundTotalForOpdBill() { double refundingValue = 0; for (BillFee rbf : i.getBillFees()) { - System.out.println("rbf.getFeeValue() name = " + rbf.getFee().getName()); - System.out.println("rbf.getFeeValue() = " + rbf.getFeeValue()); - System.out.println("rbf.getFeeValue() fee = " + rbf.getFee().getFee()); + //System.out.println("rbf.getFeeValue() name = " + rbf.getFee().getName()); + //System.out.println("rbf.getFeeValue() = " + rbf.getFeeValue()); + //System.out.println("rbf.getFeeValue() fee = " + rbf.getFee().getFee()); refundingValue += rbf.getFeeValue(); } i.setNetValue(refundingValue); @@ -1569,6 +1573,13 @@ public String refundOpdBill() { JsfUtil.addErrorMessage("One or more bill Item you are refunding has been already paid to Service Provider. Can not refund again."); return ""; } + + if (paymentMethod == PaymentMethod.Staff) { + if (getBill().getToStaff() == null) { + JsfUtil.addErrorMessage("Can't Select Staff Method"); + return ""; + } + } if (refundingBill.getBillItems() != null) { for (BillItem bi : refundingBill.getBillItems()) { @@ -1602,23 +1613,36 @@ public String refundOpdBill() { Payment p = getOpdPreSettleController().createPaymentForCancellationsAndRefunds(refundingBill, paymentMethod); //TODO: Create Payments for Bill Items - if (getBill().getPaymentMethod() == PaymentMethod.Credit) { - if (getBill().getToStaff() != null) { - staffBean.updateStaffCredit(getBill().getToStaff(), 0 - (getBill().getNetTotal() + getBill().getVat())); - JsfUtil.addSuccessMessage("Staff Credit Updated"); - } else if (getBill().getCreditCompany() != null) { - //TODO : Update Credit COmpany Bill - } + if (getBill().getPaymentMethod() == PaymentMethod.Staff) { + //System.out.println("PaymentMethod - Staff"); + + //System.out.println("Before Balance = " + getBill().getToStaff().getCurrentCreditValue()); + getBill().getToStaff().setCurrentCreditValue(getBill().getToStaff().getCurrentCreditValue() - Math.abs(getRefundingBill().getNetTotal())); + + //System.out.println("After Balance = " + getBill().getToStaff().getCurrentCreditValue()); + staffFacade.edit(getBill().getToStaff()); + //System.out.println("Staff Credit Updated"); + } else if (getBill().getPaymentMethod() == PaymentMethod.PatientDeposit) { - //TODO: Update Patient Deposit + //System.out.println("Before Balance = " + bill.getPatient().getRunningBalance()); + if (bill.getPatient().getRunningBalance() == null) { + //System.out.println("Null"); + bill.getPatient().setRunningBalance(Math.abs(bill.getNetTotal())); + } else { + //System.out.println("Not Null - Add BillValue"); + bill.getPatient().setRunningBalance(bill.getPatient().getRunningBalance() + Math.abs(bill.getNetTotal())); + } + patientFacade.edit(bill.getPatient()); + //System.out.println("After Balance = " + bill.getPatient().getRunningBalance()); } - //TODO - Update Bill Payment Values - //TODO - Update Bill Paid Value printPreview = true; return ""; } + @EJB + private PatientFacade patientFacade; + public boolean sampleHasBeenCollected(Bill rf) { boolean oneItemIsSampled = false; for (BillItem bi : rf.getBillItems()) { @@ -2162,6 +2186,13 @@ public void cancelOpdBill() { } } + if (paymentMethod == PaymentMethod.Staff) { + if (getBill().getToStaff() == null) { + JsfUtil.addErrorMessage("Can't Select Staff Method"); + return; + } + } + if (!getWebUserController().hasPrivilege("OpdCancel")) { JsfUtil.addErrorMessage("You have no privilege to cancel OPD bills. Please contact System Administrator."); return; @@ -2972,7 +3003,7 @@ public String navigateViewOpdBillByBillTypeAtomic() { case PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_RETURN: case PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION: return navigateToViewChannelingProfessionalPaymentBill(); - + case OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER: case OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER: case OPD_BATCH_BILL_CANCELLATION: @@ -2981,7 +3012,7 @@ public String navigateViewOpdBillByBillTypeAtomic() { case PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES: case PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES_RETURN: return navigateToViewOpdProfessionalPaymentBill(); - + } JsfUtil.addErrorMessage("Wrong Bill Type"); return ""; @@ -4090,6 +4121,22 @@ public void setReferredBy(Doctor referredBy) { this.referredBy = referredBy; } + public PatientFacade getPatientFacade() { + return patientFacade; + } + + public void setPatientFacade(PatientFacade patientFacade) { + this.patientFacade = patientFacade; + } + + public StaffFacade getStaffFacade() { + return staffFacade; + } + + public void setStaffFacade(StaffFacade staffFacade) { + this.staffFacade = staffFacade; + } + public class PaymentSummary { private long idCounter = 0; diff --git a/src/main/java/com/divudi/bean/common/OpdPreSettleController.java b/src/main/java/com/divudi/bean/common/OpdPreSettleController.java index cbe22fdc56..64f44820cd 100644 --- a/src/main/java/com/divudi/bean/common/OpdPreSettleController.java +++ b/src/main/java/com/divudi/bean/common/OpdPreSettleController.java @@ -54,6 +54,7 @@ import com.divudi.facade.PaymentFacade; import com.divudi.facade.PersonFacade; import com.divudi.facade.PharmaceuticalBillItemFacade; +import com.divudi.facade.StaffFacade; import com.divudi.facade.TokenFacade; import java.io.Serializable; @@ -122,6 +123,9 @@ public OpdPreSettleController() { TokenFacade tokenFacade; @EJB StaffBean staffBean; + @EJB + private StaffFacade staffFacade; + ///////////////////////// Item selectedAlternative; @@ -1703,26 +1707,36 @@ public Payment createPaymentForCancellationsforOPDBill(Bill bill, PaymentMethod p.setCreater(getSessionController().getLoggedUser()); p.setPaymentMethod(pm); - System.out.println("pm = " + pm); + //System.out.println("pm = " + pm); if (pm == PaymentMethod.PatientDeposit) { - System.out.println("Before Balance = " + bill.getPatient().getRunningBalance()); + //System.out.println("Before Balance = " + bill.getPatient().getRunningBalance()); if (bill.getPatient().getRunningBalance() == null) { - System.out.println("Null"); + //System.out.println("Null"); bill.getPatient().setRunningBalance(Math.abs(bill.getNetTotal())); } else { - System.out.println("Not Null - Add BillValue"); + //System.out.println("Not Null - Add BillValue"); bill.getPatient().setRunningBalance(bill.getPatient().getRunningBalance() + Math.abs(bill.getNetTotal())); } patientFacade.edit(bill.getPatient()); - System.out.println("After Balance = " + bill.getPatient().getRunningBalance()); + //System.out.println("After Balance = " + bill.getPatient().getRunningBalance()); + } + + if (pm == PaymentMethod.Staff) { + //System.out.println("PaymentMethod - Staff"); + //System.out.println("Before Balance = " + bill.getToStaff().getCurrentCreditValue()); + bill.getToStaff().setCurrentCreditValue( bill.getToStaff().getCurrentCreditValue() - Math.abs(bill.getNetTotal())); + //System.out.println("After Balance = " + bill.getToStaff().getCurrentCreditValue()); + staffFacade.edit(bill.getToStaff()); + //System.out.println("Staff Credit Updated"); } - System.out.println("001"); + + //System.out.println("001"); if (p.getId() == null) { getPaymentFacade().create(p); } getPaymentFacade().edit(p); - System.out.println("End Payment"); + //System.out.println("End Payment"); return p; } @@ -2017,4 +2031,12 @@ public void setForeigner(boolean foreigner) { this.foreigner = foreigner; } + public StaffFacade getStaffFacade() { + return staffFacade; + } + + public void setStaffFacade(StaffFacade staffFacade) { + this.staffFacade = staffFacade; + } + } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 293d3d4fb1..319a2508d1 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -19,6 +19,5 @@ - diff --git a/src/main/webapp/opd/bill_refund.xhtml b/src/main/webapp/opd/bill_refund.xhtml index ffa0d94897..8887f89996 100644 --- a/src/main/webapp/opd/bill_refund.xhtml +++ b/src/main/webapp/opd/bill_refund.xhtml @@ -64,7 +64,7 @@ - + - + From a6027706c203f28251e086b8c2fae915991253ee Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sat, 3 Aug 2024 21:12:30 +0530 Subject: [PATCH 04/10] closes#6748 Signed-off-by: DamithDeshan --- src/main/webapp/opd/opd_bill_package.xhtml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/webapp/opd/opd_bill_package.xhtml b/src/main/webapp/opd/opd_bill_package.xhtml index 5c2b8b7e18..ff9a9170bb 100644 --- a/src/main/webapp/opd/opd_bill_package.xhtml +++ b/src/main/webapp/opd/opd_bill_package.xhtml @@ -625,6 +625,8 @@ ajax="false" icon="fa fa-check" action="#{billPackageController.settleBill()}" + onclick="if (!confirm('Are you sure you want to Settle This Bill ?')) + return false;" class="ui-button-success mx-1" > From 59251b7f7a046a7a9fa51fa405e85ffb304c76f4 Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sat, 3 Aug 2024 21:17:30 +0530 Subject: [PATCH 05/10] Signed-off-by: DamithDeshan --- src/main/java/com/divudi/ws/common/ApplicationConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/divudi/ws/common/ApplicationConfig.java b/src/main/java/com/divudi/ws/common/ApplicationConfig.java index 6f7ec08dba..a6babb840f 100644 --- a/src/main/java/com/divudi/ws/common/ApplicationConfig.java +++ b/src/main/java/com/divudi/ws/common/ApplicationConfig.java @@ -44,6 +44,7 @@ private void addRestResourceClasses(Set> resources) { resources.add(com.divudi.ws.finance.Qb.class); resources.add(com.divudi.ws.finance.clinical.Fhir.class); resources.add(com.divudi.ws.inward.ApiInward.class); + resources.add(com.divudi.ws.lims.Lims.class); resources.add(com.divudi.ws.lims.LimsMiddlewareController.class); } From 32a588f0e62dbca1cf62440a45e504ccf913315d Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sat, 3 Aug 2024 21:20:32 +0530 Subject: [PATCH 06/10] closes#6747 Signed-off-by: DamithDeshan --- src/main/webapp/collecting_centre/bill.xhtml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/webapp/collecting_centre/bill.xhtml b/src/main/webapp/collecting_centre/bill.xhtml index 21cfb7b8a4..b38024a897 100644 --- a/src/main/webapp/collecting_centre/bill.xhtml +++ b/src/main/webapp/collecting_centre/bill.xhtml @@ -305,6 +305,8 @@ icon="fa fa-check" action="#{collectingCentreBillController.settleBill}" ajax="false" + onclick="if (!confirm('Are you sure you want to Settle This Bill ?')) + return false;" class="ui-button-success "> Date: Sun, 4 Aug 2024 13:40:11 +0530 Subject: [PATCH 07/10] Signed-off-by: Piyankara N W M G P fixed --- .../bean/store/StoreAdjustmentController.java | 32 ++++++++++++++++--- .../store/store_adjustment_department.xhtml | 2 +- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java index 2173d4a8e3..c1035c68ce 100644 --- a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java +++ b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java @@ -7,6 +7,7 @@ import com.divudi.bean.common.SessionController; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.bean.pharmacy.ConsumableCategoryController; import com.divudi.data.BillClassType; import com.divudi.data.BillNumberSuffix; import com.divudi.data.BillType; @@ -627,20 +628,43 @@ public YearMonthDay getYearMonthDay() { public void setYearMonthDay(YearMonthDay yearMonthDay) { this.yearMonthDay = yearMonthDay; } + private List stk; - public void fillSelectStock(){ + public void fillSelectStock() { List items = new ArrayList<>(); - + if (stock == null) { + stk = items; + return; + } String sql; - Map m = new HashMap(); + Map m = new HashMap<>(); + sql = "select i " + " from Stock i " + " where i.department=:d " + + " and i.itemBatch.item.code=:stationary " + " order by i.stock desc"; + m.put("d", sessionController.getDepartment()); + m.put("stationary", stock.getItemBatch().getItem().getCode()); // Assuming stk contains the item items = getStockFacade().findByJpql(sql, m); - + if (items != null) { + stk = items; + } } + + public List getStk() { + return stk; + } + + public void setStk(List stk) { + this.stk = stk; + } + + + + + } diff --git a/src/main/webapp/store/store_adjustment_department.xhtml b/src/main/webapp/store/store_adjustment_department.xhtml index b4f8380b88..ca304842cc 100644 --- a/src/main/webapp/store/store_adjustment_department.xhtml +++ b/src/main/webapp/store/store_adjustment_department.xhtml @@ -78,7 +78,7 @@ Date: Mon, 5 Aug 2024 15:23:58 +0000 Subject: [PATCH 08/10] Update version to 3.0.0.20240805.1 --- .github/counter.txt | 2 +- .github/last_date.txt | 2 +- README.md | 2 +- src/main/resources/VERSION.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/counter.txt b/.github/counter.txt index 1e8b314962..d00491fd7e 100644 --- a/.github/counter.txt +++ b/.github/counter.txt @@ -1 +1 @@ -6 +1 diff --git a/.github/last_date.txt b/.github/last_date.txt index 444c7cbae4..25c4636413 100644 --- a/.github/last_date.txt +++ b/.github/last_date.txt @@ -1 +1 @@ -20240804 +20240805 diff --git a/README.md b/README.md index ebb5dcfb76..3d9c97bfbd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio -Current Version: 3.0.0.20240804.6 (This line will be automatically updated to reflect the latest version) +Current Version: 3.0.0.20240805.1 (This line will be automatically updated to reflect the latest version) diff --git a/src/main/resources/VERSION.txt b/src/main/resources/VERSION.txt index d8f4ba115e..6ce8ecdc52 100644 --- a/src/main/resources/VERSION.txt +++ b/src/main/resources/VERSION.txt @@ -1 +1 @@ -3.0.0.20240804.6 +3.0.0.20240805.1 From a3e9e593378663b0453e679584b39c72ac84d792 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:58:54 +0000 Subject: [PATCH 09/10] Update version to 3.0.0.20240805.2 --- .github/counter.txt | 2 +- README.md | 2 +- src/main/resources/VERSION.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/counter.txt b/.github/counter.txt index d00491fd7e..0cfbf08886 100644 --- a/.github/counter.txt +++ b/.github/counter.txt @@ -1 +1 @@ -1 +2 diff --git a/README.md b/README.md index 3d9c97bfbd..5d05be5379 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio -Current Version: 3.0.0.20240805.1 (This line will be automatically updated to reflect the latest version) +Current Version: 3.0.0.20240805.2 (This line will be automatically updated to reflect the latest version) diff --git a/src/main/resources/VERSION.txt b/src/main/resources/VERSION.txt index 6ce8ecdc52..d809205ad1 100644 --- a/src/main/resources/VERSION.txt +++ b/src/main/resources/VERSION.txt @@ -1 +1 @@ -3.0.0.20240805.1 +3.0.0.20240805.2 From 3a3075b408d8dd72b666d41e212f62d67055f22f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:06:53 +0000 Subject: [PATCH 10/10] Update version to 3.0.0.20240805.3 --- .github/counter.txt | 2 +- README.md | 2 +- src/main/resources/VERSION.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/counter.txt b/.github/counter.txt index 0cfbf08886..00750edc07 100644 --- a/.github/counter.txt +++ b/.github/counter.txt @@ -1 +1 @@ -2 +3 diff --git a/README.md b/README.md index 5d05be5379..f829146bf4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio -Current Version: 3.0.0.20240805.2 (This line will be automatically updated to reflect the latest version) +Current Version: 3.0.0.20240805.3 (This line will be automatically updated to reflect the latest version) diff --git a/src/main/resources/VERSION.txt b/src/main/resources/VERSION.txt index d809205ad1..bc1411f5ef 100644 --- a/src/main/resources/VERSION.txt +++ b/src/main/resources/VERSION.txt @@ -1 +1 @@ -3.0.0.20240805.2 +3.0.0.20240805.3