svn commit: r520901 - in /ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing: jobshopmgt/ProductionRunServices.java mrp/MrpServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r520901 - in /ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing: jobshopmgt/ProductionRunServices.java mrp/MrpServices.java

jacopoc
Author: jacopoc
Date: Wed Mar 21 07:41:53 2007
New Revision: 520901

URL: http://svn.apache.org/viewvc?view=rev&rev=520901
Log:
Fix for an issue with the MRP, that was coonsidering the promised units from canceled production runs.

Modified:
    ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
    ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.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?view=diff&rev=520901&r1=520900&r2=520901
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Wed Mar 21 07:41:53 2007
@@ -113,6 +113,17 @@
                 serviceContext.put("userLogin", userLogin);
                 Map resultService = null;
                 resultService = dispatcher.runSync("updateWorkEffort", serviceContext);
+                // Cancel the product promised
+                List products = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", productionRunId, "workEffortGoodStdTypeId", "PRUN_PROD_DELIV", "statusId", "WEGS_CREATED"));
+                if (!UtilValidate.isEmpty(products)) {
+                    Iterator productsIt = products.iterator();
+                    while (productsIt.hasNext()) {
+                        GenericValue product = (GenericValue)productsIt.next();
+                        product.set("statusId", "WEGS_CANCELLED");
+                        product.store();
+                    }
+                }
+
                 // change the tasks status to PRUN_CANCELLED
                 List tasks = productionRun.getProductionRunRoutingTasks();
                 GenericValue oneTask = null;

Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?view=diff&rev=520901&r1=520900&r2=520901
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Wed Mar 21 07:41:53 2007
@@ -150,7 +150,7 @@
             return ServiceUtil.returnError("Problem, we can not find the order items, for more detail look at the log");
         }
         iteratorResult = resultList.iterator();
-        while(iteratorResult.hasNext()){
+        while (iteratorResult.hasNext()) {
             genericResult = (GenericValue) iteratorResult.next();
             String productId =  genericResult.getString("productId");
             Double eventQuantityTmp = new Double(-1.0 * genericResult.getDouble("quantity").doubleValue());