BF1985495 - Errors in MCost and MCostElement classes

This commit is contained in:
tspc 2008-06-05 14:20:11 +00:00
parent 72a2978dcf
commit 1a920db54e
2 changed files with 7 additions and 16 deletions

View File

@ -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<MCost> 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<MCost> list = query.list();
for (MCost cost : list)
{

View File

@ -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<MCost> list = query.list();
query.setParameters(new Object[]{AD_Client_ID, AD_Org_ID});
List<MCostElement> list = query.list();
MCostElement[] retValue = new MCostElement[list.size()];
list.toArray(retValue);
return retValue;