A patch from Akash Jain "Find Order functionality thrown error when find orders for billingAccountId" (https://issues.apache.org/jira/browse/OFBIZ-2843) - OFBIZ-2843

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@812159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2009-09-07 14:42:42 +00:00
parent 0b0e5143d7
commit c74b51015c
@@ -417,9 +417,8 @@ public class OrderLookupServices {
String cardNumber = (String) context.get("cardNumber");
String accountNumber = (String) context.get("accountNumber");
if (billingAccountId != null || finAccountId != null || cardNumber != null || accountNumber != null) {
if (finAccountId != null || cardNumber != null || accountNumber != null) {
dve.addMemberEntity("OP", "OrderPaymentPreference");
dve.addAlias("OP", "billingAccountId");
dve.addAlias("OP", "finAccountId");
dve.addAlias("OP", "paymentMethodId");
dve.addViewLink("OH", "OP", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("orderId", "orderId")));
@@ -427,6 +426,9 @@ public class OrderLookupServices {
// search by billing account ID
if (UtilValidate.isNotEmpty(billingAccountId)) {
dve.addMemberEntity("BL", "BillingAccount");
dve.addAlias("BL", "billingAccountId");
dve.addViewLink("OH", "BL", Boolean.FALSE, UtilMisc.toList(new ModelKeyMap("billingAccountId", "billingAccountId")));
paramList.add("billingAccountId=" + billingAccountId);
conditions.add(makeExpr("billingAccountId", billingAccountId));
}