diff --git a/base/src/org/compiere/model/MCost.java b/base/src/org/compiere/model/MCost.java index aa6fd8631c..5a4c08f437 100644 --- a/base/src/org/compiere/model/MCost.java +++ b/base/src/org/compiere/model/MCost.java @@ -1382,14 +1382,10 @@ public class MCost extends X_M_Cost public static MCost[] getCosts(Properties ctx , int AD_Client_ID, int AD_Org_ID , int M_Product_ID, int M_CostType_ID ,int C_AcctSchema_ID ,String trxName) { - String whereClause = "AD_Client_ID = ? AND AD_Org_ID AND M_Product_ID=? AND C_Acctschema_ID = ? AND M_CostType_ID = ? "; + String whereClause = "AD_Client_ID = ? AND AD_Org_ID = ? AND M_Product_ID= ? AND C_Acctschema_ID = ? AND M_CostType_ID = ? "; Query query = MTable.get(ctx, MCost.Table_ID) .createQuery(whereClause, trxName); - query.setParameters(new Object[]{AD_Client_ID}); - query.setParameters(new Object[]{AD_Org_ID}); - query.setParameters(new Object[]{M_Product_ID}); - query.setParameters(new Object[]{M_CostType_ID}); - query.setParameters(new Object[]{C_AcctSchema_ID}); + query.setParameters(new Object[]{AD_Client_ID, AD_Org_ID, M_Product_ID, C_AcctSchema_ID, M_CostType_ID}); List list = query.list(); MCost[] retValue = new MCost[list.size()]; list.toArray(retValue); @@ -1410,14 +1406,10 @@ public class MCost extends X_M_Cost public static MCost get(Properties ctx , int AD_Client_ID, int AD_Org_ID , int M_Product_ID, int M_CostType_ID ,int C_AcctSchema_ID , int M_CostElement_ID ,String trxName) { - String whereClause = "AD_Client_ID = ? AND AD_Org_ID AND M_Product_ID=? AND C_Acctschema_ID = ? AND M_CostType_ID = ? AND M_CostElement_ID=?"; + String whereClause = "AD_Client_ID = ? AND AD_Org_ID = ? AND M_Product_ID=? AND C_Acctschema_ID = ? AND M_CostType_ID = ? AND M_CostElement_ID=?"; Query query = MTable.get(ctx, MCost.Table_ID) .createQuery(whereClause, trxName); - query.setParameters(new Object[]{AD_Client_ID}); - query.setParameters(new Object[]{AD_Org_ID}); - query.setParameters(new Object[]{M_Product_ID}); - query.setParameters(new Object[]{M_CostType_ID}); - query.setParameters(new Object[]{M_CostElement_ID}); + query.setParameters(new Object[]{AD_Client_ID, AD_Org_ID, M_Product_ID, C_AcctSchema_ID, M_CostType_ID, M_CostElement_ID}); List list = query.list(); for (MCost cost : list) { diff --git a/base/src/org/compiere/model/MCostElement.java b/base/src/org/compiere/model/MCostElement.java index fedff6a73e..bd70aa3ebc 100644 --- a/base/src/org/compiere/model/MCostElement.java +++ b/base/src/org/compiere/model/MCostElement.java @@ -251,11 +251,10 @@ public class MCostElement extends X_M_CostElement **/ public static MCostElement[] getElements (Properties ctx , int AD_Client_ID, int AD_Org_ID, String trxName) { - String whereClause = "AD_Client_ID = ? AND AD_Org_ID AND M_Product_ID=? AND C_Acctschema_ID = ? AND M_CostType_ID = ? AND M_CostElement_ID=?"; + String whereClause = "AD_Client_ID = ? AND AD_Org_ID = ?"; Query query = MTable.get(ctx, MCostElement.Table_ID).createQuery(whereClause, trxName); - query.setParameters(new Object[]{AD_Client_ID}); - query.setParameters(new Object[]{AD_Org_ID}); - List list = query.list(); + query.setParameters(new Object[]{AD_Client_ID, AD_Org_ID}); + List list = query.list(); MCostElement[] retValue = new MCostElement[list.size()]; list.toArray(retValue); return retValue;