Error in MCostDetail.getByDocLineMatchInv()

Description

Getting this error when running the client accounting processor in a fresh install in GW.

===========> Doc_MatchInv.post: [47]
org.adempiere.exceptions.DBException: org.postgresql.util.PSQLException: No value specified for parameter 7., SQL=SELECT SUM(CostAdjustment + CostAdjustmentLL) FROM M_CostDetail WHERE (AD_Client_ID=? AND C_AcctSchema_ID=? AND M_Product_ID=? AND M_AttributeSetInstance_ID=? AND M_CostType_ID=? AND C_InvoiceLine_ID=? AND M_InOutLine_ID=?)
at org.compiere.model.Query.aggregate(Query.java:528)
at org.compiere.model.Query.aggregate(Query.java:445)
at org.compiere.model.MCostDetail.getByDocLineMatchInv(MCostDetail.java:1628)
at org.compiere.acct.Doc_MatchInv.createFacts(Doc_MatchInv.java:346)
at org.compiere.acct.Doc.postLogic(Doc.java:759)
at org.compiere.acct.Doc.post(Doc.java:643)
at org.adempiere.process.ClientAcctProcessor.postSession(ClientAcctProcessor.java:237)
at org.adempiere.process.ClientAcctProcessor.doIt(ClientAcctProcessor.java:111)
at org.compiere.process.SvrProcess.process(SvrProcess.java:147)
at org.compiere.process.SvrProcess.startProcess(SvrProcess.java:105)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:160)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:105)
at org.compiere.apps.ProcessCtl.startProcess(ProcessCtl.java:649)
at org.compiere.apps.ProcessCtl.run(ProcessCtl.java:394)

Issue is the following code which is looking for an attribute set instance parameter but one is not set.

public static BigDecimal getByDocLineMatchInv(MInvoiceLine invoiceLine, MInOutLine inOutLine ,int acctSchemaId, int costTypeId)
{
final StringBuilder whereClause = new StringBuilder();
whereClause.append(COLUMNNAME_AD_Client_ID).append("=? AND ")
.append(COLUMNNAME_C_AcctSchema_ID).append("=? AND ")
.append(COLUMNNAME_M_Product_ID).append( "=? AND ")
.append(COLUMNNAME_M_AttributeSetInstance_ID + "=? AND ")
.append(COLUMNNAME_M_CostType_ID).append("=? AND ")
.append(COLUMNNAME_C_InvoiceLine_ID).append("=? AND ")
.append(COLUMNNAME_M_InOutLine_ID).append("=?");

return new Query (invoiceLine.getCtx(), I_M_CostDetail.Table_Name, whereClause.toString() , invoiceLine.get_TrxName())
.setParameters(
invoiceLine.getAD_Client_ID(),
acctSchemaId,
invoiceLine.getM_Product_ID(),
costTypeId,
invoiceLine.getC_InvoiceLine_ID(),
inOutLine.getM_InOutLine_ID())
.aggregate(COLUMNNAME_CostAdjustment + " + " +
COLUMNNAME_CostAdjustmentLL, Query.AGGREGATE_SUM);
}

Environment

None

Assignee

Unassigned

Reporter

Michael McKay

Labels

None

Components

Fix versions

Priority

Major
Configure