From 8b6b6124d0d410581b0d9b9fb2f7469069d01861 Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:31:14 +0530 Subject: [PATCH 1/6] Signed-off-by: DamithDeshan --- .../webapp/resources/template/not_authorize.xhtml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/webapp/resources/template/not_authorize.xhtml b/src/main/webapp/resources/template/not_authorize.xhtml index 3c60942caf..9637990446 100644 --- a/src/main/webapp/resources/template/not_authorize.xhtml +++ b/src/main/webapp/resources/template/not_authorize.xhtml @@ -13,20 +13,12 @@
- +
- +
-
- - -
+
From cd3ae5cf8da29ed74254e9bc6bb920b1c6e15c8c Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:31:34 +0530 Subject: [PATCH 2/6] Signed-off-by: DamithDeshan --- src/main/java/com/divudi/data/BillType.java | 2 ++ src/main/java/com/divudi/data/BillTypeAtomic.java | 5 ++++- src/main/java/com/divudi/ws/common/ApplicationConfig.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/divudi/data/BillType.java b/src/main/java/com/divudi/data/BillType.java index 7abd1b33e1..8ba2a038d7 100644 --- a/src/main/java/com/divudi/data/BillType.java +++ b/src/main/java/com/divudi/data/BillType.java @@ -47,6 +47,8 @@ public enum BillType { AgentCreditNoteBill, AgentDebitNoteBill, PatientPaymentReceiveBill, + PatientPaymentRefundBill, + PatientPaymentCanceldBill, CollectingCentrePaymentReceiveBill, CollectingCentreCreditNoteBill, CollectingCentreDebitNoteBill, diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java index 7c9caff3d6..02f0a19c2b 100644 --- a/src/main/java/com/divudi/data/BillTypeAtomic.java +++ b/src/main/java/com/divudi/data/BillTypeAtomic.java @@ -168,7 +168,10 @@ public enum BillTypeAtomic { PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), IOU_CASH_ISSUE("Iou Cash Issue", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), IOU_CASH_RETURN("Iou Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), - STAFF_CREDIT_SETTLE("Staff Credit Settle", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER); + STAFF_CREDIT_SETTLE("Staff Credit Settle", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), + PATIENT_DEPOSIT("Patient Deposit Settle", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), + PATIENT_DEPOSIT_REFUND("Patient Deposit - Refund", BillCategory.REFUND, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), + PATIENT_DEPOSIT_CANCELLED("Patient Deposit - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER); private final String label; private final BillCategory billCategory; 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 15d44983df1522a6335d3d6049d8aeda9bad7e3f Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:31:44 +0530 Subject: [PATCH 3/6] Signed-off-by: DamithDeshan --- src/main/webapp/payments/pay_index.xhtml | 11 +++++++++++ src/main/webapp/resources/ezcomp/menu.xhtml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/payments/pay_index.xhtml b/src/main/webapp/payments/pay_index.xhtml index 37e9ba0afa..1df3ebfafb 100644 --- a/src/main/webapp/payments/pay_index.xhtml +++ b/src/main/webapp/payments/pay_index.xhtml @@ -58,6 +58,17 @@ + +
+ + +
+ +
diff --git a/src/main/webapp/resources/ezcomp/menu.xhtml b/src/main/webapp/resources/ezcomp/menu.xhtml index b1d2237c9f..a0f7278372 100644 --- a/src/main/webapp/resources/ezcomp/menu.xhtml +++ b/src/main/webapp/resources/ezcomp/menu.xhtml @@ -1088,7 +1088,7 @@ - + From a4b93558b280da369252dd90cbb7d3c2ca4aeeb6 Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:31:53 +0530 Subject: [PATCH 4/6] Signed-off-by: DamithDeshan --- src/main/resources/META-INF/persistence.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index de4dab8214..5d9f348894 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,10 +1,8 @@ - - org.eclipse.persistence.jpa.PersistenceProvider - jdbc/hims + jdbc/arogya false @@ -13,7 +11,7 @@ - jdbc/himsAduit + jdbc/arogyaAudit com.divudi.entity.AuditEvent true @@ -22,5 +20,4 @@ - From 2b65563c3a2da2df5cdfd128a316c0ca9da225ef Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:32:04 +0530 Subject: [PATCH 5/6] Signed-off-by: DamithDeshan --- .../divudi/bean/common/EnumController.java | 21 ++- .../divudi/bean/common/PatientController.java | 122 ++++++++++++++++++ 2 files changed, 141 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/EnumController.java b/src/main/java/com/divudi/bean/common/EnumController.java index e3716f960a..20e8bad9e3 100644 --- a/src/main/java/com/divudi/bean/common/EnumController.java +++ b/src/main/java/com/divudi/bean/common/EnumController.java @@ -73,6 +73,8 @@ public class EnumController implements Serializable { List paymentMethodsForChanneling; List paymentMethodsForChannelSettling; List paymentMethodsForPharmacyBilling; + private List paymentMethodsForPatientDepositRefund; + private List paymentMethodsForPatientDeposit; private List paymentMethodsForStaffCreditSettle; SessionNumberType[] sessionNumberTypes; @@ -141,8 +143,8 @@ public List getPaymentMethodsForChanneling() { } return paymentMethodsForChanneling; } - - public List getPaymentMethodsForChannelSettling() { + + public List getPaymentMethodsForChannelSettling() { if (paymentMethodsForChannelSettling == null) { fillPaymentMethodsForChannelSettling(); } @@ -852,4 +854,19 @@ public void setPaymentMethodsForStaffCreditSettle(List paymentMet this.paymentMethodsForStaffCreditSettle = paymentMethodsForStaffCreditSettle; } + public List getPaymentMethodsForPatientDepositRefund() { + paymentMethodsForPatientDepositRefund = new ArrayList<>(); + for (PaymentMethod pm : PaymentMethod.values()) { + boolean include = configOptionApplicationController.getBooleanValueByKey(pm.getLabel() + " is available for Patient Deposit Return", true); + if (include) { + paymentMethodsForPatientDepositRefund.add(pm); + } + } + return paymentMethodsForPatientDepositRefund; + } + + public void setPaymentMethodsForPatientDepositRefund(List paymentMethodsForPatientDepositRefund) { + this.paymentMethodsForPatientDepositRefund = paymentMethodsForPatientDepositRefund; + } + } diff --git a/src/main/java/com/divudi/bean/common/PatientController.java b/src/main/java/com/divudi/bean/common/PatientController.java index ec01f37c7c..a7428cfaf6 100644 --- a/src/main/java/com/divudi/bean/common/PatientController.java +++ b/src/main/java/com/divudi/bean/common/PatientController.java @@ -57,6 +57,7 @@ import com.divudi.facade.PersonFacade; import com.divudi.facade.WebUserFacade; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.data.BillTypeAtomic; import com.divudi.entity.Department; import com.divudi.java.CommonFunctions; import java.io.ByteArrayInputStream; @@ -941,6 +942,15 @@ public void clearDataForPatientDeposite() { printPreview = false; } + public void clearDataForPatientRefund() { + current = null; + paymentMethodData = new PaymentMethodData(); + bill = new Bill(); + billItem = new BillItem(); + billItems = new ArrayList<>(); + printPreview = false; + } + public String navigateToCollectingCenterBillingFromPatientProfile() { if (current == null) { JsfUtil.addErrorMessage("No patient selected"); @@ -1095,6 +1105,7 @@ public void settleBill(BillType billType, HistoryType historyType, BillNumberSuf billBeanController.setPaymentMethodData(getBill(), getBill().getPaymentMethod(), getPaymentMethodData()); addToBill(); saveBillItem(); + getBill().setBillTypeAtomic(BillTypeAtomic.PATIENT_DEPOSIT); billFacade.edit(getBill()); //TODO: Add Patient Balance History if (patient.getRunningBalance() == null) { @@ -1109,6 +1120,114 @@ public void settleBill(BillType billType, HistoryType historyType, BillNumberSuf } + public String navigateToPatientDepositRefund() { + createNewPatientDepositRefund(); + return "/payments/patient/send?faces-redirect=true;"; + } + + public void makeNull() { + current = null; + paymentMethodData = null; + printPreview = false; + } + + public void createNewPatientDepositRefund() { + makeNull(); + bill = new Bill(); + } + + public void settlePatientDepositReturn() { + if (getPatient().getId() == null) { + JsfUtil.addErrorMessage("Please Create Patient Account"); + return; + } + if (getBill().getPaymentMethod() == null) { + JsfUtil.addErrorMessage("Please select a Payment Method"); + return; + } + + if (!getPatient().getHasAnAccount() || getPatient().getHasAnAccount() == null) { + JsfUtil.addErrorMessage("Patient has No Account"); + return; + } + + if (getBill().getNetTotal() <= 0.0) { + JsfUtil.addErrorMessage("The Refunded Value is Missing"); + return; + } + + if (getPatient().getRunningBalance() < getBill().getNetTotal()) { + JsfUtil.addErrorMessage("The Refunded Value is more than the Current Deposit Value of the Patient"); + return; + } + + if (getBill().getComments().trim().equalsIgnoreCase("")) { + JsfUtil.addErrorMessage("Please Add Comment"); + return; + } + + if (paymentSchemeController.checkPaymentMethodError(getBill().getPaymentMethod(), paymentMethodData)) { + JsfUtil.addErrorMessage("Please enter all relavent Payment Method Details"); + return; + } + + settleReturnBill(BillType.PatientPaymentRefundBill, HistoryType.PatientDepositReturn, BillNumberSuffix.PDR, current, BillTypeAtomic.PATIENT_DEPOSIT_REFUND); + printPreview = true; + } + + public void settleReturnBill(BillType billType, HistoryType historyType, BillNumberSuffix billNumberSuffix, Patient patient, BillTypeAtomic billTypeAtomic) { + saveBill(billType, billNumberSuffix, patient, billTypeAtomic); + billBeanController.setPaymentMethodData(getBill(), getBill().getPaymentMethod(), getPaymentMethodData()); + addToBill(); + saveBillItem(); + billFacade.edit(getBill()); + //TODO: Add Patient Balance History + patient.setRunningBalance(Math.abs(patient.getRunningBalance()) - Math.abs(getBill().getNetTotal())); + getFacade().edit(patient); + + JsfUtil.addSuccessMessage("Bill Saved"); + } + + private void saveBill(BillType billType, BillNumberSuffix billNumberSuffix, Patient patient, BillTypeAtomic billTypeAtomic) { + getBill().setInsId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getInstitution(), billType, BillClassType.BilledBill, billNumberSuffix)); + getBill().setDeptId(getBillNumberBean().departmentBillNumberGenerator(sessionController.getDepartment(), billType, BillClassType.BilledBill, billNumberSuffix)); + getBill().setBillType(billType); + + getBill().setPatient(patient); + + getBill().setCreatedAt(new Date()); + getBill().setCreater(sessionController.getLoggedUser()); + getBill().setBillDate(new Date()); + getBill().setBillTime(new Date()); + + getBill().setDepartment(getSessionController().getLoggedUser().getDepartment()); + getBill().setInstitution(getSessionController().getLoggedUser().getInstitution()); + + getBill().setCreatedAt(new Date()); + getBill().setCreater(getSessionController().getLoggedUser()); + + getBill().setGrantTotal(-getBill().getNetTotal()); + getBill().setTotal(-getBill().getNetTotal()); + getBill().setDiscount(0.0); + getBill().setDiscountPercent(0); + getBill().setBillTypeAtomic(billTypeAtomic); + + if (getBill().getId() == null) { + billFacade.create(getBill()); + } else { + billFacade.edit(getBill()); + } + } + + public void pasteCurrentPatientRunningBalance() { + if (current != null) { + getBill().setNetTotal(current.getRunningBalance()); + } else { + JsfUtil.addErrorMessage("Please Select the Patient"); + } + + } + public void addToBill() { getBillItem().setNetValue(getBill().getNetTotal()); getBillItem().setGrossValue(getBill().getNetTotal()); @@ -3500,6 +3619,9 @@ public void setPaymentMethodData(PaymentMethodData paymentMethodData) { } public BillItem getBillItem() { + if (billItem == null) { + billItem = new BillItem(); + } return billItem; } From cee5856a204b0cd6748f71ddab46a25210165e70 Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Sun, 4 Aug 2024 23:32:47 +0530 Subject: [PATCH 6/6] closes#6439 Signed-off-by: DamithDeshan --- src/main/webapp/payments/patient/send.xhtml | 149 ++++++++++++++++++ .../ezcomp/common/patient_details.xhtml | 17 +- .../five_five_paper_patient_deposit.xhtml | 5 +- 3 files changed, 159 insertions(+), 12 deletions(-) create mode 100644 src/main/webapp/payments/patient/send.xhtml diff --git a/src/main/webapp/payments/patient/send.xhtml b/src/main/webapp/payments/patient/send.xhtml new file mode 100644 index 0000000000..b174c908a8 --- /dev/null +++ b/src/main/webapp/payments/patient/send.xhtml @@ -0,0 +1,149 @@ + + + + + + + + + + +
+
+ +
+
+ + + + +
+
+
+
+
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + +
+
+
+
+
+
+
+ +
+ +
+ +
diff --git a/src/main/webapp/resources/ezcomp/common/patient_details.xhtml b/src/main/webapp/resources/ezcomp/common/patient_details.xhtml index a7846d12fd..30ac8968a2 100644 --- a/src/main/webapp/resources/ezcomp/common/patient_details.xhtml +++ b/src/main/webapp/resources/ezcomp/common/patient_details.xhtml @@ -374,16 +374,17 @@ - + - - - + + + + + diff --git a/src/main/webapp/resources/ezcomp/prints/five_five_paper_patient_deposit.xhtml b/src/main/webapp/resources/ezcomp/prints/five_five_paper_patient_deposit.xhtml index 4fca9f0486..28b7dc0a3c 100644 --- a/src/main/webapp/resources/ezcomp/prints/five_five_paper_patient_deposit.xhtml +++ b/src/main/webapp/resources/ezcomp/prints/five_five_paper_patient_deposit.xhtml @@ -18,9 +18,6 @@ - - -
@@ -188,7 +185,7 @@
- +