Author: ashish
Date: Sat Nov 15 13:35:45 2014 New Revision: 1639880 URL: http://svn.apache.org/r1639880 Log: Applied patch from jira issue - OFBIZ-5766 - Error when adding/modifying a task to a Production Run - field type error. Thanks Guillaume Sigoigne for reporting the issue, Thanks Divesh for providing the patch for this issue. Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1639880&r1=1639879&r2=1639880&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Sat Nov 15 13:35:45 2014 @@ -423,7 +423,7 @@ public class ProductionRun { Map<String, Object> serviceContext = UtilMisc.<String, Object>toMap("arguments", estimateCalcServiceMap); // serviceContext.put("userLogin", userLogin); Map<String, Object> resultService = dispatcher.runSync(serviceName, serviceContext); - totalTaskTime = ((Double)resultService.get("totalTime")).doubleValue(); + totalTaskTime = ((BigDecimal)resultService.get("totalTime")).doubleValue(); } } catch (Exception exc) { Debug.logError(exc, "Problem calling the customMethod service " + serviceName); Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1639880&r1=1639879&r2=1639880&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Sat Nov 15 13:35:45 2014 @@ -1229,8 +1229,8 @@ public class ProductionRunServices { if (priority.equals(routingTask.get("priority")) && ! routingTaskId.equals(routingTask.get("workEffortId"))) return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskSeqIdAlreadyExist", locale)); if (routingTaskId.equals(routingTask.get("workEffortId"))) { - routingTask.set("estimatedSetupMillis", context.get("estimatedSetupMillis")); - routingTask.set("estimatedMilliSeconds", context.get("estimatedMilliSeconds")); + routingTask.set("estimatedSetupMillis", ((BigDecimal) context.get("estimatedSetupMillis")).doubleValue()); + routingTask.set("estimatedMilliSeconds", ( (BigDecimal) context.get("estimatedMilliSeconds")).doubleValue()); if (first) { // for the first routingTask the estimatedStartDate update imply estimatedStartDate productonRun update if (! estimatedStartDate.equals(pRestimatedStartDate)) { productionRun.setEstimatedStartDate(estimatedStartDate); @@ -1426,8 +1426,14 @@ public class ProductionRunServices { String description = (String)context.get("description"); Timestamp estimatedStartDate = (Timestamp)context.get("estimatedStartDate"); Timestamp estimatedCompletionDate = (Timestamp)context.get("estimatedCompletionDate"); - Double estimatedSetupMillis = (Double)context.get("estimatedSetupMillis"); - Double estimatedMilliSeconds = (Double)context.get("estimatedMilliSeconds"); + + Double estimatedSetupMillis = null; + if (context.get("estimatedSetupMillis") != null) + estimatedSetupMillis = ((BigDecimal)context.get("estimatedSetupMillis")).doubleValue(); + + Double estimatedMilliSeconds = null; + if (context.get("estimatedMilliSeconds") != null) + estimatedMilliSeconds = ((BigDecimal)context.get("estimatedMilliSeconds")).doubleValue(); // The production run is loaded ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher); |
Free forum by Nabble | Edit this page |