Author: ashish
Date: Sat Nov 15 13:48:24 2014
New Revision: 1639883

URL: http://svn.apache.org/r1639883
Log:
Applied bug fix from trunk r1639880.
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/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
    
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

Modified: 
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1639883&r1=1639882&r2=1639883&view=diff
==============================================================================
--- 
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
 (original)
+++ 
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
 Sat Nov 15 13:48:24 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/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1639883&r1=1639882&r2=1639883&view=diff
==============================================================================
--- 
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 (original)
+++ 
ofbiz/branches/release12.04/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 Sat Nov 15 13:48:24 2014
@@ -1216,8 +1216,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);
@@ -1413,8 +1413,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);


Reply via email to