From 67263d7e652ae3f3a0577a47e291ccbc4730947b Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Wed, 28 Jan 2009 23:13:36 +0000 Subject: [PATCH] It is not rolling up correctly the lower level costs http://sourceforge.net/tracker2/?func=detail&aid=2530003&group_id=176962&atid=879332 --- .../eevolution/report/CostBillOfMaterial.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/base/src/org/eevolution/report/CostBillOfMaterial.java b/base/src/org/eevolution/report/CostBillOfMaterial.java index e8b293bc9d..adafae6a7c 100644 --- a/base/src/org/eevolution/report/CostBillOfMaterial.java +++ b/base/src/org/eevolution/report/CostBillOfMaterial.java @@ -50,6 +50,8 @@ public class CostBillOfMaterial extends SvrProcess private int p_AD_Org_ID = 0; private int p_C_AcctSchema_ID = 0; private int p_M_Product_ID = 0; + private int p_M_CostType_ID = 0; + private String p_ConstingMethod = MCostElement.COSTINGMETHOD_StandardCosting; private boolean p_implosion = false; // private int m_LevelNo = 0; @@ -73,6 +75,14 @@ public class CostBillOfMaterial extends SvrProcess p_C_AcctSchema_ID= para.getParameterAsInt(); m_as = MAcctSchema.get(getCtx(), p_C_AcctSchema_ID); } + else if (name.equals("M_CostType_ID")) + { + p_M_CostType_ID= para.getParameterAsInt(); + } + else if (name.equals("ConstingMethod")) + { + p_ConstingMethod=(String)para.getParameter(); + } else if (name.equals("M_Product_ID")) { p_M_Product_ID = para.getParameterAsInt(); @@ -97,7 +107,7 @@ public class CostBillOfMaterial extends SvrProcess { throw new FillMandatoryException("M_Product_ID"); } - m_costElements = MCostElement.getByCostingMethod(getCtx(), MCostElement.COSTINGMETHOD_StandardCosting); + m_costElements = MCostElement.getByCostingMethod(getCtx(), p_ConstingMethod); explodeProduct(p_M_Product_ID, false); // return ""; @@ -208,12 +218,12 @@ public class CostBillOfMaterial extends SvrProcess tboml.setLevels(LEVELS.substring(0, m_LevelNo) + m_LevelNo); // // Set Costs: - Collection costs = MCost.getByCostingMethod( + Collection costs = MCost.getByCostType( product, m_as, + p_M_CostType_ID, p_AD_Org_ID, 0, // ASI - MCostElement.COSTINGMETHOD_StandardCosting, costElement.getCostElementType()); BigDecimal currentCostPrice = Env.ZERO; BigDecimal currentCostPriceLL = Env.ZERO;