From a1332d890a52e032d181a8ebcda13f01478d9ec5 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 26 Feb 2014 14:08:06 +0800 Subject: [PATCH] 1003759 How to re-post a document if Charge type is changed in Product? ( related to IDEMPIERE-216 Average Costing: Zero Costing Item From Vendor but for standard costing ). --- org.adempiere.base/src/org/compiere/acct/Doc_InOut.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 59d72ef6de..459d16e2bb 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -412,6 +412,7 @@ public class Doc_InOut extends Doc int C_OrderLine_ID = line.getC_OrderLine_ID(); if (C_OrderLine_ID > 0) { + orderLine = new MOrderLine (getCtx(), C_OrderLine_ID, getTrxName()); MOrderLandedCostAllocation[] allocations = MOrderLandedCostAllocation.getOfOrderLine(C_OrderLine_ID, getTrxName()); for(MOrderLandedCostAllocation allocation : allocations) { @@ -421,15 +422,15 @@ public class Doc_InOut extends Doc landedCost = landedCost.add(amt); } } + //get costing method for product if (MAcctSchema.COSTINGMETHOD_AveragePO.equals(costingMethod) || MAcctSchema.COSTINGMETHOD_AverageInvoice.equals(costingMethod) || MAcctSchema.COSTINGMETHOD_LastPOPrice.equals(costingMethod) ) - { + { // Low - check if c_orderline_id is valid - if (C_OrderLine_ID > 0) + if (orderLine != null) { - orderLine = new MOrderLine (getCtx(), C_OrderLine_ID, getTrxName()); // Elaine 2008/06/26 C_Currency_ID = orderLine.getC_Currency_ID(); //