IDEMPIERE-3397 Multi Currency: Matched PO post wrong amount to PPV account for Standard Costing

This commit is contained in:
Heng Sin Low 2017-06-20 13:15:17 +08:00
parent 6770328dbf
commit 9124546345
1 changed files with 5 additions and 5 deletions

View File

@ -187,9 +187,6 @@ public class Doc_MatchPO extends Doc
MInOut inOut = receiptLine.getParent(); MInOut inOut = receiptLine.getParent();
boolean isReturnTrx = inOut.getMovementType().equals(X_M_InOut.MOVEMENTTYPE_VendorReturns); boolean isReturnTrx = inOut.getMovementType().equals(X_M_InOut.MOVEMENTTYPE_VendorReturns);
// calculate po cost
BigDecimal deliveredCost = poCost.multiply(getQty()); // Delivered so far
Map<Integer, BigDecimal> landedCostMap = new LinkedHashMap<Integer, BigDecimal>(); Map<Integer, BigDecimal> landedCostMap = new LinkedHashMap<Integer, BigDecimal>();
BigDecimal landedCost = BigDecimal.ZERO; BigDecimal landedCost = BigDecimal.ZERO;
int C_OrderLine_ID = m_oLine.getC_OrderLine_ID(); int C_OrderLine_ID = m_oLine.getC_OrderLine_ID();
@ -230,8 +227,7 @@ public class Doc_MatchPO extends Doc
} }
landedCostMap.put(elementId, elementAmt); landedCostMap.put(elementId, elementAmt);
} }
BigDecimal totalCost = deliveredCost.add(landedCost);
// Different currency // Different currency
if (m_oLine.getC_Currency_ID() != as.getC_Currency_ID()) if (m_oLine.getC_Currency_ID() != as.getC_Currency_ID())
{ {
@ -258,6 +254,10 @@ public class Doc_MatchPO extends Doc
return null; return null;
} }
// calculate po cost
BigDecimal deliveredCost = poCost.multiply(getQty()); // Delivered so far
BigDecimal totalCost = deliveredCost.add(landedCost);
// Calculate PPV for standard costing // Calculate PPV for standard costing
MProduct product = MProduct.get(getCtx(), getM_Product_ID()); MProduct product = MProduct.get(getCtx(), getM_Product_ID());
String costingMethod = product.getCostingMethod(as); String costingMethod = product.getCostingMethod(as);