You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2014/11/15 14:46:46 UTC
svn commit: r1639881 - in
/ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt:
ProductionRun.java ProductionRunServices.java
Author: ashish
Date: Sat Nov 15 13:46:45 2014
New Revision: 1639881
URL: http://svn.apache.org/r1639881
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/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Modified: ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1639881&r1=1639880&r2=1639881&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original)
+++ ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Sat Nov 15 13:46:45 2014
@@ -422,7 +422,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/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1639881&r1=1639880&r2=1639881&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/branches/release13.07/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Sat Nov 15 13:46:45 2014
@@ -1215,8 +1215,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);
@@ -1412,8 +1412,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);