You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/03/12 15:56:08 UTC

svn commit: r517235 - in /ofbiz/trunk/applications/manufacturing: script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java

Author: jacopoc
Date: Mon Mar 12 07:56:07 2007
New Revision: 517235

URL: http://svn.apache.org/viewvc?view=rev&rev=517235
Log:
Quick fix for a bug where the MRP was considering cancelled components in the simulation.

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

Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml?view=diff&rev=517235&r1=517234&r2=517235
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml Mon Mar 12 07:56:07 2007
@@ -41,6 +41,9 @@
                         <set from-field="component" field="callSvcMap.workEffortGoodStandard"/>
                         <set from-field="reserveOrderEnumId" field="callSvcMap.reserveOrderEnumId"/>
                         <call-service service-name="issueProductionRunTaskComponent" in-map-name="callSvcMap"/>
+
+                        <set value="WEGS_COMPLETED" field="component.statusId"/>
+                        <store-value value-name="component"/>
                     </if-not-empty>
                 </iterate>
                 <log level="info" message="Issued inventory for workEffortId ${workEffort.workEffortId}."/>

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?view=diff&rev=517235&r1=517234&r2=517235
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Mon Mar 12 07:56:07 2007
@@ -125,6 +125,16 @@
                     serviceContext.put("currentStatusId", "PRUN_CANCELLED");
                     serviceContext.put("userLogin", userLogin);
                     resultService = dispatcher.runSync("updateWorkEffort", serviceContext);
+                    // cancel all the components
+                    List components = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", taskId, "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED", "statusId", "WEGS_CREATED"));
+                    if (!UtilValidate.isEmpty(components)) {
+                        Iterator componentsIt = components.iterator();
+                        while (componentsIt.hasNext()) {
+                            GenericValue component = (GenericValue)componentsIt.next();
+                            component.set("statusId", "WEGS_CANCELLED");
+                            component.store();
+                        }
+                    }
                 }
             } catch (Exception e) {
                 Debug.logError(e, "Problem calling the updateWorkEffort service", module);