svn commit: r570956 - /ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh

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

svn commit: r570956 - /ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh

sichen
Author: sichen
Date: Wed Aug 29 15:28:36 2007
New Revision: 570956

URL: http://svn.apache.org/viewvc?rev=570956&view=rev
Log:
Comments

Modified:
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh?rev=570956&r1=570955&r2=570956&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh Wed Aug 29 15:28:36 2007
@@ -156,12 +156,15 @@
         //  RoutingTasks list
         List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks();
         Iterator tasksIt = productionRunRoutingTasks.iterator();
-        String startTaskId = null;
-        String issueTaskId = null;
-        String completeTaskId = null;
+        String startTaskId = null;   // which production run task is ready to start and has the [Start] buton next to it
+        String issueTaskId = null;   // which production run task is ready to have products issued with [Issue Components] button
+        String completeTaskId = null;   // which task has the [Complete] button next to it
         while (tasksIt.hasNext()) {
             GenericValue task = (GenericValue)tasksIt.next();
+            // only PRUN_RUNNING tasks can have items issued or production run completed
             if (task.getString("currentStatusId").equals("PRUN_RUNNING")) {
+                // Use WorkEffortGoodStandard to figure out if there are products which are needed for this task (PRUNT_PRODNEEDED) and which have not been issued (ie, WEGS_CREATED).
+                // If so this task should have products issued
                 List components = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", task.getString("workEffortId"), "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED"));
                 List notIssued = EntityUtil.filterByAnd(components, UtilMisc.toMap("statusId", "WEGS_CREATED"));
                 if (components.size() > 0 && notIssued.size() > 0) {
@@ -172,6 +175,7 @@
                 }
             }
 
+            // the first CREATED and SCHEDULED task will be the startTaskId.  As the issue and complete tasks are filled out this condition will no longer be true
             if (startTaskId == null &&
                   issueTaskId == null &&
                   completeTaskId == null &&