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/27 20:40:47 UTC

svn commit: r523027 - in /ofbiz/trunk/applications: manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ manufacturing/webapp/manufacturing/WEB-INF/ manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ manufacturing/webapp/manufacturing/j...

Author: jacopoc
Date: Tue Mar 27 11:40:46 2007
New Revision: 523027

URL: http://svn.apache.org/viewvc?view=rev&rev=523027
Log:
Added new status (and status transition) to production runs to mark them as scheduled.
Started refactorting of the production runs screens to support the new status and to be more modern and robust.

Modified:
    ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
    ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.bsh
    ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml
    ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml

Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml Tue Mar 27 11:40:46 2007
@@ -76,43 +76,6 @@
     <!-- ProductionRun edition, actions events -->
     <simple-method method-name="actionEditProductionRun" short-description="Run services, depending of action parameters ">
         <log level="info" message="debut parameters = ${parameters}"/>
-        <if-compare value="updateProductionRun" field-name="actionForm" map-name="parameters"  operator="equals">
-            <call-map-processor in-map-name="parameters" out-map-name="context">
-                <simple-map-processor name="prepareUpdatePRun">
-                    <process field="productionRunId">
-                        <copy/>
-                    </process>
-                    <process field="quantity">
-                        <copy/>
-                        <convert type="Double">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunQuantityNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="estimatedStartDate">
-                        <copy/>
-                        <not-empty>
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateMissing"/>
-                        </not-empty>
-                        <convert type="Timestamp">
-                            <fail-property resource="ManufacturingUiLabels" property="ManufacturingProductionRunStartDateNotCorrect"/>
-                        </convert>
-                    </process>
-                    <process field="workEffortName">
-                        <copy/>
-                    </process>
-                    <process field="description">
-                        <copy/>
-                    </process>
-                    <process field="facilityId">
-                        <copy/>
-                    </process>
-                </simple-map-processor>
-            </call-map-processor>
-            <check-errors/>
-            <call-service service-name="updateProductionRun" in-map-name="context">
-            </call-service>
-            <log level="info" message="parameters = ${parameters}"/>
-        </if-compare>
         <if-compare value="UpdateRoutingTask" field-name="actionForm" map-name="parameters"  operator="equals">
             <call-map-processor in-map-name="parameters" out-map-name="context">
                 <simple-map-processor name="prCheckUpdatePrunRoutingTask">
@@ -194,7 +157,7 @@
             </call-service>
             <log level="info" message="parameters = ${parameters}"/>
         </if-compare>
-        
+<!--        
         <if-compare value="addProductComponent" field-name="actionForm" map-name="parameters"  operator="equals">
             <call-map-processor in-map-name="parameters" out-map-name="context">
                 <simple-map-processor name="prepareAddProductComponent">
@@ -245,7 +208,7 @@
             </call-service>
             <log level="info" message="parameters = ${parameters}"/>
         </if-compare>
-        
+-->
         <if-compare value="addRoutingTask" field-name="actionForm" map-name="parameters"  operator="equals">
             <call-map-processor in-map-name="parameters" out-map-name="context">
                 <simple-map-processor name="prepareAddRoutingTask">
@@ -304,7 +267,7 @@
             </call-service>
             <log level="info" message="parameters = ${parameters}"/>
         </if-compare>
-        
+<!--
         <if-compare value="addFixedAsset" field-name="actionForm" map-name="parameters" operator="equals">
             <call-map-processor in-map-name="parameters" out-map-name="context">
                 <simple-map-processor name="prepareAddFixedAsset">
@@ -400,7 +363,7 @@
             <check-errors />
             <call-service service-name="updateWorkEffortFixedAssetAssign" in-map-name="context" />
         </if-compare>
-
+-->
     </simple-method>
     <!-- This method calls the removeWorkEffortFixedAssetAssign service and returns a response according to the 
         production run status, so that we can show the appropriate screen (EditProductionRun or 

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh Tue Mar 27 11:40:46 2007
@@ -31,8 +31,6 @@
 
 delegator = request.getAttribute("delegator");
 
-HashMap productionRunData= new HashMap();
-
 productionRunId = parameters.get("productionRunId");
 if (!UtilValidate.isEmpty(productionRunId)) {
     ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
@@ -40,6 +38,19 @@
         productionRunId = productionRun.getGenericValue().getString("workEffortId");
         context.put("productionRunId", productionRunId);
         context.put("productionRun", productionRun.getGenericValue());
+        // Prepare production run header data
+        HashMap productionRunData = new HashMap();
+        productionRunData.put("productionRunId", productionRunId);
+        productionRunData.put("productId", productionRun.getProductProduced().getString("productId"));
+        productionRunData.put("currentStatusId", productionRun.getGenericValue().getString("currentStatusId"));
+        productionRunData.put("facilityId", productionRun.getGenericValue().getString("facilityId"));
+        productionRunData.put("workEffortName", productionRun.getProductionRunName());
+        productionRunData.put("description", productionRun.getDescription());
+        productionRunData.put("quantity", productionRun.getQuantity());
+        productionRunData.put("estimatedStartDate",productionRun.getEstimatedStartDate());
+        productionRunData.put("estimatedCompletionDate",productionRun.getEstimatedCompletionDate());
+        context.put("productionRunData", productionRunData);
+
         // Find all the order items to which this production run is linked.
         List orderItems = delegator.findByAnd("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunId));
         if (orderItems.size() > 0) {
@@ -57,58 +68,30 @@
             context.put("dependentWorkEfforts", dependentWorkEfforts);
         }
 
-        // productionRun update sub-screen
-        HtmlFormWrapper updateProductionRunWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "UpdateProductionRun", request, response);
-        updateProductionRunWrapper.putInContext("productionRunData", productionRunData);
-        updateProductionRunWrapper.putInContext("actionForm", "updateProductionRun");
-        updateProductionRunWrapper.setUseRequestParameters(false);
-        context.put("updateProductionRunWrapper",updateProductionRunWrapper);
-
-        productionRunData.put("productionRunId",productionRunId);
-        productionRunData.put("productId",productionRun.getProductProduced().getString("productId"));
-        productionRunData.put("productName",productionRun.getProductProduced().getString("internalName"));
-        productionRunData.put("facilityId",productionRun.getGenericValue().getString("facilityId"));
+        //  RoutingTasks list
+        List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks();
+        context.put("productionRunRoutingTasks", productionRunRoutingTasks);
+
+        //  Product component/parts list
+        List productionRunComponentsData = productionRun.getProductionRunComponents();
+        context.put("productionRunComponents", productionRunComponentsData);
+
+        // Fixed assets list
+        List productionRunFixedAssetsData = new LinkedList();
+        for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) {
+            GenericValue prodRunTask = (GenericValue)tasksIt.next();
+            List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign");
+            productionRunFixedAssetsData.addAll(taskFixedAssets);
+        }
+        context.put("productionRunFixedAssetsData", productionRunFixedAssetsData);
+
+
+
         actionForm = request.getParameter("actionForm");
         if (UtilValidate.isEmpty(actionForm)) {
             actionForm = "beforeActionProductionRun";
         }
         context.put("actionForm",actionForm);
-        String quantity, estimatedStartDate, estimatedCompletionDate, workEffortName, description, facilityId;
-        if (actionForm.equals("updateProductionRun")){
-            quantity = request.getParameter("quantity");
-            estimatedStartDate = request.getParameter("estimatedStartDate");
-            workEffortName = request.getParameter("workEffortName");
-            description = request.getParameter("description");
-            facilityId = request.getParameter("facilityId");
-        }
-        if (facilityId != null) {
-            productionRunData.put("facilityId", facilityId);
-        }
-        if (quantity != null) {
-            productionRunData.put("quantity", quantity);
-        } else {
-            productionRunData.put("quantity", productionRun.getQuantity());
-        }
-
-        if (estimatedStartDate != null) {
-            productionRunData.put("estimatedStartDate",estimatedStartDate);
-        } else {
-            productionRunData.put("estimatedStartDate",productionRun.getEstimatedStartDate());
-        }
-        productionRunData.put("estimatedCompletionDate",productionRun.getEstimatedCompletionDate());
-
-        if (workEffortName != null) {
-            productionRunData.put("workEffortName", workEffortName);
-        } else {
-            productionRunData.put("workEffortName", productionRun.getProductionRunName());
-        }
-
-        if (description != null) {
-            productionRunData.put("description",description);
-        } else {
-            productionRunData.put("description",productionRun.getDescription());
-        }
-
         //---------------
         // Routing tasks
         //---------------
@@ -141,32 +124,5 @@
             context.put("editPrRoutingTaskWrapper",editPrRoutingTaskWrapper);
             context.put("routingTaskId",routingTaskId);
         }
-        //  RoutingTasks list
-        List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks();
-        context.put("productionRunRoutingTasks", productionRunRoutingTasks);
-
-        //  Product component/parts list
-        List productionRunComponentsData = productionRun.getProductionRunComponents();
-        context.put("productionRunComponents", productionRunComponentsData);
-
-        // Fixed assets list
-        List productionRunFixedAssetsData = new LinkedList();
-        for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) {
-            GenericValue prodRunTask = (GenericValue)tasksIt.next();
-            List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign");
-            productionRunFixedAssetsData.addAll(taskFixedAssets);
-        }
-        context.put("productionRunFixedAssetsData", productionRunFixedAssetsData);
     }
-}
-
-List msgResult = new LinkedList();
-msgResult = request.getParameter("msgResult");
-if (msgResult == null) msgResult = request.getAttribute("msgResult");
-context.put("msgResult", msgResult);
-
-tryEntity = true;
-errorMessage = request.getAttribute("_ERROR_MESSAGE_");
-if (errorMessage != null && errorMessage.length() > 0) {
-    tryEntity = false;    
 }

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?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- 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 Tue Mar 27 11:40:46 2007
@@ -32,7 +32,6 @@
 
 userLogin = request.getAttribute("userLogin");
 
-HashMap productionRunData= new HashMap();
 
 productionRunId = request.getParameter("productionRunId");
 if (UtilValidate.isEmpty(productionRunId)) {
@@ -44,6 +43,7 @@
         productionRunId = productionRun.getGenericValue().getString("workEffortId");
         context.put("productionRunId", productionRunId);
         context.put("productionRun", productionRun.getGenericValue());
+
         // Find all the order items to which this production run is linked.
         List orderItems = delegator.findByAnd("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunId));
         if (orderItems.size() > 0) {
@@ -87,26 +87,14 @@
         }
         double maxQuantity = quantityDeclared.doubleValue() - quantityProduced.doubleValue();
 
-        // productionRun update sub-screen
-        HtmlFormWrapper updateProductionRunWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "ShowProductionRun", request, response);
-        updateProductionRunWrapper.putInContext("productionRunData", productionRunData);
-        updateProductionRunWrapper.putInContext("actionForm", "updateProductionRun");
-        updateProductionRunWrapper.setUseRequestParameters(false);
-        context.put("updateProductionRunWrapper",updateProductionRunWrapper);
-        context.put("productionRunData", productionRunData);
 
+        HashMap productionRunData= new HashMap();
         productionRunData.put("workEffortId",productionRunId);
         productionRunData.put("productId", productionRun.getProductProduced().getString("productId"));
-        productionRunData.put("productName",productionRun.getProductProduced().getString("internalName"));
-
         if (maxQuantity > 0 && !"WIP".equals(productionRun.getProductProduced().getString("productTypeId"))) {
             productionRunData.put("quantity", new Double(maxQuantity));
-            updateProductionRunWrapper.putInContext("showQuantity", "Y");
-        } else {
-            productionRunData.put("quantity", "null");
-            updateProductionRunWrapper.putInContext("showQuantity", "null");
+            context.put("canProduce", "Y");
         }
-
         productionRunData.put("quantityToProduce", quantityToProduce);
         productionRunData.put("quantityProduced", quantityProduced);
         productionRunData.put("quantityRejected", quantityRejected);
@@ -118,6 +106,9 @@
         productionRunData.put("actualStartDate", productionRun.getGenericValue().getTimestamp("actualStartDate"));
         productionRunData.put("actualCompletionDate", productionRun.getGenericValue().getTimestamp("actualCompletionDate"));
         productionRunData.put("currentStatusId", productionRun.getGenericValue().getString("currentStatusId"));
+
+        context.put("productionRunData", productionRunData);
+
         actionForm = request.getParameter("actionForm");
         if (UtilValidate.isEmpty(actionForm)) {
             actionForm = "beforeActionProductionRun";
@@ -249,36 +240,6 @@
         context.put("ListProductionRunComponentsWrapper",ListProductionRunComponentsWrapper);
         context.put("productionRunComponentsData", productionRunComponentsData);
         
-        //------------------------
-        // Machines (fixed assets)
-        //------------------------
-        // Fixed asset add sub-screen
-        if (actionForm.equals("AddFixedAsset")) {
-            Map fixedAssetData = UtilMisc.toMap("productionRunId", productionRunId);
-            HtmlFormWrapper editProdRunFixedAssetWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunTaskFixedAsset", request, response);
-            editProdRunFixedAssetWrapper.putInContext("fixedAssetData", fixedAssetData);
-            editProdRunFixedAssetWrapper.putInContext("actionForm", "addFixedAsset");
-            editProdRunFixedAssetWrapper.putInContext("actionIsAdd", "Y");
-            editProdRunFixedAssetWrapper.putInContext("declarationScreen", "Y");
-            context.put("editProdRunFixedAssetWrapper", editProdRunFixedAssetWrapper);
-        }
-        // Fixed asset update sub-screen
-        workEffortId = request.getParameter("workEffortId");
-        fixedAssetId = request.getParameter("fixedAssetId");
-        fromDate = request.getParameter("fromDate");
-        if (workEffortId != null && fixedAssetId != null && fromDate!= null && actionForm.equals("UpdateFixedAsset")) {
-            GenericValue fixedAsset = delegator.findByPrimaryKey("WorkEffortFixedAssetAssign", 
-                                        UtilMisc.toMap("workEffortId", workEffortId, "fixedAssetId", fixedAssetId, "fromDate", fromDate));
-            Map fixedAssetData = fixedAsset.getAllFields();
-            fixedAssetData.put("productionRunId", productionRunId);
-            HtmlFormWrapper editProdRunFixedAssetWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunTaskFixedAsset", request, response);
-            editProdRunFixedAssetWrapper.putInContext("fixedAssetData", fixedAssetData);
-            editProdRunFixedAssetWrapper.putInContext("actionForm", "updateFixedAsset");
-            editProdRunFixedAssetWrapper.putInContext("actionIsAdd", "null");
-            editProdRunFixedAssetWrapper.putInContext("declarationScreen", "Y");
-            context.put("editProdRunFixedAssetWrapper", editProdRunFixedAssetWrapper);
-            context.put("fixedAssetId", fixedAssetId);
-        }
         // Fixed assets list
         List productionRunFixedAssetsData = new LinkedList();
         for (Iterator tasksIt = productionRunRoutingTasks.iterator(); tasksIt.hasNext();) {
@@ -292,15 +253,4 @@
         ListProductionRunFixedAssetsWrapper.putInContext("declarationScreen", "Y");
         context.put("ListProductionRunFixedAssetsWrapper", ListProductionRunFixedAssetsWrapper);
     }
-}
-
-List msgResult = new LinkedList();
-msgResult = request.getParameter("msgResult");
-if (msgResult == null) msgResult = request.getAttribute("msgResult");
-context.put("msgResult", msgResult);
-
-tryEntity = true;
-errorMessage = request.getAttribute("_ERROR_MESSAGE_");
-if (errorMessage != null && errorMessage.length() > 0) {
-    tryEntity = false;    
 }

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml Tue Mar 27 11:40:46 2007
@@ -503,6 +503,12 @@
         <event type="simple" path="org/ofbiz/manufacturing/jobshopmgt/ProductionRunSimpleEvents.xml" invoke="actionEditProductionRun"/>
         <response name="success" type="view" value="EditProductionRun"/>
     </request-map>
+    <request-map uri="updateProductionRun">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateProductionRun"/>
+        <response name="success" type="view" value="EditProductionRun"/>
+        <response name="error" type="view" value="EditProductionRun"/>
+    </request-map>
     <request-map uri="ProductionRunDeclaration">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="ProductionRunDeclaration"/>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl Tue Mar 27 11:40:46 2007
@@ -17,7 +17,6 @@
 under the License.
 -->
 
-<#if productionRunId?has_content>
 <#-- Mandatory work efforts -->
 <#if mandatoryWorkEfforts?has_content>
     <p>
@@ -58,51 +57,6 @@
 
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr valign="top">
-        <td>
-            <#-- ProductionRun Update sub-screen -->
-            <table border="0" width="100%" cellspacing="0" cellpadding="0" class="boxoutside">
-                <tr>
-                    <td>
-                        <div class="boxtop">
-                            <div class="boxhead-left">
-                                ${uiLabelMap.ManufacturingProductionRunId}: ${productionRunId}
-                            </div>
-                            <div class="boxhead-right" align="right">
-                                <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingConfirmProductionRun}</a>
-                                <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingQuickComplete}</a>
-                                <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingQuickClose}</a>
-                                <a href="<@o...@ofbizUrl>" class="submenutextright">${uiLabelMap.ManufacturingCancel}</a>
-                            </div>
-                            <div class="boxhead-fill">&nbsp;</div>
-                        </div>
-                        ${updateProductionRunWrapper.renderFormString(context)}
-                    </td>
-                </tr>
-                <#if orderItems?has_content>
-                <tr>
-                    <td align="left">
-                        <table border="0" cellpadding="2" cellspacing="0">
-                            <tr>
-                                <th width="20%" align="right">
-                                    ${uiLabelMap.ManufacturingOrderItems}
-                                </th>
-                                <td>&nbsp;</td>
-                                <td width="80%" align="left">
-                                    <span>
-                                        <#list orderItems as orderItem>
-                                            <a href="/ordermgr/control/orderview?orderId=${orderItem.getString("orderId")}" class="buttontext" target="_blank">
-                                                ${orderItem.getString("orderId")}/${orderItem.getString("orderItemSeqId")}
-                                            </a>&nbsp;
-                                        </#list>
-                                    </span>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-                </#if>
-            </table>
-        </td>
         <#-- RoutingTask sub-screen  Update or Add  -->
         <#if routingTaskId?has_content || actionForm=="AddRoutingTask">
             <td> &nbsp; </td>
@@ -126,7 +80,3 @@
         </tr>
     </table>
     <br/>
-    
-<#else>
-  <h1>${uiLabelMap.ManufacturingNoProductionRunSelected}</h1>
-</#if>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl Tue Mar 27 11:40:46 2007
@@ -17,8 +17,6 @@
 under the License.
 -->
 
-<#if productionRunId?has_content>
-
 <#-- Mandatory work efforts -->
 <#if mandatoryWorkEfforts?has_content>
     <p>
@@ -58,92 +56,6 @@
 
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr valign="top">
-        <td>
-            <#-- ProductionRun Update sub-screen -->
-            <table border="0" width="100%" cellspacing="0" cellpadding="0" class="boxoutside">
-                <tr>
-                    <td>
-                        <div class="boxtop">
-                            <div class="boxhead-left">
-                                ${uiLabelMap.ManufacturingProductionRunId}: ${productionRunId}
-                            </div>
-                            <div class="boxhead-right" align="right">
-                                <#assign currentStatus = productionRun.getString("currentStatusId")/>
-                                <span class="submenutextdisabled">${uiLabelMap.ManufacturingConfirmProductionRun}</span>
-                                <#if currentStatus == "PRUN_COMPLETED">
-                                    <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingProductionRunClose}</a>
-                                <#else>
-                                    <span class="submenutextdisabled">${uiLabelMap.ManufacturingProductionRunClose}</span>
-                                </#if>
-                                <#if currentStatus == "PRUN_CANCELLED" || currentStatus == "PRUN_COMPLETED" || currentStatus == "PRUN_CLOSED">
-                                    <span class="submenutextdisabled">${uiLabelMap.ManufacturingQuickComplete}</span>
-                                <#else>
-                                    <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingQuickComplete}</a>
-                                </#if>
-                                <#if currentStatus == "PRUN_CANCELLED" || currentStatus == "PRUN_CLOSED">
-                                    <span class="submenutextdisabled">${uiLabelMap.ManufacturingQuickClose}</span>
-                                <#else>
-                                    <a href="<@o...@ofbizUrl>" class="submenutext">${uiLabelMap.ManufacturingQuickClose}</a>
-                                </#if>
-                                <#if currentStatus == "PRUN_CANCELLED" || currentStatus == "PRUN_COMPLETED" || currentStatus == "PRUN_CLOSED">
-                                    <span class="submenutextdisabled">${uiLabelMap.ManufacturingCancel}</span>
-                                <#else>
-                                    <a href="<@o...@ofbizUrl>" class="submenutextright">${uiLabelMap.ManufacturingCancel}</a>
-                                </#if>
-                            </div>
-                            <div class="boxhead-fill">&nbsp;</div>
-                        </div>
-                        ${updateProductionRunWrapper.renderFormString(context)}
-                    </td>
-                </tr>
-                <#if inventoryItems?has_content>
-                <tr>
-                    <td align="left">
-                        <table border="0" cellpadding="2" cellspacing="0">
-                            <tr>
-                                <th width="20%" align="right">
-                                    ${uiLabelMap.ManufacturingInventoryItemsProduced}
-                                </th>
-                                <td>&nbsp;</td>
-                                <td width="80%" align="left">
-                                    <span>
-                                        <#list inventoryItems as inventoryItem>
-                                            <a href="/facility/control/EditInventoryItem?inventoryItemId=${inventoryItem.getString("inventoryItemId")}" class="buttontext" target="_blank">
-                                                ${inventoryItem.getString("inventoryItemId")}
-                                            </a>&nbsp;
-                                        </#list>
-                                    </span>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-                </#if>
-                <#if orderItems?has_content>
-                <tr>
-                    <td align="left">
-                        <table border="0" cellpadding="2" cellspacing="0">
-                            <tr>
-                                <th width="20%" align="right">
-                                    ${uiLabelMap.ManufacturingOrderItems}
-                                </th>
-                                <td>&nbsp;</td>
-                                <td width="80%" align="left">
-                                    <span>
-                                        <#list orderItems as orderItem>
-                                            <a href="/ordermgr/control/orderview?orderId=${orderItem.getString("orderId")}" class="buttontext" target="_blank">
-                                                ${orderItem.getString("orderId")}/${orderItem.getString("orderItemSeqId")}
-                                            </a>&nbsp;
-                                        </#list>
-                                    </span>
-                                </td>
-                            </tr>
-                        </table>
-                    </td>
-                </tr>
-                </#if>
-            </table>
-        </td>
         <#-- RoutingTask sub-screen  Update or Add  -->
         <#if routingTaskId?has_content || actionForm=="AddRoutingTask">
         <td> &nbsp; </td>
@@ -178,47 +90,6 @@
             </table>
             </td>
         </#if>
-                <#-- Product component sub-screen  Update or Add  -->
-                <#if productId?has_content || actionForm=="AddProductComponent">
-
-            <td> &nbsp; </td>
-            <td>
-                <table border="0" width="100%" cellspacing="0" cellpadding="0" class="boxoutside">
-                  <tr><td>
-                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="boxtop">
-                        <tr>
-                        <#if productId?has_content> <#-- Product component Update  -->
-                            <td><div class="boxhead">${uiLabelMap.CommonEdit}&nbsp;${uiLabelMap.ManufacturingProductionRunProductComponent} : ${productId}</div></td>
-                        <#else> <#-- Product component Add         -->
-                            <td><div class="boxhead">${uiLabelMap.ManufacturingAddProductionRunProductComponent}</div></td>
-                        </#if>
-                        </tr>
-                    </table>
-                    ${editPrProductComponentWrapper.renderFormString(context)}
-                  </td></tr>
-                </table>
-            </td>
-        </#if>
-        <#-- Fixed Asset assign sub-screen  Update or Add  -->
-        <#if fixedAssetId?has_content || actionForm=="AddFixedAsset">
-            <td> &nbsp; </td>
-            <td>
-                <table border="0" width="100%" cellspacing="0" cellpadding="0" class="boxoutside">
-                    <tr><td>
-                    	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="boxtop">
-                        	<tr>
-                        	<#if fixedAssetId?has_content> <#-- Fixed Asset Assign Update  -->
-                            	<td><div class="boxhead">${uiLabelMap.CommonEdit}&nbsp;${uiLabelMap.ManufacturingProductionRunFixedAssetAssign}</div></td>
-                        	<#else> <#-- Fixed Asset Assign Add -->
-                            	<td><div class="boxhead">${uiLabelMap.ManufacturingAddProductionRunFixedAssetAssign}</div></td>
-                        	</#if>
-                        	</tr>
-                    	</table>
-                    	${editProdRunFixedAssetWrapper.renderFormString(context)}
-                    </td></tr>
-                </table>
-            </td>
-        </#if>
         </tr>
     </table>
     <br/>
@@ -270,6 +141,3 @@
         ${ListProductionRunFixedAssetsWrapper.renderFormString(context)}
       </td></tr>
     </table>
-<#else>
-  <h1>${uiLabelMap.ManufacturingNoProductionRunSelected}</h1>
-</#if>

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml Tue Mar 27 11:40:46 2007
@@ -83,12 +83,14 @@
         <field name="facilityId" title="${uiLabelMap.ProductFacilityId}"><display/></field>
     </form>
 
-     <form name="UpdateProductionRun" type="single" target="EditProductionRun" title="" default-map-name="productionRunData">
-        <field name="actionForm"><hidden value="${actionForm}"/></field>
+     <form name="UpdateProductionRun" type="single" target="updateProductionRun" title="" default-map-name="productionRunData">
         <field name="productionRunId"><hidden/></field>
-        <field name="productId" title="${uiLabelMap.ProductProductId}">
-            <display description="[${productionRunData.productId}]/${productionRunData.productName}"/>
-        </field>
+        <field name="productId" title="${uiLabelMap.ProductProductName}">
+            <display-entity entity-name="Product" description="${internalName} [${productId}]"/>
+        </field> 
+        <field name="currentStatusId">
+            <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
+        </field> 
         <field name="facilityId" title="${uiLabelMap.ProductFacilityId}">
             <drop-down>
                 <entity-options entity-name="Facility" key-field-name="facilityId" description="${facilityName} [${facilityId}]">
@@ -103,6 +105,26 @@
         <field name="description"  title="${uiLabelMap.CommonDescription}"><text/></field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
     </form>
+    <form name="ListProductionRunOrderItems" type="list" target="EditProductionRun" title="" list-name="orderItems">
+        <field name="orderId" widget-style="buttontext">
+            <hyperlink target="/ordermgr/control/orderview?orderId=${orderId}" description="${orderId}/${orderItemSeqId}" also-hidden="false" target-type="inter-app"/>
+        </field>
+        <!--
+        <field name="orderItemSeqId"><display/></field>
+        <field name="orderItemGroupSeqId"><display/></field>
+        <field name="quantity"><display/></field>
+        <field name="cancelQuantity"><display/></field>
+        <field name="shipAfterDate"><display/></field>
+        <field name="shipBeforeDate"><display/></field>
+        <field name="estimatedShipDate"><display/></field>
+        <field name="estimatedDeliveryDate"><display/></field>
+        -->
+    </form>
+    <form name="ListProductionRunInventoryItems" type="list" title="" list-name="inventoryItems">
+        <field name="inventoryItemId" widget-style="buttontext">
+            <hyperlink target="/facility/control/EditInventoryItem?inventoryItemId=${inventoryItemId}" description="${inventoryItemId}" also-hidden="false" target-type="inter-app"/>
+        </field>
+    </form>
     
      <form name="ListProductionRunRoutingTasks" type="list" target="EditProductionRun" title="" list-name="productionRunRoutingTasks">
         <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
@@ -127,7 +149,7 @@
         </field>
         <field name="productId" title="${uiLabelMap.ProductProductName}">
             <display-entity entity-name="Product" description="${internalName} [${productId}]"/>
-        </field> 
+        </field>
         <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display/></field>
     </form>
 
@@ -173,12 +195,12 @@
     <!-- Production Run Declaration -->
     <form name="ShowProductionRun" type="single" target="productionRunProduce" title="" default-map-name="productionRunData">
         <field name="workEffortId"><hidden/></field>
-        <field name="productId" title="${uiLabelMap.ProductProductId}">
-            <display description="[${productionRunData.productId}]/${productionRunData.productName}"/>
-        </field>
-        <field name="currentStatusId" title="${uiLabelMap.CommonStatus}">
-            <display-entity entity-name="StatusItem" key-field-name="statusId"/>
-        </field>
+        <field name="productId" title="${uiLabelMap.ProductProductName}">
+            <display-entity entity-name="Product" description="${internalName} [${productId}]"/>
+        </field> 
+        <field name="currentStatusId">
+            <display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/>
+        </field> 
         <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}">
             <display/>
         </field>
@@ -188,17 +210,20 @@
         <field name="actualCompletionDate" title="${uiLabelMap.ManufacturingActualCompletionDate}"><display/></field>
         <field name="productionRunName"  title="${uiLabelMap.ManufacturingProductionRunName}"><display/></field>
         <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
-        <field name="quantity" title="${uiLabelMap.ManufacturingProduceQuantity}" use-when="${showQuantity}!=null"><text/></field>
-        <field name="inventoryItemTypeId" use-when="${showQuantity}!=null">
+        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}"><display/></field>
+        <field name="quantityRejected" title="${uiLabelMap.ManufacturingQuantityRejected}"><display/></field>
+    </form>
+    <form name="ProductionRunProduce" type="single" target="productionRunProduce" title="" default-map-name="productionRunData">
+        <field name="workEffortId"><hidden/></field>
+        <field name="quantity" title="${uiLabelMap.ManufacturingProduceQuantity}"><text/></field>
+        <field name="inventoryItemTypeId">
             <drop-down allow-empty="false" no-current-selected-key="NON_SERIAL_INV_ITEM">
                 <entity-options entity-name="InventoryItemType" description="${description}"/>
             </drop-down>
         </field>
-        <field name="submitButton" title="${uiLabelButton}" use-when="${showQuantity}!=null">
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}">
             <submit button-type="button"/>
         </field>
-        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}"><display/></field>
-        <field name="quantityRejected" title="${uiLabelMap.ManufacturingQuantityRejected}"><display/></field>
     </form>
    
     <form name="ListProductionRunDeclRoutingTasks" type="list" target="ProductionRunDeclaration" title="" list-name="productionRunRoutingTasks">

Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.bsh?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.bsh (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.bsh Tue Mar 27 11:40:46 2007
@@ -34,20 +34,22 @@
 if (UtilValidate.isEmpty(productionRunId)) {
     productionRunId = request.getParameter("workEffortId");
 }
-if (!UtilValidate.isEmpty(productionRunId)) {
+if (UtilValidate.isNotEmpty(productionRunId)) {
     
     GenericValue productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId));
-    if (productionRun != null) {
+    if (UtilValidate.isNotEmpty(productionRun)) {
         // If this is a task, get the parent production run
         if (productionRun.getString("workEffortTypeId") != null && "PROD_ORDER_TASK".equals(productionRun.getString("workEffortTypeId"))) {
             productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRun.getString("workEffortParentId")));
         }
     }
 
-    if (productionRun == null) {
+    if (UtilValidate.isEmpty(productionRun)) {
         return "error";
     }
-    if ("PRUN_CREATED".equals(productionRun.getString("currentStatusId"))) {
+    if ("PRUN_CREATED".equals(productionRun.getString("currentStatusId")) ||
+            "PRUN_SCHEDULED".equals(productionRun.getString("currentStatusId")) ||
+            "PRUN_CANCELLED".equals(productionRun.getString("currentStatusId"))) {
         return "docs_not_printed";
     } else {
         return "docs_printed";

Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original)
+++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Tue Mar 27 11:40:46 2007
@@ -88,10 +88,25 @@
             <widgets>
                 <decorator-screen name="CommonJobshopDecorator">
                     <decorator-section name="body">
+                        <container>
+                            <link target="quickChangeProductionRunStatus?productionRunId=${productionRunId}&amp;statusId=PRUN_SCHEDULED" text="${uiLabelMap.ManufacturingSchedule}" style="buttontext"/>
+                            <link target="changeProductionRunStatusToPrinted?productionRunId=${productionRunId}" text="${uiLabelMap.ManufacturingConfirmProductionRun}" style="buttontext"/>
+                            <link target="quickChangeProductionRunStatus?productionRunId=${productionRunId}&amp;statusId=PRUN_COMPLETED" text="${uiLabelMap.ManufacturingQuickComplete}" style="buttontext"/>
+                            <link target="quickChangeProductionRunStatus?productionRunId=${productionRunId}&amp;statusId=PRUN_CLOSED" text="${uiLabelMap.ManufacturingQuickClose}" style="buttontext"/>
+                            <link target="cancelProductionRun?productionRunId=${productionRunId}" text="${uiLabelMap.ManufacturingCancel}" style="buttontext"/>
+                        </container>
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingProductionRunId}: ${productionRunId}</label>
+                        </container>
+                        <include-form name="UpdateProductionRun" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
                         <platform-specific>
                             <html><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl"/></html>
                         </platform-specific>
                         <container>
+                            <label style="head2">${uiLabelMap.ManufacturingOrderItems}</label>
+                        </container>
+                        <include-form name="ListProductionRunOrderItems" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                        <container>
                             <label style="head2">${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}</label>
                         </container>
                         <container>
@@ -129,7 +144,49 @@
                     <decorator-section name="body">
                         <container>
                             <link target="PrintProductionRun?productionRunId=${productionRunId}" text="${uiLabelMap.ManufacturingPrintProductionRun}" style="buttontext"/>
+                            <section>
+                                <condition>
+                                    <if-compare field-name="productionRun.currentStatusId" operator="equals" value="PRUN_COMPLETED"/>
+                                </condition>
+                                <widgets>
+                                    <link target="changeProductionRunStatusToClosed?productionRunId=${productionRunId}" text="${uiLabelMap.ManufacturingProductionRunClose}" style="buttontext"/>
+                                </widgets>
+                            </section>
+                            <section>
+                                <condition>
+                                    <and>
+                                        <if-compare field-name="productionRun.currentStatusId" operator="not-equals" value="PRUN_CANCELLED"/>
+                                        <if-compare field-name="productionRun.currentStatusId" operator="not-equals" value="PRUN_COMPLETED"/>
+                                        <if-compare field-name="productionRun.currentStatusId" operator="not-equals" value="PRUN_CLOSED"/>
+                                    </and>
+                                </condition>
+                                <widgets>
+                                    <link target="quickChangeProductionRunStatus?productionRunId=${productionRunId}&amp;statusId=PRUN_COMPLETED" text="${uiLabelMap.ManufacturingQuickComplete}" style="buttontext"/>
+                                    <link target="quickChangeProductionRunStatus?productionRunId=${productionRunId}&amp;statusId=PRUN_CLOSED" text="${uiLabelMap.ManufacturingQuickClose}" style="buttontext"/>
+                                    <link target="cancelProductionRun?productionRunId=${productionRunId}" text="${uiLabelMap.ManufacturingCancel}" style="buttontext"/>
+                                </widgets>
+                            </section>
+                        </container>
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingProductionRunId}: ${productionRunId}</label>
+                        </container>
+                        <include-form name="ShowProductionRun" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                        <section>
+                            <condition>
+                                <if-compare field-name="canProduce" operator="equals" value="Y"/>
+                            </condition>
+                            <widgets>
+                                <include-form name="ProductionRunProduce" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                            </widgets>
+                        </section>
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingInventoryItemsProduced}</label>
+                        </container>
+                        <include-form name="ListProductionRunInventoryItems" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingOrderItems}</label>
                         </container>
+                        <include-form name="ListProductionRunOrderItems" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/>
                         <platform-specific>
                             <html><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunDeclaration.ftl"/></html>
                         </platform-specific>

Modified: ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml?view=diff&rev=523027&r1=523026&r2=523027
==============================================================================
--- ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml (original)
+++ ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml Tue Mar 27 11:40:46 2007
@@ -238,14 +238,18 @@
     <StatusType description="Production Run Status" hasTable="N" parentTypeId="WORK_EFFORT_STATUS" statusTypeId="PRODUCTION_RUN"/>
     
     <StatusItem description="Created" sequenceId="01" statusCode="CREATED" statusId="PRUN_CREATED" statusTypeId="PRODUCTION_RUN"/>
-    <StatusItem description="Confirmed" sequenceId="02" statusCode="DOC_PRINTED" statusId="PRUN_DOC_PRINTED" statusTypeId="PRODUCTION_RUN"/>
-    <StatusItem description="Running" sequenceId="03" statusCode="RUNNING" statusId="PRUN_RUNNING" statusTypeId="PRODUCTION_RUN"/>
-    <StatusItem description="Completed" sequenceId="04" statusCode="COMPLETED" statusId="PRUN_COMPLETED" statusTypeId="PRODUCTION_RUN"/>
-    <StatusItem description="Closed" sequenceId="05" statusCode="CLOSED" statusId="PRUN_CLOSED" statusTypeId="PRODUCTION_RUN"/>
+    <StatusItem description="Scheduled" sequenceId="02" statusCode="SCHEDULED" statusId="PRUN_SCHEDULED" statusTypeId="PRODUCTION_RUN"/>
+    <StatusItem description="Confirmed" sequenceId="03" statusCode="DOC_PRINTED" statusId="PRUN_DOC_PRINTED" statusTypeId="PRODUCTION_RUN"/>
+    <StatusItem description="Running" sequenceId="04" statusCode="RUNNING" statusId="PRUN_RUNNING" statusTypeId="PRODUCTION_RUN"/>
+    <StatusItem description="Completed" sequenceId="05" statusCode="COMPLETED" statusId="PRUN_COMPLETED" statusTypeId="PRODUCTION_RUN"/>
+    <StatusItem description="Closed" sequenceId="06" statusCode="CLOSED" statusId="PRUN_CLOSED" statusTypeId="PRODUCTION_RUN"/>
     <StatusItem description="Cancelled" sequenceId="10" statusCode="CANCELLED" statusId="PRUN_CANCELLED" statusTypeId="PRODUCTION_RUN"/>
 
     <StatusValidChange statusId="PRUN_CREATED" statusIdTo="PRUN_DOC_PRINTED" transitionName="Confirm"/>
+    <StatusValidChange statusId="PRUN_CREATED" statusIdTo="PRUN_SCHEDULED" transitionName="Schedule"/>
     <StatusValidChange statusId="PRUN_CREATED" statusIdTo="PRUN_RUNNING" transitionName="Start"/>
+    <StatusValidChange statusId="PRUN_SCHEDULED" statusIdTo="PRUN_DOC_PRINTED" transitionName="Confirm"/>
+    <StatusValidChange statusId="PRUN_SCHEDULED" statusIdTo="PRUN_RUNNING" transitionName="Start"/>
     <StatusValidChange statusId="PRUN_DOC_PRINTED" statusIdTo="PRUN_RUNNING" transitionName="Start"/>
     <StatusValidChange statusId="PRUN_RUNNING" statusIdTo="PRUN_COMPLETED" transitionName="Complete"/>
     <StatusValidChange statusId="PRUN_COMPLETED" statusIdTo="PRUN_CLOSED" transitionName="Close"/>