1003754 Landed cost issue -- related to IDEMPIERE-1285. Fixed the transfer of invoice price variance to product cost for average invoice and average po costing.
This commit is contained in:
parent
5f2afcf93a
commit
a6bbb96983
|
@ -403,6 +403,16 @@ public class Doc_MatchInv extends Doc
|
|||
as.getC_Currency_ID(), ipv.negate());
|
||||
updateFactLine(line);
|
||||
|
||||
line = fact.createLine(null, account, as.getC_Currency_ID(), ipv);
|
||||
updateFactLine(line);
|
||||
} else if (X_M_Cost.COSTINGMETHOD_AverageInvoice.equals(costingMethod) && !zeroQty) {
|
||||
MAccount account = m_pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
||||
|
||||
FactLine line = fact.createLine(null,
|
||||
m_pc.getAccount(ProductCost.ACCTTYPE_P_IPV, as),
|
||||
as.getC_Currency_ID(), ipv.negate());
|
||||
updateFactLine(line);
|
||||
|
||||
line = fact.createLine(null, account, as.getC_Currency_ID(), ipv);
|
||||
updateFactLine(line);
|
||||
}
|
||||
|
|
|
@ -1828,6 +1828,18 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
matchPO++;
|
||||
if (!po.isPosted() && po.getM_InOutLine_ID() > 0) // match po don't post if receipt is not assigned, and it doesn't create avg po record
|
||||
addDocsPostProcess(po);
|
||||
|
||||
MMatchInv[] matchInvoices = MMatchInv.getInvoiceLine(getCtx(), line.getC_InvoiceLine_ID(), get_TrxName());
|
||||
if (matchInvoices != null && matchInvoices.length > 0)
|
||||
{
|
||||
for(MMatchInv matchInvoice : matchInvoices)
|
||||
{
|
||||
if (!matchInvoice.isPosted())
|
||||
{
|
||||
addDocsPostProcess(matchInvoice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue