From 76282dd23f34feed2e3d376e8ce517c701ce8393 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 4 Aug 2024 06:52:13 +0530 Subject: [PATCH 1/3] Signed-off-by: buddhika75 --- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 1b2b772442..9841584308 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /ruhunu1 + /ruhunuDemo From b06eee9d7950f17995bfb3f6d956ed5f2a3b2896 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 4 Aug 2024 09:30:44 +0530 Subject: [PATCH 2/3] Signed-off-by: Dr. M H B Ariyaratne --- .../CollectingCentreBillController.java | 57 +- .../collectingCentre/CourierController.java | 4 + .../divudi/bean/common/SearchController.java | 6 +- .../divudi/bean/common/SessionController.java | 5 + src/main/java/com/divudi/data/LoginPage.java | 15 +- src/main/resources/META-INF/persistence.xml | 4 +- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- src/main/webapp/collecting_centre/bill.xhtml | 99 +-- .../collecting_centre/courier/index.xhtml | 33 +- .../courier/viewReports.xhtml | 762 ++++++++++++------ 10 files changed, 614 insertions(+), 373 deletions(-) diff --git a/src/main/java/com/divudi/bean/collectingCentre/CollectingCentreBillController.java b/src/main/java/com/divudi/bean/collectingCentre/CollectingCentreBillController.java index d248cc23b9..e13cdbeec9 100644 --- a/src/main/java/com/divudi/bean/collectingCentre/CollectingCentreBillController.java +++ b/src/main/java/com/divudi/bean/collectingCentre/CollectingCentreBillController.java @@ -149,6 +149,8 @@ public class CollectingCentreBillController implements Serializable, ControllerW StaffBean staffBean; @Inject CategoryController categoryController; + @Inject + ConfigOptionApplicationController configOptionApplicationController; /** * Properties */ @@ -1089,14 +1091,15 @@ private boolean errorCheck() { JsfUtil.addErrorMessage("Please select a collecting centre"); return true; } - if (referralId == null || referralId.trim().equals("")) { - JsfUtil.addErrorMessage("Please enter a referrance number"); - return true; + boolean collectingCentreBillingRequiresReferanceNumbers = configOptionApplicationController.getBooleanValueByKey("Collecting Centre Billing Requires Referance Numbers", true); + boolean collectingCentreBillingRequiresCreditBalanceManagement = configOptionApplicationController.getBooleanValueByKey("Collecting Centre Billing Requires Credit Balance Management", true); + + if (collectingCentreBillingRequiresReferanceNumbers) { + if (referralId == null || referralId.trim().equals("")) { + JsfUtil.addErrorMessage("Please enter a referrance number"); + return true; + } } -// else if (collectingCenterReferranceNumberAlreadyUsed(collectingCentre)) { -// JsfUtil.addErrorMessage("Referral number alredy entered"); -// return true; -// } if (getLstBillEntries().isEmpty()) { JsfUtil.addErrorMessage("Please Add tests before billing"); @@ -1110,31 +1113,25 @@ private boolean errorCheck() { } } - ///not wanted -// if ((collectingCentre.getBallance() - Math.abs(feeTotalExceptCcfs)) < 0 - collectingCentre.getStandardCreditLimit()) { -// JsfUtil.addErrorMessage("This bill excees the Collecting Centre Limit"); -// return true; -// } - double awailableBalance = Math.abs(collectingCentre.getBallance() + Math.abs(collectingCentre.getAllowedCredit())); - - if (awailableBalance < Math.abs(feeTotalExceptCcfs)) { - JsfUtil.addErrorMessage("Collecting Centre Balance is Not Enough"); - return true; - } + double awailableBalance = Math.abs(collectingCentre.getBallance() + Math.abs(collectingCentre.getAllowedCredit())); -// if (agentReferenceBookController.numberHasBeenIssuedToTheAgent(getReferralId())) { -// JsfUtil.addErrorMessage("Invaild Reference Number."); -// return true; -// } - if (agentReferenceBookController.agentReferenceNumberIsAlredyUsed(getReferralId(), collectingCentre, BillType.CollectingCentreBill, PaymentMethod.Agent)) { - JsfUtil.addErrorMessage("This Reference Number is alredy Used."); - setReferralId(""); - return true; + if (collectingCentreBillingRequiresCreditBalanceManagement) { + if (awailableBalance < Math.abs(feeTotalExceptCcfs)) { + JsfUtil.addErrorMessage("Collecting Centre Balance is Not Enough"); + return true; + } } - if (!agentReferenceBookController.numberHasBeenIssuedToTheAgent(collectingCentre, getReferralId())) { - JsfUtil.addErrorMessage("This Reference Number is Blocked Or This channel Book is Not Issued."); - return true; + if (collectingCentreBillingRequiresReferanceNumbers) { + if (agentReferenceBookController.agentReferenceNumberIsAlredyUsed(getReferralId(), collectingCentre, BillType.CollectingCentreBill, PaymentMethod.Agent)) { + JsfUtil.addErrorMessage("This Reference Number is alredy Used."); + setReferralId(""); + return true; + } + if (!agentReferenceBookController.numberHasBeenIssuedToTheAgent(collectingCentre, getReferralId())) { + JsfUtil.addErrorMessage("This Reference Number is Blocked Or This channel Book is Not Issued."); + return true; + } } return false; @@ -1533,7 +1530,7 @@ public String navigateToCollectingCenterBillingromCollectingCenterBilling() { setPatient(getPatient()); return "/collecting_centre/bill?faces-redirect=true"; } - + public String navigateToCollectingCenterBillingfromBillPriview() { prepareNewBillKeepingCollectingCenter(); fillAvailableAgentReferanceNumbers(collectingCentre); diff --git a/src/main/java/com/divudi/bean/collectingCentre/CourierController.java b/src/main/java/com/divudi/bean/collectingCentre/CourierController.java index 60a6bcd005..36b633f99d 100644 --- a/src/main/java/com/divudi/bean/collectingCentre/CourierController.java +++ b/src/main/java/com/divudi/bean/collectingCentre/CourierController.java @@ -29,6 +29,10 @@ public String navigateToCourierHandoverSamplesToLab() { public String navigateToCourierViewReports() { return "/collecting_centre/courier/viewReports.xhtml?faces-redirect=true"; } + + public String navigateToCourierIndex() { + return "/collecting_centre/courier/index.xhtml?faces-redirect=true"; + } public String navigateToCourierPrintReports() { return "/collecting_centre/courier/printReports.xhtml?faces-redirect=true"; diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index ff5a8874e0..4c2420a0eb 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -992,11 +992,11 @@ public void fillCollectingCentreCourierPatientInvestigations() { temMap.put("dep", getReportKeyWord().getDepartment()); if(institution==null){ - jpql += " b.collectingCentre in :ccs "; + jpql += " and b.collectingCentre in :ccs "; temMap.put("ccs", sessionController.getLoggableCollectingCentres()); }else{ - jpql += " b.collectingCentre=:cc "; - temMap.put("ccs", sessionController.getLoggableCollectingCentres()); + jpql += " and b.collectingCentre=:cc "; + temMap.put("cc", sessionController.getLoggableCollectingCentres()); } if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) { diff --git a/src/main/java/com/divudi/bean/common/SessionController.java b/src/main/java/com/divudi/bean/common/SessionController.java index ed772b9c76..f835f5fa66 100644 --- a/src/main/java/com/divudi/bean/common/SessionController.java +++ b/src/main/java/com/divudi/bean/common/SessionController.java @@ -8,6 +8,7 @@ package com.divudi.bean.common; import com.divudi.bean.channel.BookingController; +import com.divudi.bean.collectingCentre.CourierController; import com.divudi.bean.pharmacy.PharmacySaleController; import com.divudi.data.InstitutionType; import com.divudi.data.Privileges; @@ -123,6 +124,8 @@ public class SessionController implements Serializable, HttpSessionListener { BookingController bookingController; @Inject ConfigOptionApplicationController configOptionApplicationController; + @Inject + CourierController courierController; /** * Properties */ @@ -1277,6 +1280,8 @@ public String navigateToLoginPageByUsersDefaultLoginPage() { return opdTokenController.navigateToManageOpdTokensCalled(); case PHARMACY_TOKEN_DISPLAY: return tokenController.navigateToManagePharmacyTokensCalled(); + case COURIER_LANDING_PAGE: + return courierController.navigateToCourierIndex(); case HOME: default: return "/home?faces-redirect=true"; diff --git a/src/main/java/com/divudi/data/LoginPage.java b/src/main/java/com/divudi/data/LoginPage.java index 7d68953e34..237cb273fa 100644 --- a/src/main/java/com/divudi/data/LoginPage.java +++ b/src/main/java/com/divudi/data/LoginPage.java @@ -3,7 +3,7 @@ /** * Enum representing various page types * - * @author Dr M H B Ariyaratne + * Author: Dr M H B Ariyaratne * Contribution by OpenAI's ChatGPT for additional labels and method implementation. */ public enum LoginPage { @@ -12,24 +12,15 @@ public enum LoginPage { CHANNELLING_TV_DISPLAY("Channelling TV Display"), OPD_QUEUE_PAGE("OPD Queue Page"), OPD_TOKEN_DISPLAY("OPD Token Display"), - PHARMACY_TOKEN_DISPLAY("Pharmacy Token Display"); + PHARMACY_TOKEN_DISPLAY("Pharmacy Token Display"), + COURIER_LANDING_PAGE("Courier Landing Page"); private final String label; - /** - * Constructor for LoginPage enum to set the user-friendly label. - * - * @param label the user-friendly name of the page type - */ LoginPage(String label) { this.label = label; } - /** - * Returns the user-friendly name of the page type. - * - * @return the label of the enum constant - */ public String getLabel() { return label; } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index b7178ab1ca..48caf9db30 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,7 +1,7 @@ - jdbc/ruhunu + jdbc/sethma false @@ -10,7 +10,7 @@ - jdbc/ruhunuAudit + jdbc/sethmaaudit false diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 8947aba09c..4871460e69 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /coop + /horizon diff --git a/src/main/webapp/collecting_centre/bill.xhtml b/src/main/webapp/collecting_centre/bill.xhtml index b38024a897..13f39909e4 100644 --- a/src/main/webapp/collecting_centre/bill.xhtml +++ b/src/main/webapp/collecting_centre/bill.xhtml @@ -306,7 +306,7 @@ action="#{collectingCentreBillController.settleBill}" ajax="false" onclick="if (!confirm('Are you sure you want to Settle This Bill ?')) - return false;" + return false;" class="ui-button-success "> - -
-
- -
-
- - - - + + +
+
+ +
+
+ + + + +
+
+ + +
@@ -395,35 +401,38 @@
- - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + + + + + + + + @@ -625,13 +634,13 @@ - + - + @@ -659,7 +668,7 @@ - + diff --git a/src/main/webapp/collecting_centre/courier/index.xhtml b/src/main/webapp/collecting_centre/courier/index.xhtml index 8e5914af1a..e2af365ede 100644 --- a/src/main/webapp/collecting_centre/courier/index.xhtml +++ b/src/main/webapp/collecting_centre/courier/index.xhtml @@ -7,25 +7,26 @@ -
-
- - - - - - - - - -
+
+
+
+ + + + + + + + + +
-
- - +
+ + +
- diff --git a/src/main/webapp/collecting_centre/courier/viewReports.xhtml b/src/main/webapp/collecting_centre/courier/viewReports.xhtml index e0794bc4c8..c3a095a750 100644 --- a/src/main/webapp/collecting_centre/courier/viewReports.xhtml +++ b/src/main/webapp/collecting_centre/courier/viewReports.xhtml @@ -1,7 +1,6 @@ + + + View Reports + + +
-

View Reports

-

Dummy content for View Reports page.

+
@@ -46,16 +50,17 @@ + value="Department*"/> + + var="cc1" + itemValue="#{cc1}" + itemLabel="#{cc1.name}" > @@ -101,307 +106,536 @@
+ + - > - + - - + styleClass="#{pi.billItem.bill.cancelled or pi.billItem.transRefund ? 'redtext':''}" /> + +
- +
- - + +
- - + +
- + - - + + - + - - + + - -
- - - - -
- -
- - - - -
- - - - -
- - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - -
- - -
- - -
+ + + - - - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - -
- - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - - - -
- - - - -
- - - - -
- -
- -
+
- - + +
From f47fdebe9ed2c1c9fda26e414b33d00d32c53b41 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 4 Aug 2024 09:33:07 +0530 Subject: [PATCH 3/3] Closes #6612 Signed-off-by: buddhika75 --- src/main/webapp/lab/sample_management.xhtml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/webapp/lab/sample_management.xhtml b/src/main/webapp/lab/sample_management.xhtml index 5b7d390d26..f1259b0082 100644 --- a/src/main/webapp/lab/sample_management.xhtml +++ b/src/main/webapp/lab/sample_management.xhtml @@ -173,13 +173,9 @@ action="#{patientInvestigationController.navigateToPrintBarcodesFromSampellingPage(smpIx)}" > -
- - -