You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2009/01/04 20:46:25 UTC
svn commit: r731346 [3/3] - in /ofbiz/branches/typecheckcleanup200810:
applications/accounting/widget/
applications/content/script/org/ofbiz/content/content/
applications/ecommerce/script/org/ofbiz/ecommerce/customer/
applications/ecommerce/webapp/ecom...
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Sun Jan 4 11:46:24 2009
@@ -159,21 +159,21 @@
while (iteratorResult.hasNext()) {
genericResult = (GenericValue) iteratorResult.next();
String productId = genericResult.getString("productId");
- Double reservedQuantity = genericResult.getDouble("reservedQuantity");
- Double shipGroupQuantity = genericResult.getDouble("quantity");
- Double cancelledQuantity = genericResult.getDouble("cancelQuantity");
- Double eventQuantityTmp = new Double(0.0);
+ BigDecimal reservedQuantity = genericResult.getBigDecimal("reservedQuantity");
+ BigDecimal shipGroupQuantity = genericResult.getBigDecimal("quantity");
+ BigDecimal cancelledQuantity = genericResult.getBigDecimal("cancelQuantity");
+ BigDecimal eventQuantityTmp = BigDecimal.ZERO;
if (UtilValidate.isNotEmpty(reservedQuantity)) {
- eventQuantityTmp = new Double(-1.0 * reservedQuantity.doubleValue());
+ eventQuantityTmp = reservedQuantity.negate();
} else {
if (UtilValidate.isNotEmpty(cancelledQuantity)) {
- shipGroupQuantity = new Double(shipGroupQuantity.doubleValue() - cancelledQuantity.doubleValue());
+ shipGroupQuantity = shipGroupQuantity.subtract(cancelledQuantity);
}
- eventQuantityTmp = new Double(-1.0 * shipGroupQuantity.doubleValue());
+ eventQuantityTmp = shipGroupQuantity.negate();
}
- if (eventQuantityTmp.doubleValue() == 0) {
+ if (eventQuantityTmp.compareTo(BigDecimal.ZERO) == 0) {
continue;
}
// This is the order in which order dates are considered:
@@ -220,7 +220,7 @@
while(iteratorResult.hasNext()){
genericResult = (GenericValue) iteratorResult.next();
String productId = genericResult.getString("productId");
- Double eventQuantityTmp = genericResult.getDouble("quantity");
+ BigDecimal eventQuantityTmp = genericResult.getBigDecimal("quantity");
if (productId == null || eventQuantityTmp == null) {
continue;
}
@@ -270,13 +270,13 @@
}
String productId = genericResult.getString("productId");
- Double shipGroupQuantity = genericResult.getDouble("quantity");
- Double cancelledQuantity = genericResult.getDouble("cancelQuantity");
+ BigDecimal shipGroupQuantity = genericResult.getBigDecimal("quantity");
+ BigDecimal cancelledQuantity = genericResult.getBigDecimal("cancelQuantity");
if (UtilValidate.isEmpty(shipGroupQuantity)) {
- shipGroupQuantity = new Double(0);
+ shipGroupQuantity = BigDecimal.ZERO;
}
if (UtilValidate.isNotEmpty(cancelledQuantity)) {
- shipGroupQuantity = new Double(shipGroupQuantity.doubleValue() - cancelledQuantity.doubleValue());
+ shipGroupQuantity = shipGroupQuantity.subtract(cancelledQuantity);
}
OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
@@ -286,7 +286,7 @@
} catch (GenericEntityException e) {
}
if (UtilValidate.isNotEmpty(shippedQuantity)) {
- shipGroupQuantity = new Double(shipGroupQuantity.doubleValue() - shippedQuantity.doubleValue());
+ shipGroupQuantity = shipGroupQuantity.subtract(shippedQuantity);
}
GenericValue orderItemDeliverySchedule = null;
@@ -331,7 +331,7 @@
while(iteratorResult.hasNext()){
genericResult = (GenericValue) iteratorResult.next();
String productId = genericResult.getString("productId");
- Double eventQuantityTmp = new Double(-1.0 * genericResult.getDouble("estimatedQuantity").doubleValue());
+ BigDecimal eventQuantityTmp = genericResult.getBigDecimal("estimatedQuantity").negate();
Timestamp estimatedShipDate = genericResult.getTimestamp("estimatedStartDate");
if (estimatedShipDate == null) {
estimatedShipDate = now;
@@ -365,20 +365,20 @@
if ("PRUN_CLOSED".equals(genericResult.getString("currentStatusId"))) {
continue;
}
- Double qtyToProduce = genericResult.getDouble("quantityToProduce");
+ BigDecimal qtyToProduce = genericResult.getBigDecimal("quantityToProduce");
if (qtyToProduce == null) {
- qtyToProduce = new Double(0);
+ qtyToProduce = BigDecimal.ZERO;
}
- Double qtyProduced = genericResult.getDouble("quantityProduced");
+ BigDecimal qtyProduced = genericResult.getBigDecimal("quantityProduced");
if (qtyProduced == null) {
- qtyProduced = new Double(0);
+ qtyProduced = BigDecimal.ZERO;
}
if (qtyProduced.compareTo(qtyToProduce) >= 0) {
continue;
}
- double qtyDiff = qtyToProduce.doubleValue() - qtyProduced.doubleValue();
+ BigDecimal qtyDiff = qtyToProduce.subtract(qtyProduced);
String productId = genericResult.getString("productId");
- Double eventQuantityTmp = new Double(qtyDiff);
+ BigDecimal eventQuantityTmp = qtyDiff;
Timestamp estimatedShipDate = genericResult.getTimestamp("estimatedCompletionDate");
if (estimatedShipDate == null) {
estimatedShipDate = now;
@@ -408,9 +408,9 @@
while(iteratorResult.hasNext()){
genericResult = (GenericValue) iteratorResult.next();
String productId = genericResult.getString("productId");
- Double minimumStock = genericResult.getDouble("minimumStock");
+ BigDecimal minimumStock = genericResult.getBigDecimal("minimumStock");
if (minimumStock == null) {
- minimumStock = new Double(0);
+ minimumStock = BigDecimal.ZERO;
}
try {
EntityFieldMap ecl = EntityCondition.makeCondition(UtilMisc.toMap("mrpId", mrpId, "productId", productId), EntityOperator.AND);
@@ -422,13 +422,13 @@
Debug.logError(e, "Unable to count MrpEvent records.", module);
return ServiceUtil.returnError("Unable to count MrpEvent records.");
}
- double qoh = findProductMrpQoh(mrpId, productId, facilityId, dispatcher, delegator);
- if (qoh >= minimumStock.longValue()) {
+ BigDecimal qoh = findProductMrpQoh(mrpId, productId, facilityId, dispatcher, delegator);
+ if (qoh.compareTo(minimumStock) >= 0) {
continue;
}
parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", now, "mrpEventTypeId", "REQUIRED_MRP");
try {
- InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, new Double(0.0), null, null, false, delegator);
+ InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, BigDecimal.ZERO, null, null, false, delegator);
} catch (GenericEntityException e) {
return ServiceUtil.returnError("Problem initializing the MrpEvent entity (REQUIRED_MRP)");
}
@@ -475,11 +475,11 @@
while (sfdIter.hasNext()) {
genericResult = (GenericValue) sfdIter.next();
String productId = genericResult.getString("productId");
- Double eventQuantityTmp = genericResult.getDouble("quantity");
+ BigDecimal eventQuantityTmp = genericResult.getBigDecimal("quantity");
if (productId == null || eventQuantityTmp == null) {
continue;
}
- eventQuantityTmp = new Double(-1.0 * eventQuantityTmp.doubleValue());
+ eventQuantityTmp = eventQuantityTmp.negate();
parameters = UtilMisc.toMap("mrpId", mrpId, "productId", productId, "eventDate", customTimePeriod.getDate("fromDate"), "mrpEventTypeId", "SALES_FORECAST");
try {
InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, eventQuantityTmp, null, genericResult.getString("salesForecastDetailId"), false, delegator);
@@ -503,10 +503,10 @@
* @param product the product for which the Quantity Available is required
* @return the sum of all the totalAvailableToPromise of the inventoryItem related to the product, if the related facility is Mrp available (not yet implemented!!)
*/
- public static double findProductMrpQoh(String mrpId, GenericValue product, String facilityId, LocalDispatcher dispatcher, GenericDelegator delegator) {
+ public static BigDecimal findProductMrpQoh(String mrpId, GenericValue product, String facilityId, LocalDispatcher dispatcher, GenericDelegator delegator) {
return findProductMrpQoh(mrpId, product.getString("productId"), facilityId, dispatcher, delegator);
}
- public static double findProductMrpQoh(String mrpId, String productId, String facilityId, LocalDispatcher dispatcher, GenericDelegator delegator) {
+ public static BigDecimal findProductMrpQoh(String mrpId, String productId, String facilityId, LocalDispatcher dispatcher, GenericDelegator delegator) {
Map resultMap = null;
try{
if (facilityId == null) {
@@ -517,9 +517,9 @@
} catch (GenericServiceException e) {
Debug.logError(e, "Error calling getProductInventoryAvailableByFacility service", module);
logMrpError(mrpId, productId, "Unable to count inventory", delegator);
- return 0;
+ return BigDecimal.ZERO;
}
- return ((Double)resultMap.get("quantityOnHandTotal")).doubleValue();
+ return ((BigDecimal)resultMap.get("quantityOnHandTotal"));
}
public static void logMrpError(String mrpId, String productId, String errorMessage, GenericDelegator delegator) {
@@ -551,7 +551,7 @@
* @return None
*/
- public static void processBomComponent(String mrpId, GenericValue product, double eventQuantity, Timestamp startDate, Map routingTaskStartDate, List listComponent) {
+ public static void processBomComponent(String mrpId, GenericValue product, BigDecimal eventQuantity, Timestamp startDate, Map routingTaskStartDate, List listComponent) {
// TODO : change the return type to boolean to be able to test if all is ok or if it have had a exception
GenericDelegator delegator = product.getDelegator();
@@ -570,9 +570,9 @@
parameters.put("mrpId", mrpId);
parameters.put("eventDate", eventDate);
parameters.put("mrpEventTypeId", "MRP_REQUIREMENT");
- double componentEventQuantity = node.getQuantity();
+ BigDecimal componentEventQuantity = node.getQuantity();
try {
- InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, new Double(-1.0 * componentEventQuantity), null, product.get("productId") + ": " + eventDate, false, delegator);
+ InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, componentEventQuantity.negate(), null, product.get("productId") + ": " + eventDate, false, delegator);
} catch (GenericEntityException e) {
Debug.logError("Error : findByPrimaryKey(\"MrpEvent\", parameters) ="+parameters+"--"+e.getMessage(), module);
logMrpError(mrpId, node.getProduct().getString("productId"), "Unable to create event (processBomComponent)", delegator);
@@ -645,17 +645,17 @@
}
int bomLevelWithNoEvent = 0;
- double stockTmp = 0;
+ BigDecimal stockTmp = BigDecimal.ZERO;
String oldProductId = null;
String productId = null;
GenericValue product = null;
GenericValue productFacility = null;
- double eventQuantity = 0;
+ BigDecimal eventQuantity = BigDecimal.ZERO;
Timestamp eventDate = null;
boolean isNegative = false;
- double quantityNeeded = 0;
- double reorderQuantity = 0;
- double minimumStock = 0;
+ BigDecimal quantityNeeded = BigDecimal.ZERO;
+ BigDecimal reorderQuantity = BigDecimal.ZERO;
+ BigDecimal minimumStock = BigDecimal.ZERO;
int daysToShip = 0;
List components = null;
boolean isBuilt = false;
@@ -703,10 +703,10 @@
while (iteratorListInventoryEventForMRP.hasNext()) {
inventoryEventForMRP = (GenericValue) iteratorListInventoryEventForMRP.next();
productId = inventoryEventForMRP.getString("productId");
- eventQuantity = inventoryEventForMRP.getDouble("quantity").doubleValue();
+ eventQuantity = inventoryEventForMRP.getBigDecimal("quantity");
if (!productId.equals(oldProductId)) {
- double positiveEventQuantity = (eventQuantity > 0? eventQuantity: -1 * eventQuantity);
+ BigDecimal positiveEventQuantity = eventQuantity.compareTo(BigDecimal.ZERO) > 0 ? eventQuantity: eventQuantity.negate();
// It's a new product, so it's necessary to read the MrpQoh
try {
product = inventoryEventForMRP.getRelatedOneCache("Product");
@@ -717,7 +717,7 @@
stockTmp = findProductMrpQoh(mrpId, product, facilityId, dispatcher, delegator);
try {
InventoryEventPlannedServices.createOrUpdateMrpEvent(UtilMisc.toMap("mrpId", mrpId, "productId", product.getString("productId"), "mrpEventTypeId", "INITIAL_QOH", "eventDate", now),
- new Double(stockTmp), facilityId, null, false,
+ stockTmp, facilityId, null, false,
delegator);
} catch (GenericEntityException e) {
return ServiceUtil.returnError("Problem running createOrUpdateMrpEvent");
@@ -726,20 +726,20 @@
// as well and cause problems
daysToShip = 0;
if (productFacility != null) {
- reorderQuantity = (productFacility.getDouble("reorderQuantity") != null? productFacility.getDouble("reorderQuantity").doubleValue(): -1);
- minimumStock = (productFacility.getDouble("minimumStock") != null? productFacility.getDouble("minimumStock").doubleValue(): 0);
+ reorderQuantity = (productFacility.getBigDecimal("reorderQuantity") != null ? productFacility.getBigDecimal("reorderQuantity"): BigDecimal.ONE.negate());
+ minimumStock = (productFacility.getBigDecimal("minimumStock") != null ? productFacility.getBigDecimal("minimumStock"): BigDecimal.ZERO);
if ("SALES_ORDER_SHIP".equals(inventoryEventForMRP.getString("mrpEventTypeId"))) {
daysToShip = (productFacility.getLong("daysToShip") != null? productFacility.getLong("daysToShip").intValue(): 0);
}
} else {
- minimumStock = 0;
- reorderQuantity = -1;
+ minimumStock = BigDecimal.ZERO;
+ reorderQuantity = BigDecimal.ONE.negate();
}
// -----------------------------------------------------
// The components are also loaded thru the configurator
Map serviceResponse = null;
try {
- serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String, Object>toMap("productId", product.getString("productId"), "quantity", new Double(positiveEventQuantity), "excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
+ serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String, Object>toMap("productId", product.getString("productId"), "quantity", positiveEventQuantity, "excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
} catch (Exception e) {
return ServiceUtil.returnError("An error occurred exploding the product [" + product.getString("productId") + "]");
}
@@ -755,9 +755,9 @@
oldProductId = productId;
}
- stockTmp = stockTmp + eventQuantity;
- if(stockTmp < minimumStock){
- double qtyToStock = minimumStock - stockTmp;
+ stockTmp = stockTmp.add(eventQuantity);
+ if(stockTmp.compareTo(minimumStock) < 0){
+ BigDecimal qtyToStock = minimumStock.subtract(stockTmp);
//need to buy or build the product as we have not enough stock
eventDate = inventoryEventForMRP.getTimestamp("eventDate");
// to be just before the requirement
@@ -771,7 +771,7 @@
// The components are also loaded thru the configurator
Map serviceResponse = null;
try {
- serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String, Object>toMap("productId", product.getString("productId"), "quantity", new Double(proposedOrder.getQuantity()), "excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
+ serviceResponse = dispatcher.runSync("getManufacturingComponents", UtilMisc.<String, Object>toMap("productId", product.getString("productId"), "quantity", proposedOrder.getQuantity(), "excludeWIPs", Boolean.FALSE, "userLogin", userLogin));
} catch (Exception e) {
return ServiceUtil.returnError("An error occurred exploding the product [" + product.getString("productId") + "]");
}
@@ -817,12 +817,12 @@
"eventDate", eventDate,
"mrpEventTypeId", (isBuilt? "PROP_MANUF_O_RECP" : "PROP_PUR_O_RECP"));
try {
- InventoryEventPlannedServices.createOrUpdateMrpEvent(eventMap, new Double(proposedOrder.getQuantity()), null, eventName, (proposedOrder.getRequirementStartDate().compareTo(now) < 0), delegator);
+ InventoryEventPlannedServices.createOrUpdateMrpEvent(eventMap, proposedOrder.getQuantity(), null, eventName, (proposedOrder.getRequirementStartDate().compareTo(now) < 0), delegator);
} catch (GenericEntityException e) {
return ServiceUtil.returnError("Problem running createOrUpdateMrpEvent");
}
//
- stockTmp = stockTmp + proposedOrder.getQuantity();
+ stockTmp = stockTmp.add(proposedOrder.getQuantity());
}
}
} else {
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java Sun Jan 4 11:46:24 2009
@@ -19,6 +19,7 @@
package org.ofbiz.manufacturing.mrp;
+import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
@@ -58,10 +59,10 @@
protected String mrpName;
protected Timestamp requiredByDate;
protected Timestamp requirementStartDate;
- protected double quantity;
+ protected BigDecimal quantity;
- public ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, double quantity) {
+ public ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, BigDecimal quantity) {
this.product = product;
this.productId = product.getString("productId");
this.facilityId = facilityId;
@@ -75,7 +76,7 @@
* get the quantity property.
* @return the quantity property
**/
- public double getQuantity(){
+ public BigDecimal getQuantity(){
return quantity;
}
/**
@@ -202,10 +203,10 @@
* Read the first ProductFacility.reorderQuantity and calculate the quantity : if (quantity < reorderQuantity) quantity = reorderQuantity;
**/
// FIXME: facilityId
- public void calculateQuantityToSupply(double reorderQuantity, double minimumStock, ListIterator listIterIEP){
+ public void calculateQuantityToSupply(BigDecimal reorderQuantity, BigDecimal minimumStock, ListIterator listIterIEP){
// TODO : use a better algorithm using Order management cost et Product Stock cost to calculate the re-order quantity
// the variable listIterIEP will be used for that
- if (quantity < reorderQuantity) {
+ if (quantity.compareTo(reorderQuantity) < 0) {
quantity = reorderQuantity;
}
/*
@@ -243,7 +244,7 @@
parameters.put("facilityId", (isBuilt? manufacturingFacilityId: facilityId));
parameters.put("requiredByDate", requiredByDate);
parameters.put("requirementStartDate", requirementStartDate);
- parameters.put("quantity", new Double(quantity));
+ parameters.put("quantity", quantity);
parameters.put("requirementTypeId", (isBuilt? "INTERNAL_REQUIREMENT" : "PRODUCT_REQUIREMENT"));
if (mrpName != null) {
parameters.put("description", "MRP_" + mrpName);
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java Sun Jan 4 11:46:24 2009
@@ -18,6 +18,7 @@
*******************************************************************************/
package org.ofbiz.manufacturing.routing;
+import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@@ -53,13 +54,13 @@
// The mandatory IN parameters
String taskId = (String) context.get("taskId");
- Double quantity = (Double) context.get("quantity");
+ BigDecimal quantity = (BigDecimal) context.get("quantity");
// The optional IN parameters
String productId = (String) context.get("productId");
String routingId = (String) context.get("routingId");
if (quantity == null) {
- quantity = new Double(1);
+ quantity = BigDecimal.ONE;
}
GenericValue task = null;
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/BomSimulation.groovy Sun Jan 4 11:46:24 2009
@@ -34,12 +34,12 @@
context.tree = treeArray;
Iterator treeQtyIt = treeQty.values().iterator();
productsData = [];
- Double grandTotalCost = null;
+ grandTotalCost = null;
while (treeQtyIt) {
BOMNode node = (BOMNode)treeQtyIt.next();
- Double unitCost = null;
- Double totalCost = null;
- Double qoh = null;
+ unitCost = null;
+ totalCost = null;
+ qoh = null;
// The standard cost is retrieved
try {
outMap = [:];
@@ -48,7 +48,7 @@
currencyUomId : currencyUomId,
costComponentTypePrefix : "EST_STD",
userLogin : userLogin]);
- unitCost = (Double)outMap.productCost;
+ unitCost = outMap.productCost;
totalCost = unitCost * node.getQuantity();
grandTotalCost = grandTotalCost + totalCost ?: 0;
}
@@ -56,7 +56,7 @@
outMap = dispatcher.runSync("getInventoryAvailableByFacility", [productId : node.getProduct().productId,
facilityId : facilityId,
userLogin : userLogin]);
- qoh = (Double)outMap.quantityOnHandTotal;
+ qoh = outMap.quantityOnHandTotal;
}
} catch(Exception e) {}
productsData.add([node : node, unitCost : unitCost, totalCost : totalCost, qoh : qoh]);
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy Sun Jan 4 11:46:24 2009
@@ -52,7 +52,7 @@
context.dependentWorkEfforts = dependentWorkEfforts;
}
- Double quantityToProduce = productionRun.getGenericValue().getDouble("quantityToProduce") ?: new Double(0);
+ quantityToProduce = productionRun.getGenericValue().get("quantityToProduce") ?: 0.0;
// Find the inventory items produced
inventoryItems = delegator.findByAnd("WorkEffortInventoryProduced", [workEffortId : productionRunId]);
@@ -64,28 +64,28 @@
}
// Find if the production run can produce inventory.
- Double quantityProduced = productionRun.getGenericValue().getDouble("quantityProduced")?: new Double(0);
- Double quantityRejected = productionRun.getGenericValue().getDouble("quantityRejected")?: new Double(0);
+ quantityProduced = productionRun.getGenericValue().quantityProduced ?: 0.0;
+ quantityRejected = productionRun.getGenericValue().quantityRejected ?: 0.0;
lastTask = productionRun.getLastProductionRunRoutingTask();
- Double quantityDeclared = (lastTask ? (lastTask.getDouble("quantityProduced")?: new Double(0)): new Double(0));
+ quantityDeclared = (lastTask ? (lastTask.quantityProduced ?: 0.0) : 0.0 ;
if (lastTask && ("PRUN_RUNNING".equals(lastTask.currentStatusId) || "PRUN_COMPLETED".equals(lastTask.currentStatusId))) {
context.canDeclareAndProduce = "Y";
}
- double maxQuantity = quantityDeclared.doubleValue() - quantityProduced.doubleValue();
+ maxQuantity = quantityDeclared - quantityProduced;
productionRunData = [:];
productionRunData.workEffortId = productionRunId;
productionRunData.productId = productionRun.getProductProduced().productId;
if (maxQuantity > 0 && !"WIP".equals(productionRun.getProductProduced().productTypeId)) {
- productionRunData.quantity = new Double(maxQuantity);
+ productionRunData.quantity = maxQuantity;
context.canProduce = "Y";
}
productionRunData.quantityToProduce = quantityToProduce;
productionRunData.quantityProduced = quantityProduced;
productionRunData.quantityRejected = quantityRejected;
- productionRunData.quantityRemaining = new Double(quantityToProduce.doubleValue() - quantityProduced.doubleValue());
+ productionRunData.quantityRemaining = quantityToProduce - quantityProduced;
productionRunData.estimatedCompletionDate = productionRun.getEstimatedCompletionDate();
productionRunData.productionRunName = productionRun.getProductionRunName();
productionRunData.description = productionRun.getDescription();
@@ -188,21 +188,21 @@
componentData.workEffortName = workEffortName;
componentData.facilityId = productionRunTask.facilityId;
issuances = delegator.findByAnd("WorkEffortAndInventoryAssign", [workEffortId : component.workEffortId, productId : product.productId]);
- double totalIssued = 0.0;
+ totalIssued = 0.0;
issuances.each { issuance ->
- Double issued = issuance.getDouble("quantity");
+ issued = issuance.quantity;
if (issued) {
- totalIssued += issued.doubleValue();
+ totalIssued += issued;
}
}
returns = delegator.findByAnd("WorkEffortAndInventoryProduced", [workEffortId : component.workEffortId , productId : product.productId]);
- double totalReturned = 0.0;
+ totalReturned = 0.0;
returns.each { returned ->
returnDetail = EntityUtil.getFirst(delegator.findByAnd("InventoryItemDetail", [inventoryItemId : returned.inventoryItemId], ["inventoryItemDetailSeqId"]));
if (returnDetail) {
- Double qtyReturned = returnDetail.getDouble("quantityOnHandDiff");
+ qtyReturned = returnDetail.quantityOnHandDiff;
if (qtyReturned) {
- totalReturned += qtyReturned.doubleValue();
+ totalReturned += qtyReturned;
}
}
}
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy Sun Jan 4 11:46:24 2009
@@ -43,10 +43,10 @@
// oneRow.putAll(shipmentPlan.getRelatedOne("OrderItemInventoryRes"));
orderItem = shipmentPlan.getRelatedOne("OrderItem");
oneRow.productId = orderItem.productId;
- orderedQuantity = orderItem.getDouble("quantity");
- canceledQuantity = orderItem.getDouble("cancelQuantity");
+ orderedQuantity = orderItem.quantity;
+ canceledQuantity = orderItem.cancelQuantity;
if (canceledQuantity) {
- orderedQuantity = Double.valueOf(orderedQuantity.doubleValue() - canceledQuantity.doubleValue());
+ orderedQuantity = orderedQuantity - canceledQuantity;
}
oneRow.totOrderedQuantity = orderedQuantity.intValue();
// Total quantity issued
@@ -55,18 +55,18 @@
issuances = orderItem.getRelated("ItemIssuance");
issuances.each { issuance ->
if (issuance.quantity) {
- issuedQuantity += issuance.getDouble("quantity");
+ issuedQuantity += issuance.quantity;
if (issuance.cancelQuantity) {
- issuedQuantity -= issuance.getDouble("cancelQuantity");
- }
+ issuedQuantity -= issuance.cancelQuantity;
+ }
if (qtyIssuedInShipment.containsKey(issuance.shipmentId)) {
- qtyInShipment = ((Double)qtyIssuedInShipment.get(issuance.shipmentId)).doubleValue();
- qtyInShipment += issuance.getDouble("quantity");
+ qtyInShipment = qtyIssuedInShipment[issuance.shipmentId];
+ qtyInShipment += issuance.quantity;
qtyIssuedInShipment.issuance.shipmentId = qtyInShipment;
} else {
- qtyInShipment = issuance.getDouble("quantity");
+ qtyInShipment = issuance.quantity;
if (issuance.cancelQuantity) {
- qtyInShipment -= issuance.getDouble("cancelQuantity");
+ qtyInShipment -= issuance.cancelQuantity;
}
qtyIssuedInShipment.issuance.shipmentId = qtyInShipment;
}
@@ -79,18 +79,18 @@
plans = delegator.findByAnd("OrderShipment", [orderId : orderItem.orderId ,orderItemSeqId : orderItem.orderItemSeqId]);
plans.each { plan ->
if (plan.quantity) {
- netPlanQty = plan.getDouble("quantity");
+ netPlanQty = plan.quantity;
if (qtyIssuedInShipment.containsKey(plan.shipmentId)) {
- qtyInShipment = ((Double)qtyIssuedInShipment.get(plan.shipmentId)).doubleValue();
+ qtyInShipment = qtyIssuedInShipment[plan.shipmentId];
if (netPlanQty > qtyInShipment) {
netPlanQty -= qtyInShipment;
} else {
- netPlanQty = 0;
+ netPlanQty = 0.0;
}
}
plannedQuantity += netPlanQty;
if (qtyPlannedInShipment.containsKey(plan.shipmentId)) {
- qtyInShipment = ((Double)qtyPlannedInShipment.get(plan.shipmentId)).doubleValue();
+ qtyInShipment = qtyPlannedInShipment[plan.shipmentId];
qtyInShipment += netPlanQty;
qtyPlannedInShipment.plan.shipmentId = qtyInShipment;
} else {
@@ -110,10 +110,10 @@
reservations = orderItem.getRelated("OrderItemShipGrpInvRes");
reservations.each { reservation ->
if (reservation.quantity) {
- reservedQuantity += reservation.getDouble("quantity");
+ reservedQuantity += reservation.quantity;
}
if (reservation.quantityNotAvailable) {
- reservedNotAvailable += reservation.getDouble("quantityNotAvailable");
+ reservedNotAvailable += reservation.quantityNotAvailable;
}
}
oneRow.notAvailableQuantity = reservedNotAvailable;
@@ -121,11 +121,11 @@
product = orderItem.getRelatedOne("Product");
weight = 0.0;
quantity = 0.0;
- if (shipmentPlan.getDouble("quantity")) {
- quantity = shipmentPlan.getDouble("quantity");
+ if (shipmentPlan.quantity) {
+ quantity = shipmentPlan.quantity;
}
- if (product.getDouble("weight")) {
- weight = product.getDouble("weight") * quantity;
+ if (product.weight) {
+ weight = product.weight * quantity;
}
oneRow.weight = weight;
if (product.weightUomId) {
@@ -133,19 +133,19 @@
oneRow.weightUom = weightUom.abbreviation;
}
volume = 0.0;
- if (product.getDouble("productHeight") &&
- product.getDouble("productWidth") &&
- product.getDouble("productDepth")) {
+ if (product.productHeight &&
+ product.productWidth &&
+ product.productDepth) {
// TODO: check if uom conversion is needed
- volume = product.getDouble("productHeight") *
- product.getDouble("productWidth") *
- product.getDouble("productDepth") *
+ volume = product.productHeight *
+ product.productWidth *
+ product.productDepth *
quantity;
}
oneRow.volume = volume;
- if (product.get("heightUomId") &&
- product.get("widthUomId") &&
- product.get("depthUomId")) {
+ if (product.heightUomId &&
+ product.widthUomId &&
+ product.depthUomId) {
heightUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.heightUomId]);
widthUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.widthUomId]);
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy Sun Jan 4 11:46:24 2009
@@ -91,9 +91,9 @@
products.put(productionRunComponent.productId, [product : productionRunProduct, quantity : new Double(0), location : location]);
}
Map productMap = (Map)products.get(productionRunComponent.productId);
- Double productMapQty = (Double)productMap.quantity;
- Double currentProductQty = productionRunComponent.getDouble("estimatedQuantity");
- productMap.quantity = new Double(productMapQty.doubleValue() + currentProductQty.doubleValue());
+ productMapQty = productMap.quantity;
+ currentProductQty = productionRunComponent.estimatedQuantity;
+ productMap.quantity = productMapQty + currentProductQty;
}
}
// now create lists of products for each feature group
@@ -105,14 +105,14 @@
while (productsMapIt.hasNext()) {
productMap = productsMapIt.next();
if (productMap.product.productWidth && productMap.product.productHeight) {
- Double productMapQty = (Double)productMap.get("quantity");
- Double productHeight = (Double)productMap.get("product").get("productHeight");
- Double productWidth = (Double)productMap.get("product").get("productWidth");
- double productArea = (productHeight.doubleValue() * productWidth.doubleValue()) / (1000 * 1000);
- double panelQty = 0.0;
+ productMapQty = productMap.quantity;
+ productHeight = productMap.product.productHeight;
+ productWidth = productMap.product.productWidth;
+ productArea = (productHeight * productWidth) / (1000 * 1000);
+ panelQty = 0.0;
int panelQtyInt = 0;
- if (productArea > 0) panelQty = productMapQty.doubleValue() / productArea;
- panelQtyInt = (int)panelQty;
+ if (productArea > 0) panelQty = productMapQty / productArea;
+ panelQtyInt = panelQty;
if (panelQtyInt < panelQty) panelQtyInt++;
productMap.panelQuantity = new Integer(panelQtyInt);
}
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy Sun Jan 4 11:46:24 2009
@@ -63,7 +63,7 @@
// Stack information
stackInfos = [];
- productionRunQty = productionRun.getDouble("quantityToProduce");
+ productionRunQty = productionRun.quantityToProduce;
//numOfStacks = (int)productionRunQty / stackQty; // number of stacks
numOfStacks = productionRunQty / stackQty; // number of stacks
numOfStacks = numOfStacks.intValue();
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy Sun Jan 4 11:46:24 2009
@@ -46,10 +46,10 @@
record = [:];
if (shipmentPackageComponent.subProductId) {
record.productId = shipmentPackageComponent.subProductId;
- record.quantity = shipmentPackageComponent.getDouble("subQuantity");
+ record.quantity = shipmentPackageComponent.subQuantity;
} else {
record.productId = shipmentItem.productId;
- record.quantity = shipmentPackageComponent.getDouble("quantity");
+ record.quantity = shipmentPackageComponent.quantity;
}
record.shipmentPackageSeqId = shipmentPackageComponent.shipmentPackageSeqId;
record.orderId = orderId;
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy Sun Jan 4 11:46:24 2009
@@ -39,12 +39,12 @@
recordGroup.SHIPMENT_ITEM_SEQ_ID = shipmentPlan.shipmentItemSeqId;
recordGroup.PRODUCT_ID = orderLine.productId;
- recordGroup.QUANTITY = shipmentPlan.getDouble("quantity");
+ recordGroup.QUANTITY = shipmentPlan.quantity;
product = delegator.findByPrimaryKey("Product", [productId : orderLine.productId]);
recordGroup.PRODUCT_NAME = product.internalName;
inputPar = [productId : orderLine.productId,
- quantity : shipmentPlan.getDouble("quantity"),
+ quantity : shipmentPlan.quantity,
fromDate : "" + new Date(),
userLogin: userLogin];
@@ -65,14 +65,14 @@
if (!inventoryStock.containsKey(oneComponent.getProduct().productId)) {
serviceInput = [productId : oneComponent.getProduct().productId , facilityId : facilityId];
serviceOutput = dispatcher.runSync("getInventoryAvailableByFacility",serviceInput);
- qha = serviceOutput.quantityOnHandTotal ?: new Double(0);
+ qha = serviceOutput.quantityOnHandTotal ?: 0.0;
inventoryStock.oneComponent.getProduct().productId = qha;
}
- qty = ((Double)inventoryStock.get(oneComponent.getProduct().productId)).floatValue();
- qty = (float)(qty - oneComponent.getQuantity());
- inventoryStock.oneComponent.getProduct().productId = new Double(qty);
+ qty = inventoryStock[oneComponent.getProduct().productId];
+ qty = qty - oneComponent.getQuantity();
+ inventoryStock.oneComponent.getProduct().productId = qty;
}
- record.componentOnHand = new Float(qty);
+ record.componentOnHand = qty;
// Now we get the products qty already reserved by production runs
serviceInput = [productId : oneComponent.getProduct().productId,
userLogin : userLogin];
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml Sun Jan 4 11:46:24 2009
@@ -137,7 +137,7 @@
<form name="ViewListProductionRunRoutingTasks" type="list" title="" list-name="productionRunRoutingTasks"
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
<row-actions>
- <set field="estimatedTotalMilliSeconds" value="${bsh:estimatedMilliSeconds * quantity}" type="Double"/>
+ <set field="estimatedTotalMilliSeconds" value="${bsh:estimatedMilliSeconds * quantity.doubleValue()}" type="Double"/>
</row-actions>
<field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
<field name="workEffortId" title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]" /></field>
@@ -151,7 +151,7 @@
<form name="ListProductionRunRoutingTasks" type="list" target="ProductionRunTasks" title="" list-name="productionRunRoutingTasks"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
<row-actions>
- <set field="estimatedTotalMilliSeconds" value="${bsh:estimatedMilliSeconds * quantity}" type="Double"/>
+ <set field="estimatedTotalMilliSeconds" value="${bsh:estimatedMilliSeconds * quantity.doubleValue}" type="Double"/>
</row-actions>
<field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
<field name="workEffortId" title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]" /></field>
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl Sun Jan 4 11:46:24 2009
@@ -211,7 +211,7 @@
</tr>
</#list>
</#if>
- <#assign quantityAvailableAtDate = quantityAvailableAtDate?default(0) + inven.getDouble("quantity")>
+ <#assign quantityAvailableAtDate = quantityAvailableAtDate?default(0) + inven.getBigDecimal("quantity")>
<#assign productTmp = product>
<#assign MrpEventType = inven.getRelatedOne("MrpEventType")>
<tr class="${rowClass}">
Modified: ofbiz/branches/typecheckcleanup200810/applications/manufacturing/widget/manufacturing/CuttingListReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/manufacturing/widget/manufacturing/CuttingListReport.groovy?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/manufacturing/widget/manufacturing/CuttingListReport.groovy (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/manufacturing/widget/manufacturing/CuttingListReport.groovy Sun Jan 4 11:46:24 2009
@@ -72,26 +72,26 @@
productId = product.productId;
productIdToProduct.put(productId, product);
if (!productIdToQuantity.containsKey(productId)) {
- productIdToQuantity.put(productId, new Double(0));
+ productIdToQuantity.put(productId, 0.0);
}
- qty = (Double)productIdToQuantity.get(productId);
- productIdToQuantity.put(productId, new Double(oneProductionRun.getGenericValue().getDouble("quantityToProduce").doubleValue() + qty.doubleValue()));
+ qty = productIdToQuantity.get(productId);
+ productIdToQuantity.put(productId, oneProductionRun.getGenericValue().quantityToProduce + qty);
}
}
}
}
}
productIdToProduct.values().each { product ->
- heightD = product.getDouble("productHeight");
+ heightD = product.productHeight;
height = 0;
if (heightD) {
- height = (heightD.doubleValue() * 1000) as int;
+ height = (heightD * 1000) as int;
}
- widthD = product.getDouble("productWidth");
+ widthD = product.productWidth;
width = 0;
if (widthD) {
- width = (widthD.doubleValue() * 1000) as int;
+ width = (widthD * 1000) as int;
}
Dimension dim = new Dimension(width, height);
if (!dimensionToProducts.containsKey(dim)) {
@@ -101,10 +101,10 @@
prodList.add(product);
// tot qty per dimension
if (!dimensionToQuantity.containsKey(dim)) {
- dimensionToQuantity.put(dim, new Double(0));
+ dimensionToQuantity.put(dim, 0.0);
}
- Double qty = (Double)dimensionToQuantity.get(dim);
- dimensionToQuantity.put(dim, new Double(((Double)productIdToQuantity.get(product.productId)).doubleValue() + qty.doubleValue()));
+ qty = dimensionToQuantity[dim];
+ dimensionToQuantity.put(dim, productIdToQuantity[product.productId] + qty);
}
//
//
@@ -113,8 +113,8 @@
dimensionToProducts.keySet().each { dim ->
map1 = [:];
list1.add(map1);
- map1.width = (dim.getWidth() / 1000) as Double;
- map1.height = (dim.getHeight() / 1000) as Double;
+ map1.width = (dim.getWidth() / 1000);
+ map1.height = (dim.getHeight() / 1000);
map1.quantity = dimensionToQuantity.get(dim);
list2 = [] as ArrayList;
map1.products = list2;
Modified: ofbiz/branches/typecheckcleanup200810/applications/party/data/ScheduledJobs.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/party/data/ScheduledJobs.xml?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/party/data/ScheduledJobs.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/party/data/ScheduledJobs.xml Sun Jan 4 11:46:24 2009
@@ -22,5 +22,28 @@
<entity-engine-xml>
<!-- create recurring job to check email communication events with the status COM_IN_PROGRESS to send these emails.. -->
<TemporalExpression tempExprId="SENDEMAIL" tempExprTypeId="FREQUENCY" integer1="12" integer2="5"/>
- <JobSandbox jobId="SENDEMAIL" jobName="Send Email" runTime="2000-01-01 00:00:00.000" serviceName="sendEmailDated" poolId="pool" runAsUser="system" tempExprId="SENDEMAIL" maxRecurrenceCount="-1"/>
+ <RuntimeData runtimeDataId="TESTID">
+ <runtimeInfo><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<ofbiz-ser>
+ <map-HashMap>
+ <map-Entry>
+ <map-Key>
+ <std-String value="cookie"/>
+ </map-Key>
+ <map-Value>
+ <std-Integer value="1"/>
+ </map-Value>
+ </map-Entry>
+ <map-Entry>
+ <map-Key>
+ <std-String value="runtimeDataId"/>
+ </map-Key>
+ <map-Value>
+ <std-String value="TESTID"/>
+ </map-Value>
+ </map-Entry>
+ </map-HashMap>
+</ofbiz-ser>
+ ]]></runtimeInfo>
+ </RuntimeData> <JobSandbox jobId="SENDEMAIL" jobName="Send Email" runtimeDataId="TESTID" runTime="2000-01-01 00:00:00.000" serviceName="sendEmailDated" poolId="pool" runAsUser="system" tempExprId="SENDEMAIL" maxRecurrenceCount="-1"/>
</entity-engine-xml>
Modified: ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Sun Jan 4 11:46:24 2009
@@ -361,6 +361,23 @@
<set-service-fields service-name="sendCommEventAsEmail" map-name="communicationEvent" to-map-name="inMap"/>
<call-service service-name="sendCommEventAsEmail" in-map-name="inMap" require-new-transaction="true"/>
</iterate>
+ <set field="cookie" from-field="parameters.cookie" type="Integer"/>
+ <calculate field-name="cookie" type="Integer">
+ <calcop operator="add">
+ <number value="1"/>
+ <calcop operator="get" field-name="cookie"/>
+ </calcop>
+ </calculate>
+ <set field="pk.runtimeDataId" value="TESTID"/>
+ <find-by-primary-key map-name="pk" value-name="runtimeData" entity-name="RuntimeData"/>
+ <set field="newData.runtimeDataId" from-field="pk.runtimeDataId"/>
+ <set field="newData.cookie" from-field="cookie"/>
+ <call-class-method method-name="serialize" class-name="org.ofbiz.entity.serialize.XmlSerializer" ret-field-name="dummy">
+ <field field-name="newData" type="Object"/>
+ </call-class-method>
+ <log level="always" message="${dummy}"></log>
+ <set field="runtimeData.runtimeInfo" from-field="dummy"/>
+ <store-value value-name="runtimeData"/>
</simple-method>
<simple-method method-name="allocateMsgToParty" short-description="Allocate an emailaddress to an existing/new party, update the communication event accordingly">
Modified: ofbiz/branches/typecheckcleanup200810/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/party/servicedef/services.xml?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/applications/party/servicedef/services.xml (original)
+++ ofbiz/branches/typecheckcleanup200810/applications/party/servicedef/services.xml Sun Jan 4 11:46:24 2009
@@ -792,6 +792,8 @@
<service name="sendEmailDated" engine="simple" use-transaction="false"
location="org/ofbiz/party/communication/CommunicationEventServices.xml" invoke="sendEmailDated" auth="true">
<description>Checks for email communication events with the status COM_IN_PROGRESS and a startdate which is expired, then send the email</description>
+ <attribute name="cookie" mode="IN" type="Integer" optional="true"/>
+ <attribute name="runtimeDataId" mode="IN" type="String" optional="false"></attribute>
</service>
Modified: ofbiz/branches/typecheckcleanup200810/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java?rev=731346&r1=731345&r2=731346&view=diff
==============================================================================
--- ofbiz/branches/typecheckcleanup200810/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java (original)
+++ ofbiz/branches/typecheckcleanup200810/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java Sun Jan 4 11:46:24 2009
@@ -76,7 +76,7 @@
* @param maximumFractionDigits The maximum number of fraction digits used; if set to -1 than the default value for the locale is used
* @return A String with the formatted price
*/
- public static String formatCurrency(BigDecimal price, String isoCode, Locale locale, int maximumFractionDigits) {
+ public static String formatCurrency(double price, String isoCode, Locale locale, int maximumFractionDigits) {
//Debug.logInfo("formatting currency: " + price + ", isoCode: " + isoCode + ", locale: " + locale, module);
com.ibm.icu.text.NumberFormat nf = com.ibm.icu.text.NumberFormat.getCurrencyInstance(locale);
if (isoCode != null && isoCode.length() > 1) {
@@ -90,6 +90,17 @@
return nf.format(price);
}
+ /** Formats a BigDecimal into a properly formatted currency string based on isoCode and Locale
+ * @param price The price double to be formatted
+ * @param isoCode the currency ISO code
+ * @param locale The Locale used to format the number
+ * @param maximumFractionDigits The maximum number of fraction digits used; if set to -1 than the default value for the locale is used
+ * @return A String with the formatted price
+ */
+ public static String formatCurrency(BigDecimal price, String isoCode, Locale locale, int maximumFractionDigits) {
+ return formatCurrency(price.doubleValue(), isoCode, locale, maximumFractionDigits);
+ }
+
/** Formats a double into a properly formatted currency string based on isoCode and Locale
* @param price The price double to be formatted
* @param isoCode the currency ISO code
Re: svn commit: r731346 [3/3] - in /ofbiz/branches/typecheckcleanup200810: applications/accounting/widget/ applications/content/script/org/ofbiz/content/content/ applications/ecommerce/script/org/ofbiz/ecommerce/customer/ applications/ecommerce/webapp/ecom...
Posted by David E Jones <da...@hotwaxmedia.com>.
This looks like some sort of test code that was committed mistakenly.
Thanks for tracking that down Hans.
Scott, do you have any thoughts/comments on this?
-David
On Jan 11, 2009, at 9:09 PM, Hans Bakker wrote:
> The following code was added at jan 4 by Scott(lektran) as part of the
> double->bigdecimal conversion
>
> may i ask why this was added and what it does? This part of code gives
> an error when the old format of the database is used however using
> this
> new code....
>
> The error:
> 2009-01-12 12:04:55,946 (default-invoker-Thread-10) [
> ModelService.java:545:ERROR] [ModelService.validate] :
> {sendEmailDated} : (IN) Required test error:
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [IN] [sendEmailDated.runtimeDataId]
>
> I changed the data for this scheduled job to 'seed' data and reloaded
> its definition...
>
> The problem however did not go away....
>
> can you help me Scott?
>
> Regards,
> Hans
>
>
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=731346&r1=731345&r2=731346&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- ofbiz/branches/typecheckcleanup200810/applications/party/script/
>> org/ofbiz/party/communication/CommunicationEventServices.xml
>> (original)
>> +++ ofbiz/branches/typecheckcleanup200810/applications/party/script/
>> org/ofbiz/party/communication/CommunicationEventServices.xml Sun
>> Jan 4 11:46:24 2009
>> @@ -361,6 +361,23 @@
>> <set-service-fields service-name="sendCommEventAsEmail"
>> map-name="communicationEvent" to-map-name="inMap"/>
>> <call-service service-name="sendCommEventAsEmail" in-
>> map-name="inMap" require-new-transaction="true"/>
>> </iterate>
>> + <set field="cookie" from-field="parameters.cookie"
>> type="Integer"/>
>> + <calculate field-name="cookie" type="Integer">
>> + <calcop operator="add">
>> + <number value="1"/>
>> + <calcop operator="get" field-name="cookie"/>
>> + </calcop>
>> + </calculate>
>> + <set field="pk.runtimeDataId" value="TESTID"/>
>> + <find-by-primary-key map-name="pk" value-
>> name="runtimeData" entity-name="RuntimeData"/>
>> + <set field="newData.runtimeDataId" from-
>> field="pk.runtimeDataId"/>
>> + <set field="newData.cookie" from-field="cookie"/>
>> + <call-class-method method-name="serialize" class-
>> name="org.ofbiz.entity.serialize.XmlSerializer" ret-field-
>> name="dummy">
>> + <field field-name="newData" type="Object"/>
>> + </call-class-method>
>> + <log level="always" message="${dummy}"></log>
>> + <set field="runtimeData.runtimeInfo" from-field="dummy"/>
>> + <store-value value-name="runtimeData"/>
>> </simple-method>
>
>
Re: svn commit: r731346 [3/3] - in
/ofbiz/branches/typecheckcleanup200810: applications/accounting/widget/
applications/content/script/org/ofbiz/content/content/
applications/ecommerce/script/org/ofbiz/ecommerce/customer/
applications/ecommerce/webapp/ecom...
Posted by Hans Bakker <ma...@antwebsystems.com>.
The following code was added at jan 4 by Scott(lektran) as part of the
double->bigdecimal conversion
may i ask why this was added and what it does? This part of code gives
an error when the old format of the database is used however using this
new code....
The error:
2009-01-12 12:04:55,946 (default-invoker-Thread-10) [
ModelService.java:545:ERROR] [ModelService.validate] :
{sendEmailDated} : (IN) Required test error:
org.ofbiz.service.ServiceValidationException: The following required
parameter is missing: [IN] [sendEmailDated.runtimeDataId]
I changed the data for this scheduled job to 'seed' data and reloaded
its definition...
The problem however did not go away....
can you help me Scott?
Regards,
Hans
> URL:
> http://svn.apache.org/viewvc/ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=731346&r1=731345&r2=731346&view=diff
> ==============================================================================
> --- ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
> +++ ofbiz/branches/typecheckcleanup200810/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Sun Jan 4 11:46:24 2009
> @@ -361,6 +361,23 @@
> <set-service-fields service-name="sendCommEventAsEmail" map-name="communicationEvent" to-map-name="inMap"/>
> <call-service service-name="sendCommEventAsEmail" in-map-name="inMap" require-new-transaction="true"/>
> </iterate>
> + <set field="cookie" from-field="parameters.cookie" type="Integer"/>
> + <calculate field-name="cookie" type="Integer">
> + <calcop operator="add">
> + <number value="1"/>
> + <calcop operator="get" field-name="cookie"/>
> + </calcop>
> + </calculate>
> + <set field="pk.runtimeDataId" value="TESTID"/>
> + <find-by-primary-key map-name="pk" value-name="runtimeData" entity-name="RuntimeData"/>
> + <set field="newData.runtimeDataId" from-field="pk.runtimeDataId"/>
> + <set field="newData.cookie" from-field="cookie"/>
> + <call-class-method method-name="serialize" class-name="org.ofbiz.entity.serialize.XmlSerializer" ret-field-name="dummy">
> + <field field-name="newData" type="Object"/>
> + </call-class-method>
> + <log level="always" message="${dummy}"></log>
> + <set field="runtimeData.runtimeInfo" from-field="dummy"/>
> + <store-value value-name="runtimeData"/>
> </simple-method>