<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://ofbiz.apache.org/Widget-Form" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
    
    <form name="AssocProductionRunParty" target="createProductionRunPartyAssign" type="single"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productionRunId"><hidden/></field>
        <field name="partyId" required-field="true"><lookup target-form-name="LookupPartyName"/></field>
        <field name="roleTypeId" required-field="true">
            <drop-down allow-empty="false">
                <entity-options entity-name="RoleType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="workEffortId">
            <drop-down allow-empty="true">
                <entity-options entity-name="WorkEffort" key-field-name="workEffortId">
                    <entity-constraint name="workEffortParentId" operator="equals" value="${productionRunId}"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><date-time/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><date-time/></field>
        <field name="submitButton" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>
    <form name="CreateProductionRun" target="createProductionRun" title="" type="single"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productId" title="${uiLabelMap.ProductProductId}" required-field="true"><lookup target-form-name="LookupProduct" size="16"/></field>
        <field name="quantity" title="${uiLabelMap.ManufacturingQuantity}" required-field="true"><text size="6"/></field>
        <field name="startDate" title="${uiLabelMap.ManufacturingStartDate}" required-field="true"><date-time default-value="${nowTimestamp}"/></field>
        <field name="facilityId">
            <drop-down allow-empty="false">
                <entity-options entity-name="Facility" description="${facilityName} [${facilityId}]">
                    <!--<entity-constraint name="facilityTypeId" value="WAREHOUSE"/>-->
                </entity-options>
            </drop-down>
        </field>
        <field name="routingId" title="${uiLabelMap.ManufacturingRoutingId}"><lookup target-form-name="LookupRouting" size="16"/></field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingProductionRunName}"><text size="30"/></field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><text size="50"/></field>
        <field name="createDependentProductionRuns" title="${uiLabelMap.ManufacturingCreateDependentProductionRuns}">
            <drop-down allow-empty="false">
                <option key="N" description="${uiLabelMap.CommonNo}"/>
                <option key="Y" description="${uiLabelMap.CommonYes}"/>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <form name="FindProductionRun" target="FindProductionRun" title="" type="single" default-map-name="parameters"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="workEffortTypeId"><hidden value="PROD_ORDER_HEADER"/></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingProductionRunId}"><text-find/></field>
        <field name="currentStatusId" title="${uiLabelMap.CommonStatus}">
            <drop-down allow-multiple="true">
                <entity-options entity-name="StatusItem" key-field-name="statusId">
                    <entity-constraint name="statusTypeId" value="PRODUCTION_RUN"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productId" title="${uiLabelMap.ProductProductId}"><lookup target-form-name="LookupProduct"/></field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingProductionRunName}"><text-find/></field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}"><date-find/></field>
        <field name="facilityId" title="${uiLabelMap.ProductFacilityId}">
            <drop-down allow-empty="true">
                <entity-options entity-name="Facility" key-field-name="facilityId" description="${facilityName} [${facilityId}]">
                    <!--<entity-constraint name="facilityTypeId" value="WAREHOUSE"/>-->
                </entity-options>
             </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit/></field>
    </form>

    <grid name="ListFindProductionRun" list-name="listIt" paginate-target="FindProductionRun"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <actions>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="requestParameters"/>
                <field-map field-name="entityName" value="WorkEffortAndGoods"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
                <field-map field-name="orderBy" value="estimatedStartDate"/>
            </service>
        </actions>
        <row-actions>
            <entity-one entity-name="Product" value-field="product"/>
            <entity-one entity-name="Uom" value-field="uom">
                <field-map field-name="uomId" from-field="product.quantityUomId"/>
            </entity-one>
        </row-actions>
        <field name="workEffortId" title=" " widget-style="buttontext">
            <hyperlink description="${workEffortId}" target="ShowProductionRun" also-hidden="false">
                <parameter param-name="productionRunId" from-field="workEffortId"/>
            </hyperlink>
        </field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingProductionRunName}"><display/></field>
        <field name="productId" title="${uiLabelMap.ProductProductId}"><display/></field>
        <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display/></field>
        <field name="QuantityUom" title="${uiLabelMap.ProductQuantityUom}"><display description="${uom.abbreviation}"></display></field>
        <field name="currentStatusId" title="${uiLabelMap.CommonStatus}">
            <display-entity entity-name="StatusItem" key-field-name="statusId"/>
        </field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}"><display/></field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
        <field name="facilityId" title="${uiLabelMap.ProductFacilityId}"><display/></field>
    </grid>
     <form name="UpdateProductionRun" type="single" target="updateProductionRun" title="" default-map-name="productionRunData"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productionRunId"><hidden/></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"/>
        </field>
        <field name="manufacturerId">
            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${firstName} ${lastName} [${partyId}]"/>
        </field>
        <field name="facilityId" title="${uiLabelMap.ProductFacilityId}">
            <drop-down>
                <entity-options entity-name="Facility" key-field-name="facilityId" description="${facilityName} [${facilityId}]">
                    <entity-constraint name="facilityTypeId" value="WAREHOUSE"/>
                </entity-options>
             </drop-down>
        </field>
        <field name="quantity"  title="${uiLabelMap.ManufacturingQuantity}"><text size="10"/></field>
        <field name="estimatedStartDate"  title="${uiLabelMap.ManufacturingStartDate}"><date-time default-value="${nowTimestamp}"/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="workEffortName"  title="${uiLabelMap.ManufacturingProductionRunName}"><text/></field>
        <field name="description"><text/></field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit/></field>
    </form>
    <grid name="ListProductionRunOrderItems"  list-name="orderItems" target="EditProductionRun" 
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="orderId" widget-style="buttontext">
            <hyperlink description="${orderId}/${orderItemSeqId}" target="/ordermgr/control/orderview" also-hidden="false" target-type="inter-app">
                <parameter param-name="orderId"/>
            </hyperlink>
        </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>
        -->
    </grid>
    <grid name="ListProductionRunInventoryItems" list-name="inventoryItems"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <row-actions>
            <entity-one entity-name="InventoryItem" value-field="inventoryItem"/>
            <entity-condition entity-name="InventoryItemDetail" list="inventoryItemDetails">
                <condition-expr field-name="inventoryItemId" operator="equals" from-field="inventoryItemId"/>
                <order-by field-name="inventoryItemDetailSeqId"/>
            </entity-condition>
            <set field="quantityOnHandDiff" from-field="inventoryItemDetails[0].quantityOnHandDiff"/>
        </row-actions>
        <field name="inventoryItemId" widget-style="buttontext">
            <hyperlink target="/facility/control/EditInventoryItem"  description="${inventoryItemId}" also-hidden="false" target-type="inter-app">
                <parameter param-name="inventoryItemId"/>
            </hyperlink>
        </field>
        <field name="lotId" map-name="inventoryItem"><display/></field>
        <field name="statusId" map-name="inventoryItem"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
        <field name="unitCost" map-name="inventoryItem"><display/></field>
        <field name="quantity" entry-name="quantityOnHandDiff"><display/></field>
        <field name="datetimeReceived" map-name="inventoryItem"><display/></field>
    </grid>
     <grid name="ViewListProductionRunRoutingTasks"  list-name="productionRunRoutingTasks"
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <row-actions>
             <set field="estimatedTotalMilliSeconds" value="${groovy:estimatedMilliSeconds * quantity}"  type="BigDecimal"/>
         </row-actions>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
        <field name="workEffortId"  title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]"/></field>
        <field name="fixedAssetId"  title="${uiLabelMap.ManufacturingMachine}"><display/></field>
        <field name="reservPersons"><display/></field>
        <field name="estimatedStartDate"  title="${uiLabelMap.ManufacturingStartDate}"><display/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}" ><display/></field>
        <!--<field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}" ><display/></field>-->
        <field name="estimatedTotalMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedTotalMilliSeconds}" ><display/></field>
    </grid>
    <grid name="ListProductionRunRoutingTasks" list-name="productionRunRoutingTasks" target="ProductionRunTasks"
        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
        <row-actions>
            <set field="estimatedTotalMilliSeconds" value="${groovy:estimatedMilliSeconds * quantity}" type="BigDecimal"/>
        </row-actions>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
        <field name="workEffortId"  title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]"/></field>
        <field name="fixedAssetId"  title="${uiLabelMap.ManufacturingMachine}"><display/></field>
        <field name="reservPersons"><display/></field>
        <field name="estimatedStartDate"  title="${uiLabelMap.ManufacturingStartDate}"><display/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}" ><display/></field>
        <!--<field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}" ><display/></field>-->
        <field name="estimatedTotalMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedTotalMilliSeconds}" ><display/></field>
        <field name="editLink" title=" " widget-style="smallSubmit">
            <hyperlink description="${uiLabelMap.CommonEdit}" target="ProductionRunTasks" also-hidden="false">
                <parameter param-name="routingTaskId" from-field="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
            </hyperlink>
        </field>
        <field name="deleteLink" title=" " widget-style="smallSubmit">
            <!--<hyperlink target="RemoveRoutingTaskAssoc"  description="[${uiLabelMap.CommonDelete}]" also-hidden="false">
                <parameter param-name="workEffortIdFrom"/>
                <parameter param-name="workEffortIdTo"/>
                <parameter param-name="fromDate"/>
                <parameter param-name="workEffortAssocTypeId" value="ROUTING_COMPONENT"/>
            </hyperlink>-->
            <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteProductionRunRoutingTask" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
            </hyperlink>
        </field>
    </grid>
    <grid name="ListProductionRunComponents" list-name="productionRunComponents" target="EditProductionRun"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <row-actions>
            <entity-one entity-name="Product" value-field="product" use-cache="true"/>
        </row-actions>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
            <display-entity entity-name="WorkEffort" description="${workEffortName} [${workEffortId}]"/>
        </field>
        <field name="productId" title="${uiLabelMap.ProductProductName}">
            <display description="${product.internalName} [${productId}]"/>
        </field>
        <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display/></field>
        <field name="quantityUomId" map-name="product" title="${uiLabelMap.CommonUom}"><display-entity entity-name="Uom" key-field-name="uomId" description="${abbreviation}"/></field>
    </grid>
    <form name="EditProductionRunRoutingTask" type="single" target="updateProductionRunRoutingTask" title="" default-map-name="productionRunTask"
        header-row-style="header-row" default-table-style="basic-table">
        <alt-target use-when="productionRunTask==null" target="addProductionRunRoutingTask"/>
        <field name="productionRunId"><hidden value="${productionRunId}"/></field>
        <field name="routingTaskId" title="${uiLabelMap.ManufacturingRoutingTaskId}" use-when="productionRunTask==null"><lookup target-form-name="LookupRoutingTask"/></field>
        <field name="routingTaskId" map-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}" use-when="productionRunTask!=null"><display/></field>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><text size="4"/></field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}"><text/></field>
        <field name="description"><text/></field>
        <field name="reservPersons"><text/></field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}"><date-time default-value="${nowTimestamp}"/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"><text/></field>
        <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}"><text/></field>
        <field name="submitButton" title="${uiLabelMap.CommonEdit}"><submit/></field>
    </form>

    <!-- Production Run Declaration -->
    <form name="ShowProductionRun" type="single" target="productionRunProduce" title="" default-map-name="productionRunData"
        header-row-style="header-row" default-table-style="basic-table">
        <actions>
            <set field="useRequestParameters" value="false" type="Boolean"/>
        </actions>
        <field name="workEffortId"><hidden/></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"/>
        </field>
        <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}">
            <display/>
        </field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingEstimatedStartDate}"><display/></field>
        <field name="actualStartDate" title="${uiLabelMap.CommonActualStartDate}"><display/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <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="manufacturerId">
            <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName} ${firstName} ${lastName} [${partyId}]"/>
        </field>
        <field name="facilityId" title="${uiLabelMap.FacilityFacility}">
            <display-entity entity-name="Facility" description="${facilityName} [${facilityId}]"/>
        </field>
        <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"
        header-row-style="header-row" default-table-style="basic-table">
        <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"/>
            </drop-down>
        </field>
        <field name="lotId"><text default-value="${lastLotId}"/></field>
        <field name="facilityId"><hidden/></field>
        <field name="locationSeqId"> <lookup target-form-name="LookupFacilityLocation" target-parameter="facilityId" ></lookup></field>
        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit/></field>
    </form>
    <form name="ProductionRunDeclareAndProduceTop" type="single" skip-end="true" target="productionRunDeclareAndProduce" title="" default-map-name="productionRunData"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="workEffortId"><hidden/></field>
        <field name="quantity" title="${uiLabelMap.ManufacturingProduceQuantity}" tooltip="${uiLabelMap.ManufacturingProduceQuantityMessage}"><text/></field>
        <field name="inventoryItemTypeId">
            <drop-down allow-empty="false" no-current-selected-key="NON_SERIAL_INV_ITEM">
                <entity-options entity-name="InventoryItemType"/>
            </drop-down>
        </field>
        <field name="lotId"><text default-value="${lastLotId}"/></field>
    </form>
    <form name="ProductionRunDeclareAndProduceBottom" skip-start="true" type="multi" title="" list-name="productionRunComponentsDataReadyForIssuance"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="productionRunTaskId" entry-name="workEffortId"><hidden/></field>
        <field name="productId"><hidden/></field>
        <field name="fromDate"><hidden/></field>
        <field name="task" entry-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
            <display description="${workEffortName} [${workEffortId}]" also-hidden="false"/>
        </field>
        <field name="internalName" title="${uiLabelMap.ProductProductName}">
            <display description="${internalName} [${productId}]" also-hidden="false"/>
        </field>
        <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display also-hidden="false"/></field>
        <field name="issuedQuantity" title="${uiLabelMap.ManufacturingIssuedQuantity}"><display also-hidden="false"/></field>
        <field name="locationSeqId" use-when="estimatedQuantity != issuedQuantity">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFacilityLocation" description="${locationSeqId}">
                    <entity-constraint name="productId" env-name="productId"/>
                    <entity-constraint name="facilityId" env-name="facilityId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="secondaryLocationSeqId" use-when="estimatedQuantity != issuedQuantity">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFacilityLocation" key-field-name="locationSeqId" description="${locationSeqId}">
                    <entity-constraint name="productId" env-name="productId"/>
                    <entity-constraint name="facilityId" env-name="facilityId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="failIfItemsAreNotAvailable" use-when="estimatedQuantity != issuedQuantity">
            <drop-down allow-empty="false">
                <option key="Y" description="${uiLabelMap.CommonYes}"/>
                <option key="N" description="${uiLabelMap.CommonNo}"/>
            </drop-down>
        </field>
        <field name="_rowSubmit"><hidden value="Y"/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <grid name="ListProductionRunDeclRoutingTasks" list-name="productionRunRoutingTasks" target="ProductionRunDeclaration"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="actionForm"><hidden value="EditRoutingTask"/></field>
        <field name="productionRunId"><hidden value="${workEffortParentId}"/></field>
        <field name="routingTaskId"><hidden value="${workEffortId}"/></field>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingTaskName}"><display description="${workEffortName} [${workEffortId}]"/></field>
        <field name="currentStatusId" title="${uiLabelMap.CommonStatus}">
            <display-entity entity-name="StatusItem" key-field-name="statusId"/>
        </field>
        <field name="fixedAssetId"  title="${uiLabelMap.ManufacturingMachine}"><display/></field>
        <field name="reservPersons"><display/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}" ><display/></field>
        <field name="actualMilliSeconds" title="${uiLabelMap.ManufacturingTaskActualMilliSeconds}" ><display/></field>
        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}" ><display/></field>
        <field name="startLink" title=" " widget-style="smallSubmit" use-when="&quot;${startTaskId}&quot;.equals(&quot;${workEffortId}&quot;)">
            <hyperlink description="${uiLabelMap.ManufacturingStartProductionRunTask}" target="changeProductionRunTaskStatus" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
            </hyperlink>
        </field>
        <field name="issueLinkAtp" title=" " widget-style="smallSubmit" use-when="&quot;${issueTaskId}&quot;.equals(&quot;${workEffortId}&quot;)">
            <hyperlink description="${uiLabelMap.ManufacturingIssueAvailableProductionRunTask}" target="issueProductionRunRoutingTask" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
                <parameter param-name="failIfItemsAreNotAvailable" value="Y"/>
            </hyperlink>
        </field>
        <field name="issueLinkQoh" title=" " widget-style="smallSubmit" use-when="&quot;${issueTaskId}&quot;.equals(&quot;${workEffortId}&quot;)">
            <hyperlink description="${uiLabelMap.ManufacturingIssueProductionRunTask}" target="issueProductionRunRoutingTask" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
                <parameter param-name="failIfItemsAreNotAvailable" value="N"/>
            </hyperlink>
        </field>
        <field name="declareLink" title=" " widget-style="smallSubmit" use-when="&quot;PRUN_RUNNING&quot;.equals(&quot;${currentStatusId}&quot;)">
            <hyperlink description="${uiLabelMap.ManufacturingDeclareProductionRunTask}" target="ProductionRunDeclaration" also-hidden="false">
                <parameter param-name="actionForm" value="EditRoutingTask"/>
                <parameter param-name="routingTaskId" from-field="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
            </hyperlink>
        </field>
        <field name="completeLink" title=" " widget-style="smallSubmit" use-when="&quot;${completeTaskId}&quot;.equals(&quot;${workEffortId}&quot;)">
            <hyperlink description="${uiLabelMap.ManufacturingCompleteProductionRunTask}" target="changeProductionRunTaskStatus" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="productionRunId" from-field="workEffortParentId"/>
            </hyperlink>
        </field>
    </grid>

    <form name="ListIssueProductionRunDeclComponents" type="multi" target="issueProductionRunTaskComponents?productionRunId=${productionRunId}" title="" list-name="productionRunComponentsDataReadyForIssuance"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="productId"><hidden/></field>
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId"><hidden/></field>
        <field name="fromDate"><hidden/></field>
        <field name="failIfItemsAreNotAvailable">
            <drop-down allow-empty="false">
                <option key="Y" description="${uiLabelMap.CommonYes}"/>
                <option key="N" description="${uiLabelMap.CommonNo}"/>
            </drop-down>
        </field>
        <field name="task" entry-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
            <display description="${workEffortName} [${workEffortId}]"/>
        </field>
        <field name="internalName" title="${uiLabelMap.ProductProductName}">
            <display description="${internalName} [${productId}]" also-hidden="false"/>
        </field>
        <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display also-hidden="false"/></field>
        <field name="issuedQuantity" title="${uiLabelMap.ManufacturingIssuedQuantity}"><display also-hidden="false"/></field>
        <field name="locationSeqId">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFacilityLocation" description="${locationSeqId}">
                    <entity-constraint name="productId" env-name="productId"/>
                    <entity-constraint name="facilityId" env-name="facilityId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="secondaryLocationSeqId">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFacilityLocation" key-field-name="locationSeqId" description="${locationSeqId}">
                    <entity-constraint name="productId" env-name="productId"/>
                    <entity-constraint name="facilityId" env-name="facilityId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="lotId">
            <text />
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>

    <form name="ListReturnProductionRunDeclComponents" type="multi" use-row-submit="true" target="productionRunTaskReturnMaterials?productionRunId=${productionRunId}" title="" list-name="productionRunComponentsAlreadyIssued"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="productId"><hidden/></field>
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId"><hidden/></field>
        <field name="fromDate"><hidden/></field>
        <field name="task" entry-name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
            <display description="${workEffortName} [${workEffortId}]"/>
        </field>
        <field name="internalName" title="${uiLabelMap.ProductProductName}">
            <display description="${internalName} [${productId}]" also-hidden="false"/>
        </field>
        <field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display also-hidden="false"/></field>
        <field name="issuedQuantity" title="${uiLabelMap.ManufacturingIssuedQuantity}"><display also-hidden="false"/></field>
        <field name="returnedQuantity" title="${uiLabelMap.ManufacturingReturnedQuantity}"><display also-hidden="false"/></field>
        <field name="lotId" title="${uiLabelMap.ProductLotId}"><text /></field>
        <field name="quantity" title="${uiLabelMap.CommonQuantity}"><text/></field>
        <field name="_rowSubmit" title="${uiLabelMap.CommonSelected}"><check/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>

     <form name="EditProductionRunDeclRoutingTask" type="single" target="updateProductionRunTask" title="" default-map-name="routingTaskData"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="actionForm"><hidden value="${actionForm}"/></field>
        <field name="productionRunId"><hidden value="${routingTaskData.workEffortParentId}"/></field>
        <field name="productionRunTaskId"><hidden value="${routingTaskData.workEffortId}"/></field>
        <field name="priority" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}"><display/></field>
        <field name="description"><display/></field>
        <field name="estimatedCompletionDate" title="${uiLabelMap.ManufacturingEstimatedCompletionDate}"><display/></field>
        <field name="fromDate" title="${uiLabelMap.ManufacturingFromDate}"><date-time default-value="${nowTimestamp}"/></field>
        <field name="toDate" title="${uiLabelMap.ManufacturingToDate}"><date-time/></field>
        <field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"><display/></field>
        <field name="actualSetupMillis" title="${uiLabelMap.ManufacturingTaskActualSetupMillis}"><display/></field>
        <field name="addSetupTime" title="${uiLabelMap.ManufacturingAddSetupTime}"><text/></field>
        <field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}"><display/></field>
        <field name="actualMilliSeconds" title="${uiLabelMap.ManufacturingTaskActualMilliSeconds}"><display/></field>
        <field name="addTaskTime" title="${uiLabelMap.ManufacturingAddTaskTime}"><text/></field>
        <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}"><display/></field>
        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}"><display/></field>
        <field name="addQuantityProduced" title="${uiLabelMap.ManufacturingAddQuantityProduced}"><text/></field>
        <field name="quantityRejected" title="${uiLabelMap.ManufacturingQuantityRejected}"><display/></field>
        <field name="addQuantityRejected" title="${uiLabelMap.ManufacturingAddQuantityRejected}"><text/></field>
        <field name="comments" title="${uiLabelMap.ManufacturingComments}"><text/></field>
        <field name="partyId" title="${uiLabelMap.ManufacturingWorker}"><text/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
    </form>
    <form name="CreateRoutingTaskDelivProduct" type="single" target="createProductionRunTaskProduct" title="" default-map-name="formData"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId"><hidden value="${routingTaskId}"/></field>
        <field name="productId" title="${uiLabelMap.ProductProductId}" use-when="${groovy:delivProducts.size()>0}">
            <drop-down allow-empty="false">
                <list-options list-name="delivProducts" key-name="productId" description="${productId}"/>
            </drop-down>
        </field>
        <field name="productId" title="${uiLabelMap.ProductProductId}" use-when="${groovy:delivProducts.size()==0}"><lookup target-form-name="LookupProduct"/></field>
        <field name="quantity" title="${uiLabelMap.ManufacturingAddQuantityProduced}"><text/></field>
        <field name="lotId" title="${uiLabelMap.ProductLotId}"><text /></field>
        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
    </form>
    <grid name="ProductionRunTaskInventoryProducedList" list-name="prunInventoryProduced"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="inventoryItemId" title="${uiLabelMap.ProductInventoryItem}" widget-style="buttontext">
            <hyperlink target="/facility/control/EditInventoryItem"  description="${inventoryItemId}" also-hidden="false" target-type="inter-app">
                <parameter param-name="inventoryItemId"/>
            </hyperlink>
        </field>
    </grid>
    <form name="FindDelivProductContent" type="single" target="ProductionRunContent">
        <field name="productionRunId"><hidden/></field>
        <field name="productId" entry-name="delivProductId"><hidden/></field>
        <field name="contentLocale"><text default-value="${locale}"/></field>
        <field name="partyId"><lookup target-form-name="LookupCustomerName"/></field>
        <field name="roleTypeId"><hidden value="CONTENT_USER"/></field>
        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
    </form>
    <grid name="ListProductionRunContent" list-name="productionRunContents">
        <actions>
            <entity-and entity-name="WorkEffortContentAndInfo" list="productionRunContents">
                <field-map field-name="workEffortId" from-field="productionRunId"/>
            </entity-and>
        </actions>
        <field name="workEffortId"><hidden/></field>
        <field name="contentId"><display/></field>
        <field name="drDataResourceId"><display/></field>
        <field name="workEffortContentTypeId"><display-entity entity-name="WorkEffortContentType"/></field>
        <field name="contentTypeId"><display-entity entity-name="ContentType"/></field>
        <field name="contentName"><display/></field>
        <field name="description"><display/></field>
        <field name="localeString"><display/></field>
        <field name="description"><display/></field>
        <field name="drMimeTypeId"><display/></field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}">
            <display description="default ${drObjectInfo}"/>
        </field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" use-when="${drDataResourceTypeId?.contains('FILE') || drDataResourceTypeId == 'IMAGE_OBJECT'}">
            <hyperlink description="${drObjectInfo}" target="/content/control/ViewBinaryDataResource" target-type="content" target-window="productionRunContentWindow">
                <parameter param-name="dataResourceId" from-field="drDataResourceId"/>
            </hyperlink>
        </field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" entry-name="drDataResourceId" encode-output="true" use-when="${drDataResourceTypeId == 'ELECTRONIC_TEXT'}">
            <display-entity entity-name="ElectronicText" key-field-name="dataResourceId" description="${textData}"/>
        </field>
        <field name="deleteLink" title=" " widget-style="smallSubmit">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteProductionRunContent" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="workEffortContentTypeId"/>
                <parameter param-name="contentId"/>
                <parameter param-name="fromDate"/>
                <parameter param-name="productionRunId" from-field="productionRunId"/>
            </hyperlink>
        </field>
    </grid>
    <form name="ListDelivProductContent" type="multi" use-row-submit="true" target="createProductionRunContents?productionRunId=${productionRunId}" title="" list-name="delivProductContentsForLocaleAndUser">
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId" entry-name="productionRunId"><hidden/></field>
        <field name="contentId"><display/></field>
        <field name="drDataResourceId"><display/></field>
        <field name="contentTypeId"><display-entity entity-name="ContentType"/></field>
        <field name="contentName"><display/></field>
        <field name="description"><display/></field>
        <field name="localeString"><display/></field>
        <field name="description"><display/></field>
        <field name="drMimeTypeId"><display/></field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}">
            <display description="default ${drObjectInfo}"/>
        </field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" use-when="${groovy: drDataResourceTypeId != null &amp;&amp; (drDataResourceTypeId.contains(&quot;FILE&quot;) || drDataResourceTypeId.equals(&quot;IMAGE_OBJECT&quot;))}">
            <hyperlink description="${drObjectInfo}" target="/content/control/ViewBinaryDataResource" target-type="content" target-window="productionRunContentWindow">
                <parameter param-name="dataResourceId" from-field="drDataResourceId"/>
            </hyperlink>
        </field>
        <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" entry-name="drDataResourceId" encode-output="true" use-when="${groovy: drDataResourceTypeId != null &amp;&amp; drDataResourceTypeId.equals(&quot;ELECTRONIC_TEXT&quot;)}">
            <display-entity entity-name="ElectronicText" key-field-name="dataResourceId" description="${textData}"></display-entity>
        </field>
        <field name="workEffortContentTypeId"><drop-down><entity-options entity-name="WorkEffortContentType"></entity-options></drop-down></field>
        <field name="_rowSubmit" title="${uiLabelMap.CommonSelected}"><check/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <form name="ProductionRunTaskFixedAssets" type="list" target="updateWorkEffortFixedAssetAssign" paginate-target="" title="" list-name="records"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar" separate-columns="true">
        <auto-fields-entity entity-name="WorkEffortFixedAssetAssign" default-field-type="edit"/>
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId"><hidden/></field>
        <field name="statusId"><hidden/></field>
        <field name="fromDate"><display/></field>
        <field name="fixedAssetId">
            <display-entity entity-name="FixedAsset" description="${fixedAssetName} [${fixedAssetId}]"/>
        </field>
        <field name="availabilityStatusId" title="">
            <drop-down allow-empty="true">
                <entity-options entity-name="StatusItem" key-field-name="statusId">
                    <entity-constraint name="statusTypeId" operator="equals" value="WEFA_AVAILABILITY"/>
                    <entity-order-by field-name="sequenceId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
        <field name="deleteLink" title=" " widget-style="smallSubmit"
                    use-when="!&quot;${declarationScreen}&quot;.equals(&quot;Y&quot;)">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="removeWorkEffortFixedAssetAssign" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="fixedAssetId"/>
                <parameter param-name="fromDate"/>
                <parameter param-name="productionRunId" from-field="productionRunId"/>
            </hyperlink>
        </field>
    </form>
    <grid name="ListProductionRunTaskFixedAssets" list-name="productionRunFixedAssetsData"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <auto-fields-entity entity-name="WorkEffortFixedAssetAssign" default-field-type="display"/>
        <field name="workEffortId">
            <display-entity entity-name="WorkEffort" description="${workEffortName} [${workEffortId}]"/>
        </field>
        <field name="fixedAssetId">
            <display-entity entity-name="FixedAsset" description="${fixedAssetName}"/>
        </field>
        <field name="statusId">
            <display-entity entity-name="StatusItem"/>
        </field>
    </grid>
    <grid name="ListProductionRunNotes" list-name="productionRunNoteData"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <auto-fields-entity entity-name="WorkEffortNoteAndData" default-field-type="display"/>
        <field name="workEffortId"><hidden/></field>
        <field name="internalNote"><hidden/></field>
        <field name="noteId"><hidden/></field>
        <field name="noteParty"><hidden/></field>
        <field name="noteDateTime"><hidden/></field>
    </grid>
    <form name="EditProductionRunTaskFixedAsset" type="single" target="EditProductionRun" title="" default-map-name="fixedAssetData"
        header-row-style="header-row" default-table-style="basic-table">
        <alt-target use-when="declarationScreen.equals(&quot;Y&quot;)" target="ProductionRunDeclaration"/>
        <auto-fields-entity entity-name="WorkEffortFixedAssetAssign"/>
        <field name="actionForm"><hidden value="${actionForm}"/></field>
        <field name="productionRunId"><hidden /></field>
        <field name="workEffortId" use-when="${actionIsAdd}!=null">
            <drop-down allow-empty="false">
                <entity-options entity-name="WorkEffort" description="[${workEffortId}] ${workEffortName}">
                    <entity-constraint name="workEffortParentId" value="${productionRunId}"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="workEffortId" use-when="${actionIsAdd}==null">
            <display-entity entity-name="WorkEffort" description="[${workEffortId}] ${workEffortName}"/>
        </field>
        <field name="fixedAssetId" use-when="${actionIsAdd}!=null">
            <drop-down allow-empty="false">
                <entity-options entity-name="FixedAsset" description="${fixedAssetName}"/>
            </drop-down>
        </field>
        <field name="fixedAssetId" use-when="${actionIsAdd}==null">
            <display-entity entity-name="FixedAsset" description="${fixedAssetName}"/>
        </field>
        <field name="fromDate" use-when="${actionIsAdd}==null"><display /></field>
        <field name="statusId">
            <!-- Statuses are not yet defined for the WorkEffortFixedAssetAssign entity
                so this field will be hidden meanwhile
            <drop-down>
                <entity-options entity-name="StatusItem">
                    <entity-constraint name="statusTypeId" value="WORK_EFF_ASSET_STTS"/>
                </entity-options>
            </drop-down> -->
            <hidden />
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <form name="AddProductionRunTaskFixedAsset" type="single" target="createWorkEffortFixedAssetAssign" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <auto-fields-service service-name="createWorkEffortFixedAssetAssign"/>
        <field name="productionRunId"><hidden /></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTask}">
            <drop-down allow-empty="false">
                <entity-options entity-name="WorkEffort" description="${workEffortName} [${workEffortId}]">
                    <entity-constraint name="workEffortParentId" value="${productionRunId}"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="fixedAssetId" title="${uiLabelMap.ManufacturingMachine}">
            <drop-down allow-empty="false">
                <entity-options entity-name="FixedAsset" description="${fixedAssetName} [${fixedAssetId}]"/>
            </drop-down>
        </field>
        <field name="availabilityStatusId">
            <drop-down allow-empty="true">
                <entity-options entity-name="StatusItem" key-field-name="statusId">
                    <entity-constraint name="statusTypeId" operator="equals" value="WEFA_AVAILABILITY"/>
                    <entity-order-by field-name="sequenceId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="statusId">
            <!-- Statuses are not yet defined for the WorkEffortFixedAssetAssign entity
                so this field will be hidden meanwhile
            <drop-down>
                <entity-options entity-name="StatusItem">
                    <entity-constraint name="statusTypeId" value="WORK_EFF_ASSET_STTS"/>
                </entity-options>
            </drop-down> -->
            <hidden />
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit/></field>
    </form>
    <grid name="ListShipmentPlan" list-name="shipmentPlan"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="orderId" widget-style="buttontext">
            <hyperlink description="${orderId}" target="/ordermgr/control/orderview" target-type="inter-app">
                <parameter param-name="orderId" from-field="orderId"/>
            </hyperlink>
        </field>
        <field name="orderItemSeqId" title="${uiLabelMap.ProductOrderItem}"><display/></field>
        <field name="productId" title="${uiLabelMap.ProductProductId}"><display/></field>
        <field name="quantity" title="${uiLabelMap.ProductQuantity}"><display/></field>
        <field name="issuedQuantity"><display/></field>
        <field name="totOrderedQuantity"><display/></field>
        <field name="notAvailableQuantity" title="${uiLabelMap.ProductNotAvailable}"><display/></field>
        <field name="totPlannedQuantity"><display/></field>
        <field name="totIssuedQuantity"><display/></field>
        <field name="productionRunId" widget-style="buttontext">
            <hyperlink description="${productionRunId}" target="ShowProductionRun" also-hidden="false">
                <parameter param-name="productionRunId" from-field="productionRunId"/>
            </hyperlink>
        </field>
        <field name="productionRunStatusId"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
        <field name="productionRunEstimatedCompletionDate"><display/></field>
        <field name="productionRunQuantityProduced"><display/></field>
    </grid>
    <grid name="ListShipmentPlans" list-name="shipmentPlans"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar" header-row-style="header-row-2">
        <field name="shipmentId" widget-style="buttontext" sort-field="true">
            <hyperlink description="${shipmentId}" target="/facility/control/ViewShipment" target-type="inter-app">
                <parameter param-name="shipmentId" from-field="shipmentId"/>
            </hyperlink>
        </field>
        <field name="statusId">
            <display-entity entity-name="StatusItem" key-field-name="statusId"/>
        </field>
        <field name="estimatedShipDate" sort-field="true"><display/></field>
        <field name="viewShipmentPlanLink" title=" " widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonView}" target="WorkWithShipmentPlans" also-hidden="false">
                <parameter param-name="shipmentId"/>
            </hyperlink>
        </field>
    </grid>
    <form name="SelectMrpName" type="single" target="ManufacturingReports" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <field name="mrpName" title="${uiLabelMap.ManufacturingMrpName}"><text size="20"/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <form name="LinkProductionRun" type="single" target="createProductionRunAssoc" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortAssocTypeId"><hidden value="WORK_EFF_PRECEDENCY"/></field>
        <field name="productionRunIdTo"  title="${uiLabelMap.ManufacturingProductionRunId}">
            <drop-down allow-empty="false">
                <entity-options entity-name="WorkEffort" key-field-name="workEffortId" description="[ID: ${workEffortId}] - ${workEffortName}">
                    <entity-constraint name="workEffortPurposeTypeId" value="WEPT_PRODUCTION_RUN"/>
                    <entity-order-by field-name="workEffortId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="workFlowSequenceTypeId"  title="${uiLabelMap.CommonType}">
            <drop-down allow-empty="false">
                <entity-options entity-name="Enumeration" key-field-name="enumId">
                    <entity-constraint name="enumTypeId" value="WORKFLOW"/>
                    <entity-order-by field-name="sequenceId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field>
    </form>
    <grid name="MandatoryWorkEfforts" list-name="mandatoryWorkEfforts"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="workEffortIdFrom" title=" " widget-style="buttontext">
            <hyperlink description="${workEffortIdFrom}" target="ShowProductionRun" also-hidden="false" link-type="anchor">
                <parameter param-name="productionRunId" from-field="workEffortIdFrom"/>
            </hyperlink>
        </field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${workEffortName} " cache="true"/>
        </field>
        <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${quantityToProduce} " cache="true"/>
        </field>
        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${quantityProduced} " cache="true"/>
        </field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${estimatedStartDate} " cache="true"/>
        </field>
        <field name="estimatedCompletionDate" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${estimatedCompletionDate} " cache="true"/>
        </field>
        <field name="actualStartDate" title="${uiLabelMap.CommonActualStartDate}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${actualStartDate} " cache="true"/>
        </field>
        <field name="actualCompletionDate" title="${uiLabelMap.ManufacturingActualCompletionDate}" entry-name="workEffortIdFrom">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${actualCompletionDate} " cache="true"/>
        </field>
        <field name="deleteLink" title=" " widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonRemove}" target="removeProductionRunAssoc" also-hidden="false">
                <parameter param-name="workEffortIdFrom"/>
                <parameter param-name="workEffortIdTo" from-field="productionRunId"/>
                <parameter param-name="fromDate" from-field="estimatedStartDate"/>
                <parameter param-name="workEffortAssocTypeId" value="WORK_EFF_PRECEDENCY"/>
                <parameter param-name="productionRunId"/>
            </hyperlink>
        </field>
    </grid>
    <grid name="DependentWorkEfforts"  list-name="dependentWorkEfforts"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="workEffortIdTo" title=" " widget-style="buttontext">
            <hyperlink description="${workEffortIdTo}" target="ShowProductionRun" also-hidden="false" link-type="anchor">
                <parameter param-name="productionRunId" from-field="workEffortIdTo"/>
            </hyperlink>
        </field>
        <field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${workEffortName} " cache="true"/>
        </field>
        <field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${quantityToProduce} " cache="true"/>
        </field>
        <field name="quantityProduced" title="${uiLabelMap.ManufacturingQuantityProduced}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${quantityProduced} " cache="true"/>
        </field>
        <field name="estimatedStartDate" title="${uiLabelMap.ManufacturingStartDate}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${estimatedStartDate} " cache="true"/>
        </field>
        <field name="estimatedCompletionDate" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${estimatedCompletionDate} " cache="true"/>
        </field>
        <field name="actualStartDate" title="${uiLabelMap.CommonActualStartDate}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${actualStartDate} " cache="true"/>
        </field>
        <field name="actualCompletionDate" title="${uiLabelMap.ManufacturingActualCompletionDate}" entry-name="workEffortIdTo">
            <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${actualCompletionDate} " cache="true"/>
        </field>
        <field name="deleteLink" title=" " widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonRemove}" target="removeProductionRunAssoc" also-hidden="false">
                <parameter param-name="workEffortIdFrom" from-field="productionRunId"/>
                <parameter param-name="workEffortIdTo"/>
                <parameter param-name="fromDate" from-field="estimatedStartDate"/>
                <parameter param-name="workEffortAssocTypeId" value="WORK_EFF_PRECEDENCY"/>
                <parameter param-name="productionRunId"/>
            </hyperlink>
        </field>
    </grid>
    <grid name="ProductionRunTaskCosts" list-name="taskCosts"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <auto-fields-entity entity-name="CostComponent" default-field-type="display"/>
        <field name="workEffortId"><hidden/></field>
        <field name="productId"><hidden/></field>
        <field name="partyId"><hidden/></field>
        <field name="geoId"><hidden/></field>
        <field name="productFeatureId"><hidden/></field>
        <field name="costComponentTypeId">
            <display-entity entity-name="CostComponentType"/>
        </field>
        <field name="costComponentCalcId">
            <display-entity entity-name="CostComponentCalc"/>
        </field>
    </grid>
    <form name="AddProductionRunComponent" type="single" target="addProductionRunComponent" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <auto-fields-service service-name="addProductionRunComponent"/>
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTask}">
            <drop-down allow-empty="false">
                <entity-options entity-name="WorkEffort" description="${workEffortName} [${workEffortId}]">
                    <entity-constraint name="workEffortParentId" env-name="productionRunId"/>
                    <entity-order-by field-name="workEffortId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productId">
            <lookup target-form-name="LookupProduct"/>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>
    <grid name="ProductionRunPartyAssocs" list-name="productionRunParties"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="workEffortId"><hidden/></field>
        <field name="productionRunId"><hidden/></field>
        <field name="partyId">
            <display-entity entity-name="PartyNameView" 
                description="${personalTitle} ${firstName} ${middleName} ${lastName} ${suffix} ${groupName}" 
                also-hidden="true" cache="false">
            </display-entity>
        </field>
        <field name="roleTypeId" title="${uiLabelMap.CommonRole}">
            <display-entity entity-name="RoleType" key-field-name="roleTypeId"/>
        </field>
        <field name="fromDate" title="${uiLabelMap.CommonFrom}"><display/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThru}"><display/></field>
    </grid>
    <grid name="ProductionRunTaskPartyAssocs" list-name="productionRunTaskParties"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <field name="productionRunId"><hidden/></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingTaskName}">
            <display-entity entity-name="WorkEffort" description="${workEffortName} - [${workEffortId}]"/>
        </field>
        <field name="partyId">
            <display-entity entity-name="PartyNameView" 
                description="${personalTitle} ${firstName} ${middleName} ${lastName} ${suffix} ${groupName}" 
                also-hidden="true" cache="false">
            </display-entity>
        </field>
        <field name="roleTypeId" title="${uiLabelMap.CommonRole}">
            <display-entity entity-name="RoleType" key-field-name="roleTypeId"/>
        </field>
        <field name="statusId" title="${uiLabelMap.CommonStatus}">
            <display-entity entity-name="StatusItem" key-field-name="statusId"/>
        </field>
        <field name="fromDate" title="${uiLabelMap.CommonFrom}"><display/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThru}"><display/></field>
    </grid>
    <form name="ProductionRunTaskComponents" type="list" target="updateProductionRunComponent" paginate-target="ProductionRunComponents" title="" list-name="records"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <row-actions>
            <entity-one entity-name="Product" value-field="product" use-cache="true"/>
        </row-actions>
        <field name="productId"><display/></field>
        <field name="internalName" map-name="product" title="${uiLabelMap.ProductInternalName}"><display/></field>
        <field name="workEffortId"><hidden/></field>
        <field name="productionRunId"><hidden/></field>
        <field name="estimatedQuantity"><text/></field>
        <field name="quantityUomId" map-name="product" title="${uiLabelMap.CommonUom}"><display-entity entity-name="Uom" key-field-name="uomId" description="${abbreviation}"/></field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
        <field name="deleteLink" title=" " widget-style="smallSubmit">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteProductionRunComponent" also-hidden="false">
                <parameter param-name="workEffortId"/>
                <parameter param-name="fromDate"/>
                <parameter param-name="productId"/>
                <parameter param-name="workEffortGoodStdTypeId"/>
                <parameter param-name="productionRunId"/>
            </hyperlink>
        </field>
    </form>
    <form name="ProductionRunTaskActualComponents" type="list" target="updateProductionRunComponent" paginate-target="ProductionRunActualComponents" title="" list-name="records"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
        <row-actions>
            <set field="quantityOnHandDiff" value="${groovy:-1*quantityOnHandDiff}" type="BigDecimal"/>
        </row-actions>
        <field name="inventoryItemId" widget-style="buttontext">
            <hyperlink description="${inventoryItemId}" target="/facility/control/EditInventoryItem" also-hidden="false" target-type="inter-app">
                <parameter param-name="inventoryItemId"/>
            </hyperlink>
        </field>
        <field name="productId" entry-name="inventoryItemId">
            <display-entity entity-name="InventoryItem" key-field-name="inventoryItemId" description="${productId}"/>
        </field>
        <field name="workEffortId"><hidden/></field>
        <field name="productionRunId"><hidden/></field>
        <field name="quantityOnHandDiff" title="${uiLabelMap.CommonQuantity}"><display/></field>
        <field name="unitCost" entry-name="inventoryItemId">
            <display-entity entity-name="InventoryItem" key-field-name="inventoryItemId" description="${unitCost}"/>
        </field>
        <field name="reasonEnumId">
            <display-entity entity-name="Enumeration" key-field-name="enumId"/>
        </field>
        <field name="description"><display/></field>
    </form>
    <form name="IssueProductionRunComponent" type="single" target="issueProductionRunTaskComponent" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <auto-fields-service service-name="issueProductionRunTaskComponent"/>
        <field name="productionRunId"><hidden/></field>
        <field name="fromDate"><date-time default-value="${nowTimestamp}"/></field>
        <field name="reserveOrderEnumId"><ignored/></field>
        <field name="workEffortId" title="${uiLabelMap.ManufacturingTaskId}">
            <drop-down allow-empty="false">
                <entity-options entity-name="WorkEffort" description="${workEffortName} [${workEffortId}]">
                    <entity-constraint name="workEffortParentId" env-name="productionRunId"/>
                    <entity-order-by field-name="workEffortId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productId">
            <lookup target-form-name="LookupProduct"/>
        </field>
        <field name="lotId" title="${uiLabelMap.ProductLotId}"><text /></field>
        <field name="reasonEnumId">
            <drop-down allow-empty="true">
                <entity-options entity-name="Enumeration" key-field-name="enumId">
                    <entity-constraint name="enumTypeId" value="IID_REASON"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="description"><text/></field>
        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit/></field>
    </form>
</forms>

