1003754 Landed cost issue -- related to IDEMPIERE-1285. Fix landed cost allocation to product not working.

This commit is contained in:
Heng Sin Low 2014-05-19 14:39:38 +08:00
parent 03f22d1ca4
commit 86207e9729
1 changed files with 10 additions and 0 deletions

View File

@ -1142,6 +1142,16 @@ public class MInvoiceLine extends X_C_InvoiceLine
MLandedCostAllocation lca = new MLandedCostAllocation (this, lc.getM_CostElement_ID());
lca.setM_Product_ID(lc.getM_Product_ID()); // No ASI
lca.setAmt(getLineNetAmt());
if (lc.getLandedCostDistribution().equals(MLandedCost.LANDEDCOSTDISTRIBUTION_Costs))
{
lca.setBase(getLineNetAmt());
lca.setQty(getLineNetAmt());
}
else
{
lca.setBase(getQtyInvoiced());
lca.setQty(getQtyInvoiced());
}
if (lca.save())
return "";
msgreturn = new StringBuilder("Cannot save Product Allocation = ").append(lc);