From 332822670de7126dc504dc67a98e047837e4d2d8 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Thu, 19 Feb 2009 16:56:14 +0000 Subject: [PATCH] [ 2530003 ] It is not rolling up correctly the lower level costs https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2530003&group_id=176962 Fixing precision issues. --- base/src/org/eevolution/model/MPPProductBOMLine.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/src/org/eevolution/model/MPPProductBOMLine.java b/base/src/org/eevolution/model/MPPProductBOMLine.java index b412bf0318..f8afb7c2f7 100644 --- a/base/src/org/eevolution/model/MPPProductBOMLine.java +++ b/base/src/org/eevolution/model/MPPProductBOMLine.java @@ -167,10 +167,11 @@ public class MPPProductBOMLine extends X_PP_Product_BOMLine */ public BigDecimal getQty(boolean includeScrapQty) { - final int precision = getPrecision(); + int precision = getPrecision(); BigDecimal qty; if (isQtyPercentage()) { + precision += 2; qty = getQtyBatch().divide(Env.ONEHUNDRED, precision, RoundingMode.HALF_UP); } else @@ -186,7 +187,7 @@ public class MPPProductBOMLine extends X_PP_Product_BOMLine // if (qty.scale() > precision) { - qty = qty.setScale(getPrecision(), RoundingMode.HALF_UP); + qty = qty.setScale(precision, RoundingMode.HALF_UP); } // return qty;