From d246f60d010b236bba2cc48d9e55dd90fbbf251e Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Wed, 10 Jun 2009 07:41:11 +0000 Subject: [PATCH] Set number of decimals for sell-through data. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@783244 13f79535-47bb-0310-9956-ffa450edef68 --- .../actions/facility/ComputeProductSellThroughData.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy b/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy index 122767e7f3..4060fca72e 100644 --- a/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy +++ b/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy @@ -17,6 +17,9 @@ * under the License. */ +import java.math.MathContext; + + if (parameters.fromDateSellThrough) { Timestamp fromDate = null; Timestamp thruDate = null; @@ -29,6 +32,6 @@ if (parameters.fromDateSellThrough) { inventoryShippedForSalesResult = dispatcher.runSync("countProductInventoryShippedForSales", [productId : productId, facilityId : facilityId, fromDate : fromDate, thruDate : thruDate, userLogin : userLogin]); context.sellThroughInitialInventory = inventoryCountResult.quantityOnHandTotal; context.sellThroughInventorySold = inventoryShippedForSalesResult.quantityOnHandTotal; - context.sellThroughPercentage = inventoryShippedForSalesResult.quantityOnHandTotal / inventoryCountResult.quantityOnHandTotal * 100; + context.sellThroughPercentage = new BigDecimal(inventoryShippedForSalesResult.quantityOnHandTotal / inventoryCountResult.quantityOnHandTotal * 100, new java.math.MathContext(2)); } }