<#-- 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. --> <#if shipment?exists>

${uiLabelMap.ProductOrderId} <@htmlTemplate.lookupField value="${orderId?if_exists}" formName="additemsfromorder" name="orderId" id="orderId" fieldFormName="LookupOrderHeaderAndShipInfo"/> ${uiLabelMap.ProductOrderShipGroupId}

<#if orderId?has_content && !orderHeader?exists>

<#assign uiLabelWithVar=uiLabelMap.ProductErrorOrderIdNotFound?interpret><@uiLabelWithVar/>.

<#if orderHeader?exists> <#if orderHeader.orderTypeId == "SALES_ORDER" && shipment.shipmentTypeId?if_exists != "SALES_SHIPMENT">

${uiLabelMap.ProductWarningOrderType} ${(orderType.get("description",locale))?default(orderHeader.orderTypeId?if_exists)}, ${uiLabelMap.ProductNotSalesShipment}.

<#elseif orderHeader.orderTypeId == "PURCHASE_ORDER" && shipment.shipmentTypeId?if_exists != "PURCHASE_SHIPMENT" && shipment.shipmentTypeId?if_exists != "DROP_SHIPMENT">

${uiLabelMap.ProductWarningOrderType} ${(orderType.get("description",locale))?default(orderHeader.orderTypeId?if_exists)}, ${uiLabelMap.ProductNotPurchaseShipment}.

<#else>

${uiLabelMap.ProductNoteOrderType} ${(orderType.get("description",locale))?default(orderHeader.orderTypeId?if_exists)}.

${uiLabelMap.ProductShipmentType}: ${shipment.shipmentTypeId?if_exists}.

<#if shipment.shipmentTypeId?if_exists == "SALES_SHIPMENT">

${uiLabelMap.ProductOriginFacilityIs}: <#if originFacility?exists>${originFacility.facilityName?if_exists} [${originFacility.facilityId}]<#else>${uiLabelMap.ProductNotSet}

<#elseif shipment.shipmentTypeId?if_exists == "PURCHASE_SHIPMENT">

${uiLabelMap.ProductDestinationFacilityIs}: <#if destinationFacility?exists>${destinationFacility.facilityName?if_exists} [${destinationFacility.facilityId}]<#else>${uiLabelMap.ProductNotSet}

<#if "ORDER_APPROVED" == orderHeader.statusId || "ORDER_BACKORDERED" == orderHeader.statusId>

${uiLabelMap.ProductNoteOrderStatus} ${(orderHeaderStatus.get("description",locale))?default(orderHeader.statusId?if_exists)}.

<#elseif "ORDER_COMPLETED" == orderHeader.statusId>

${uiLabelMap.ProductNoteOrderStatus} ${(orderHeaderStatus.get("description",locale))?default(orderHeader.statusId?if_exists)}, ${uiLabelMap.ProductNoItemsLeft}.

<#else>

${uiLabelMap.ProductWarningOrderStatus} ${(orderHeaderStatus.get("description",locale))?default(orderHeader.statusId?if_exists)}; ${uiLabelMap.ProductApprovedBeforeShipping}.


<#if orderItemDatas?exists> <#assign rowCount = 0> <#if isSalesOrder>
<#else> <#if isSalesOrder> <#else> <#assign alt_row = false> <#list orderItemDatas?if_exists as orderItemData> <#assign orderItemAndShipGroupAssoc = orderItemData.orderItemAndShipGroupAssoc> <#assign product = orderItemData.product?if_exists> <#assign itemIssuances = orderItemData.itemIssuances> <#assign totalQuantityIssued = orderItemData.totalQuantityIssued> <#assign orderItemShipGrpInvResDatas = orderItemData.orderItemShipGrpInvResDatas?if_exists> <#assign totalQuantityReserved = orderItemData.totalQuantityReserved?if_exists> <#assign totalQuantityIssuedAndReserved = orderItemData.totalQuantityIssuedAndReserved?if_exists> class="alternate-row"> <#if isSalesOrder> <#else> <#assign quantityNotIssued = orderItemAndShipGroupAssoc.quantity - totalQuantityIssued> <#if (quantityNotIssued > 0)> <#assign rowCount = rowCount + 1> <#else> <#if isSalesOrder> <#list orderItemShipGrpInvResDatas as orderItemShipGrpInvResData> <#assign orderItemShipGrpInvRes = orderItemShipGrpInvResData.orderItemShipGrpInvRes> <#assign inventoryItem = orderItemShipGrpInvResData.inventoryItem> <#assign inventoryItemFacility = orderItemShipGrpInvResData.inventoryItemFacility> <#assign availableQuantity = orderItemShipGrpInvRes.quantity - (orderItemShipGrpInvRes.quantityNotAvailable?default(0))> <#if availableQuantity < 0> <#assign availableQuantity = 0> <#if originFacility?exists && originFacility.facilityId == inventoryItem.facilityId?if_exists> <#assign rowCount = rowCount + 1> <#else> <#-- toggle the row color --> <#assign alt_row = !alt_row>
${uiLabelMap.ProductOrderId}
${uiLabelMap.ProductOrderShipGroupId}
${uiLabelMap.ProductOrderItem}
${uiLabelMap.ProductProduct}${uiLabelMap.ProductItemsIssuedReserved} ${uiLabelMap.ProductIssuedReservedTotalOrdered} ${uiLabelMap.ProductReserved} ${uiLabelMap.ProductNotAvailable}${uiLabelMap.ProductItemsIssued} ${uiLabelMap.ProductIssuedOrdered} ${uiLabelMap.ProductIssue}
${uiLabelMap.CommonSubmit} ?
${uiLabelMap.CommonAll}
${orderItemAndShipGroupAssoc.orderId} / ${orderItemAndShipGroupAssoc.shipGroupSeqId} / ${orderItemAndShipGroupAssoc.orderItemSeqId}
${(product.internalName)?if_exists} [${orderItemAndShipGroupAssoc.productId?default("N/A")}]
<#if itemIssuances?has_content> <#list itemIssuances as itemIssuance>
[${itemIssuance.quantity?if_exists}]${itemIssuance.shipmentId?if_exists}:${itemIssuance.shipmentItemSeqId?if_exists} ${uiLabelMap.CommonOn} [${(itemIssuance.issuedDateTime.toString())?if_exists}] ${uiLabelMap.CommonBy} [${(itemIssuance.issuedByUserLoginId)?if_exists}]
<#else>
 
<#if isSalesOrder> <#if (totalQuantityIssuedAndReserved != orderItemAndShipGroupAssoc.quantity)> <#else> [${totalQuantityIssued} + ${totalQuantityReserved} = ${totalQuantityIssuedAndReserved}] <#if (totalQuantityIssuedAndReserved > orderItemAndShipGroupAssoc.quantity)>><#else><#if (totalQuantityIssuedAndReserved < orderItemAndShipGroupAssoc.quantity)><<#else>= ${orderItemAndShipGroupAssoc.quantity} <#else> <#if (totalQuantityIssued > orderItemAndShipGroupAssoc.quantity)> <#else> ${totalQuantityIssued} <#if (totalQuantityIssued > orderItemAndShipGroupAssoc.quantity)>><#else><#if (totalQuantityIssued < orderItemAndShipGroupAssoc.quantity)><<#else>= ${orderItemAndShipGroupAssoc.quantity}
           
   
${orderItemShipGrpInvRes.inventoryItemId} <#if inventoryItem.facilityId?has_content> style="color: red;">[${(inventoryItemFacility.facilityName)?default(inventoryItem.facilityId)}] <#else> [${uiLabelMap.ProductNoFacility}]
  ${orderItemShipGrpInvRes.quantity} ${orderItemShipGrpInvRes.quantityNotAvailable?default(" ")} ${uiLabelMap.ProductNotOriginFacility}  
<#else>