try {
EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId),
EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")),
EntityOperator.AND);
currentPrefs = delegator.findList("OrderPaymentPreference", ecl, null, null, null, false);
} catch (GenericEntityException e) {
Debug.logError(e, "ERROR: Unable to get existing payment preferences from order", module);
}
if (UtilValidate.isNotEmpty(currentPrefs)) {
Iterator cpi = currentPrefs.iterator();