From c1bfad36e88eef004cebda8d88eaa611f2d9487c Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Fri, 26 Jul 2024 10:08:20 +0530 Subject: [PATCH] closes#6079 Signed-off-by: DamithDeshan --- .../com/divudi/bean/common/BillSearch.java | 43 ++++++++----------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/BillSearch.java b/src/main/java/com/divudi/bean/common/BillSearch.java index 776a32ddd5..3fa7a2c48d 100644 --- a/src/main/java/com/divudi/bean/common/BillSearch.java +++ b/src/main/java/com/divudi/bean/common/BillSearch.java @@ -181,7 +181,6 @@ public class BillSearch implements Serializable { private BillLight billLight; private Bill printingBill; private PaymentMethod paymentMethod; - private PaymentMethod refundMethod; private RefundBill billForRefund; @Temporal(TemporalType.TIME) private Date fromDate; @@ -1399,18 +1398,11 @@ public void setBillFees(List billFees) { public void setSessionController(SessionController sessionController) { this.sessionController = sessionController; } - + public PaymentMethod getPaymentMethod() { - if (paymentMethod != null) { - if (configOptionApplicationController.getBooleanValueByKey("Set the Original Bill PaymentMethod to Cancelation Bill")) { - paymentMethod = getBill().getPaymentMethod(); - } else { - paymentMethod = PaymentMethod.Cash; - } - } return paymentMethod; } - + public void setPaymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } @@ -2737,8 +2729,14 @@ public String navigateToCancelOpdBill() { JsfUtil.addErrorMessage("Nothing to cancel"); return ""; } - System.out.println("bill = " + bill.getIdStr()); - paymentMethod = bill.getPaymentMethod(); + //System.out.println("bill = " + bill.getIdStr()); + + if (configOptionApplicationController.getBooleanValueByKey("Set the Original Bill PaymentMethod to Cancelation Bill")) { + paymentMethod = bill.getPaymentMethod(); + } else { + paymentMethod = PaymentMethod.Cash; + } + //System.out.println("Cencel = " + paymentMethod); createBillItemsAndBillFees(); boolean flag = billController.checkBillValues(bill); bill.setTransError(flag); @@ -2895,7 +2893,13 @@ public String navigateToRefundOpdBill() { JsfUtil.addErrorMessage("Nothing to cancel"); return ""; } - paymentMethod = getBill().getPaymentMethod(); + + if(configOptionApplicationController.getBooleanValueByKey("Set the Original Bill PaymentMethod to Refunded Bill")){ + paymentMethod = getBill().getPaymentMethod(); + }else{ + paymentMethod = PaymentMethod.Cash; + } + //System.out.println("Refund"+ paymentMethod); try { createBillItemsAndBillFeesForOpdRefund(); } catch (IllegalAccessException ex) { @@ -3962,19 +3966,6 @@ public void setReferredBy(Doctor referredBy) { this.referredBy = referredBy; } - public PaymentMethod getRefundMethod() { - if(configOptionApplicationController.getBooleanValueByKey("Set the Original Bill PaymentMethod to Refunded Bill")){ - refundMethod = getBill().getPaymentMethod(); - }else{ - refundMethod = PaymentMethod.Cash; - } - return refundMethod; - } - - public void setRefundMethod(PaymentMethod refundMethod) { - this.refundMethod = refundMethod; - } - public class PaymentSummary { private long idCounter = 0;