Author: jacopoc
Date: Wed Feb  6 03:53:21 2008
New Revision: 618970

URL: http://svn.apache.org/viewvc?rev=618970&view=rev
Log:
Applied (slightly different) patch from Valentina Sirkova for bug reported in 
issue # OFBIZ-1211: "stocking in serialized inventory after production run 
still has wrong quantity to issue"

Modified:
    
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

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=618970&r1=618969&r2=618970&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
 Wed Feb  6 03:53:21 2008
@@ -1608,22 +1608,19 @@
             } catch(Exception exc) {
                 return ServiceUtil.returnError(exc.getMessage());
             }
-            // Now the production run's quantityProduced is updated
-            double totalQuantity = quantityProduced.doubleValue() + 
quantity.doubleValue();
-            Map serviceContext = new HashMap();
-            serviceContext.clear();
-            serviceContext.put("workEffortId", productionRunId);
-            serviceContext.put("quantityProduced", new Double(totalQuantity));
-            serviceContext.put("actualCompletionDate", 
UtilDateTime.nowTimestamp());
-            serviceContext.put("userLogin", userLogin);
-            Map resultService = null;
-            try {
-                resultService = dispatcher.runSync("updateWorkEffort", 
serviceContext);
-            } catch (GenericServiceException e) {
-                Debug.logError(e, "Problem calling the updateWorkEffort 
service", module);
-                return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusNotChanged", locale));
-            }
         }
+        // Now the production run's quantityProduced is updated
+        Map serviceContext = UtilMisc.toMap("workEffortId", productionRunId);
+        serviceContext.put("quantityProduced", new 
Double(quantityProduced.doubleValue() + quantity.doubleValue()));
+        serviceContext.put("actualCompletionDate", 
UtilDateTime.nowTimestamp());
+        serviceContext.put("userLogin", userLogin);
+        try {
+            Map resultService = dispatcher.runSync("updateWorkEffort", 
serviceContext);
+        } catch (GenericServiceException e) {
+            Debug.logError(e, "Problem calling the updateWorkEffort service", 
module);
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunStatusNotChanged", locale));
+        }
+
         result.put("quantity", quantity);
         return result;
     }


Reply via email to