[ 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.
This commit is contained in:
teo_sarca 2009-02-19 16:56:14 +00:00
parent ec11810ad2
commit 332822670d
1 changed files with 3 additions and 2 deletions

View File

@ -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;