From 6a7b6807ced8b8991a9926f3ffe5305fe71d010c Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 12 Sep 2016 18:10:33 +0800 Subject: [PATCH] IDEMPIERE-3170 Return to Vendor propagate wrong cost amount to Organization accounting schema denoted in different currency --- .../src/org/compiere/acct/Doc_InOut.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java index 459d16e2bb..e9fb2fd1e8 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -24,6 +24,7 @@ import java.util.logging.Level; import org.compiere.model.I_M_InOutLine; import org.compiere.model.I_M_RMALine; +import org.compiere.model.MConversionRate; import org.compiere.model.MOrderLandedCostAllocation; import org.compiere.model.MTax; import org.compiere.model.MCurrency; @@ -624,6 +625,15 @@ public class Doc_InOut extends Doc costs = costs.subtract(costTax); } } // correct included Tax + + // different currency + if (C_Currency_ID != originalOrderLine.getC_Currency_ID()) + { + costs = MConversionRate.convert (getCtx(), + costs, originalOrderLine.getC_Currency_ID(), C_Currency_ID, + getDateAcct(), 0, getAD_Client_ID(), getAD_Org_ID(), true); + } + costs = costs.multiply(line.getQty()); costs = costs.negate(); }