Skip to content

Commit

Permalink
closes#6079
Browse files Browse the repository at this point in the history
Signed-off-by: DamithDeshan <[email protected]>
  • Loading branch information
DamithDeshan committed Jul 26, 2024
1 parent ecfdcc1 commit c1bfad3
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions src/main/java/com/divudi/bean/common/BillSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1399,18 +1398,11 @@ public void setBillFees(List<BillFee> 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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c1bfad3

Please sign in to comment.