1003754 Landed cost issue -- related to IDEMPIERE-1285. Fix landed cost posting.
This commit is contained in:
parent
2915294c5c
commit
06ce3aae94
|
@ -977,6 +977,25 @@ public class Doc_Invoice extends Doc
|
||||||
fl.setQty(line.getQty());
|
fl.setQty(line.getQty());
|
||||||
}
|
}
|
||||||
else if (compare < 0)
|
else if (compare < 0)
|
||||||
|
{
|
||||||
|
drAmt = dr ? (reversal ? null : allocationAmt) : (reversal ? allocationAmt : null);
|
||||||
|
crAmt = dr ? (reversal ? allocationAmt : null) : (reversal ? null : allocationAmt);
|
||||||
|
account = pc.getAccount(ProductCost.ACCTTYPE_P_LandedCostClearing, as);
|
||||||
|
FactLine fl = fact.createLine (line, account, getC_Currency_ID(), drAmt, crAmt);
|
||||||
|
fl.setDescription(desc);
|
||||||
|
fl.setM_Product_ID(lca.getM_Product_ID());
|
||||||
|
fl.setQty(line.getQty());
|
||||||
|
|
||||||
|
BigDecimal underAmt = estimatedAmt.subtract(allocationAmt);
|
||||||
|
drAmt = dr ? (reversal ? underAmt : null) : (reversal ? null : underAmt);
|
||||||
|
crAmt = dr ? (reversal ? null : underAmt) : (reversal ? underAmt : null);
|
||||||
|
account = zeroQty ? pc.getAccount(ProductCost.ACCTTYPE_P_AverageCostVariance, as) : pc.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
|
||||||
|
fl = fact.createLine (line, account, getC_Currency_ID(), drAmt, crAmt);
|
||||||
|
fl.setDescription(desc);
|
||||||
|
fl.setM_Product_ID(lca.getM_Product_ID());
|
||||||
|
fl.setQty(line.getQty());
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
drAmt = dr ? (reversal ? null : allocationAmt) : (reversal ? allocationAmt : null);
|
drAmt = dr ? (reversal ? null : allocationAmt) : (reversal ? allocationAmt : null);
|
||||||
crAmt = dr ? (reversal ? allocationAmt : null) : (reversal ? null : allocationAmt);
|
crAmt = dr ? (reversal ? allocationAmt : null) : (reversal ? null : allocationAmt);
|
||||||
|
|
Loading…
Reference in New Issue