From 1f382d1b69e0c78385a9e9da9c3984c526e6ba55 Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Thu, 8 Jan 2009 00:20:50 +0000 Subject: [PATCH] Bill of Material Cost Roll-UP do not work appropriately http://sourceforge.net/tracker2/?func=detail&aid=2493004&group_id=176962&atid=879332 --- .../org/eevolution/process/RollupBillOfMaterial.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base/src/org/eevolution/process/RollupBillOfMaterial.java b/base/src/org/eevolution/process/RollupBillOfMaterial.java index 85b1ab1d04..2d6564d6dd 100644 --- a/base/src/org/eevolution/process/RollupBillOfMaterial.java +++ b/base/src/org/eevolution/process/RollupBillOfMaterial.java @@ -137,6 +137,13 @@ public class RollupBillOfMaterial extends SvrProcess cost.setCurrentCostPriceLL(Subcontract); cost.saveEx(); } + else if (element.getCostElementType().equals(MCostElement.COSTELEMENTTYPE_Overhead)) + { + BigDecimal Subcontract = getCurrentCostPriceLL(MCostElement.COSTELEMENTTYPE_Overhead, product); + log.info("Overhead Cost Low Level:" + Subcontract); + cost.setCurrentCostPriceLL(Subcontract); + cost.saveEx(); + } /* TODO Comment for future implementation else if (element.getCostElementType().equals(MCostElement.COSTELEMENTTYPE_Distribution)) { @@ -209,7 +216,8 @@ public class RollupBillOfMaterial extends SvrProcess qtyTotal = qtyBOM.divide(Env.ONE.subtract(scrapDec), 4, BigDecimal.ROUND_HALF_UP); } - costPriceLL = costPriceLL.add(cost.getCurrentCostPriceLL().multiply(qtyTotal)); + BigDecimal costPrice = cost.getCurrentCostPrice().add(cost.getCurrentCostPriceLL()); + costPriceLL = costPriceLL.add(costPrice.multiply(qtyTotal)); log.info("Cost Element:"+element.getName() + ", Total Cost Element: " + costPriceLL + ", QtyPercentage: " + qtyPercentage