From c74b51015ccd2f0c5170d03decd103b012011e2f Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Mon, 7 Sep 2009 14:42:42 +0000 Subject: [PATCH] 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 --- .../src/org/ofbiz/order/order/OrderLookupServices.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java b/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java index 18dc3a41a9..05ab5ce1ec 100644 --- a/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java +++ b/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java @@ -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)); }