From 905ea819a3bd2209e558b39fffe94727eff487c1 Mon Sep 17 00:00:00 2001 From: Geeth Sandaru Madhushan Date: Fri, 20 Dec 2024 23:51:06 +0530 Subject: [PATCH 1/3] Temporary updates to persistence.xml --- src/main/resources/META-INF/persistence.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 442320af04..3859a00e7b 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/southernlanka + jdbc/ruhunu false @@ -13,7 +13,7 @@ - jdbc/southernlankaAudit + jdbc/ruhunuAudit false From 8141f7426ffd9841119dabecdaf291a14d082017 Mon Sep 17 00:00:00 2001 From: Geeth Sandaru Madhushan Date: Sat, 21 Dec 2024 00:13:51 +0530 Subject: [PATCH 2/3] Update dev_ci_cd.yml --- .github/workflows/dev_ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_ci_cd.yml b/.github/workflows/dev_ci_cd.yml index cc3efd6a66..86b0a3fc1d 100644 --- a/.github/workflows/dev_ci_cd.yml +++ b/.github/workflows/dev_ci_cd.yml @@ -118,12 +118,12 @@ jobs: # Check if the application is reachable for i in {1..5}; do - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://$SERVER_IP/rh/faces/index1.xhtml) + RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://dev.carecode.org/rh/faces/index1.xhtml) if [ "$RESPONSE_CODE" == "200" ]; then echo "Application is reachable and healthy." break elif [ "$i" == "5" ]; then - echo "Application is not reachable or unhealthy at http://$SERVER_IP/rh (HTTP $RESPONSE_CODE)" + echo "Application is not reachable or unhealthy at https://dev.carecode.org/rh (HTTP $RESPONSE_CODE)" break fi sleep 10 From 420bf84d0abdb6200729d102cf2d9c674adb5f43 Mon Sep 17 00:00:00 2001 From: Pubudu-Piyankara Date: Sat, 21 Dec 2024 13:59:54 +0530 Subject: [PATCH 3/3] Signed-off-by: Pubudu-Piyankara --- .../divudi/bean/common/ReportsController.java | 1 + .../pharmacy/TransferReceiveController.java | 30 +++++++++++++++---- .../pharmacy_transfer_issued_list.xhtml | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index 288fd1cd20..c606a893ea 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -390,6 +390,7 @@ public String getSelectedDateType() { public void setSelectedDateType(String selectedDateType) { this.selectedDateType = selectedDateType; + } public Investigation getInvestigation() { return investigation; diff --git a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java index 2d791fa2d0..efb7b18e2c 100644 --- a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java +++ b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java @@ -95,7 +95,7 @@ public String navigateToEditRecieveIssue() { public String navigateToAproveRecieveIssue() { return "/pharmacy/pharmacy_transfer_receive_approval?faces-redirect=true"; } - + public String navigateToReprintRecieveIssue() { return "/pharmacy/pharmacy_reprint_transfer_receive?faces-redirect=true"; } @@ -125,12 +125,11 @@ public void setIssuedBill(Bill issuedBill) { receivedBill = null; generateBillComponent(); } - + // public String navigateBackToRecieveList(){ // return "/pharmacy/pharmacy_transfer_issued_list_with_approval?faces-redirect=true"; // } - - public String navigateToRecieveIssue(){ + public String navigateToRecieveIssue() { return "/pharmacy/pharmacy_transfer_receive_with_approval?faces-redirect=true"; } @@ -166,6 +165,27 @@ public void generateBillComponent() { @EJB private StockFacade stockFacade; + public String navigateToPharmacyReceiveForRequests() { + if (issuedBill == null || issuedBill.getId() == null) { + JsfUtil.addErrorMessage("No Bill Selected"); + return ""; + } + + if (isAlreadyReceived(issuedBill)) { + JsfUtil.addErrorMessage("Already Received!"); + return ""; + } + + return "/pharmacy/pharmacy_transfer_receive?faces-redirect=true"; + } + + public boolean isAlreadyReceived(Bill bill) { + if (bill.getForwardReferenceBills() == null || bill.getForwardReferenceBills().isEmpty()) { + return false; + } + return true; + } + public void settle() { saveBill(); @@ -423,7 +443,7 @@ public void settleApprove() { getReceivedBill().setNetTotal(calTotal()); getReceivedBill().setTotal(calTotal()); - + getIssuedBill().setReferenceBill(getReceivedBill()); getReceivedBill().setReferenceBill(getIssuedBill()); diff --git a/src/main/webapp/pharmacy/pharmacy_transfer_issued_list.xhtml b/src/main/webapp/pharmacy/pharmacy_transfer_issued_list.xhtml index ba0f53bf93..72a4c629b1 100644 --- a/src/main/webapp/pharmacy/pharmacy_transfer_issued_list.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_transfer_issued_list.xhtml @@ -90,7 +90,7 @@ ajax="false" icon="fas fa-check" class="ui-button-success mx-2" - action="/pharmacy/pharmacy_transfer_receive?faces-redirect=true" + action="#{transferReceiveController.navigateToPharmacyReceiveForRequests()}" disabled="#{p.cancelled eq true}">