Skip to content

Commit

Permalink
Fixed #6361
Browse files Browse the repository at this point in the history
Signed-off-by: Lawan Samarasekara <[email protected]>
  • Loading branch information
DARKDRAGON-LK committed Aug 4, 2024
1 parent e48840b commit a4ccd8c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class EnumController implements Serializable {
@Inject
ConfigOptionApplicationController configOptionApplicationController;
List<PaymentMethod> paymentMethodsForOpdBilling;
List<PaymentMethod> paymentMethodsForOpdBillCanceling;
List<PaymentMethod> paymentMethodsForChanneling;
List<PaymentMethod> paymentMethodsForChannelSettling;
List<PaymentMethod> paymentMethodsForPharmacyBilling;
Expand Down Expand Up @@ -124,6 +125,16 @@ public void fillPaymentMethodsForOpdBilling() {
}
}
}

public void fillPaymentMethodsForOpdBillCanceling() {
paymentMethodsForOpdBillCanceling = new ArrayList<>();
for (PaymentMethod pm : PaymentMethod.values()) {
boolean include = configOptionApplicationController.getBooleanValueByKey(pm.getLabel() + " is available for OPD Bill Canceling", true);
if (include) {
paymentMethodsForOpdBillCanceling.add(pm);
}
}
}

public void fillPaymentMethodsForPackageBilling() {
paymentMethodsForOpdBilling = new ArrayList<>();
Expand Down Expand Up @@ -852,4 +863,15 @@ public void setPaymentMethodsForStaffCreditSettle(List<PaymentMethod> paymentMet
this.paymentMethodsForStaffCreditSettle = paymentMethodsForStaffCreditSettle;
}

public List<PaymentMethod> getPaymentMethodsForOpdBillCanceling() {
if (paymentMethodsForOpdBillCanceling == null) {
fillPaymentMethodsForOpdBillCanceling();
}
return paymentMethodsForOpdBillCanceling;
}

public void setPaymentMethodsForOpdBillCanceling(List<PaymentMethod> paymentMethodsForOpdBillCanceling) {
this.paymentMethodsForOpdBillCanceling = paymentMethodsForOpdBillCanceling;
}

}
2 changes: 1 addition & 1 deletion src/main/webapp/opd/batch_bill_cancel.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<p:selectOneMenu id="cmbPs" value="#{billController.paymentMethod}"
rendered="#{billController.batchBill.billType eq 'OpdBathcBill'}">
<f:selectItem itemLabel="Select paymentMethod"/>
<f:selectItems value="#{inwardPaymentController.paymentMethods}"/>
<f:selectItems value="#{enumController.paymentMethodsForOpdBillCanceling}"/>
</p:selectOneMenu>

<p:selectOneMenu id="cmbPs2" value="#{billController.paymentMethod}"
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/opd/bill_cancel.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
value="#{billSearch.paymentMethod}"
rendered="#{billSearch.bill.billType eq 'OpdBill'}">
<f:selectItem itemLabel="Select paymentMethod"/>
<f:selectItems value="#{inwardPaymentController.paymentMethods}"/>
<f:selectItems value="#{enumController.paymentMethodsForOpdBillCanceling}"/>
</p:selectOneMenu>

<p:selectOneMenu id="cmbPs2" value="#{billSearch.paymentMethod}"
Expand Down

0 comments on commit a4ccd8c

Please sign in to comment.