From 912454634559026525811dc4fd664928c281add8 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 20 Jun 2017 13:15:17 +0800 Subject: [PATCH] IDEMPIERE-3397 Multi Currency: Matched PO post wrong amount to PPV account for Standard Costing --- .../src/org/compiere/acct/Doc_MatchPO.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java index 9cb6f14d1f..1d271a6b48 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java @@ -187,9 +187,6 @@ public class Doc_MatchPO extends Doc MInOut inOut = receiptLine.getParent(); boolean isReturnTrx = inOut.getMovementType().equals(X_M_InOut.MOVEMENTTYPE_VendorReturns); - // calculate po cost - BigDecimal deliveredCost = poCost.multiply(getQty()); // Delivered so far - Map landedCostMap = new LinkedHashMap(); BigDecimal landedCost = BigDecimal.ZERO; int C_OrderLine_ID = m_oLine.getC_OrderLine_ID(); @@ -230,8 +227,7 @@ public class Doc_MatchPO extends Doc } landedCostMap.put(elementId, elementAmt); } - BigDecimal totalCost = deliveredCost.add(landedCost); - + // Different currency if (m_oLine.getC_Currency_ID() != as.getC_Currency_ID()) { @@ -258,6 +254,10 @@ public class Doc_MatchPO extends Doc return null; } + // calculate po cost + BigDecimal deliveredCost = poCost.multiply(getQty()); // Delivered so far + BigDecimal totalCost = deliveredCost.add(landedCost); + // Calculate PPV for standard costing MProduct product = MProduct.get(getCtx(), getM_Product_ID()); String costingMethod = product.getCostingMethod(as);