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
This commit is contained in:
Jacopo Cappellato
2009-06-10 07:41:11 +00:00
parent 9c6dd8c9c1
commit d246f60d01
@@ -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));
}
}