<#-- 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> <#-- JS to populate the quantity_o_# field required by the chained issueOrderItemToShipment service --> <#assign productId = parameters.productId?if_exists/>

<#if ! isPurchaseShipment>
<#assign uiLabelWithVar=uiLabelMap.ProductErrorShipmentNotPurchaseShipment?interpret><@uiLabelWithVar/>
<#elseif orderId?has_content && !orderHeader?exists>
<#assign uiLabelWithVar=uiLabelMap.ProductErrorOrderIdNotFound?interpret><@uiLabelWithVar/>
<#elseif orderHeader?exists && orderHeader.orderTypeId != "PURCHASE_ORDER">
<#assign uiLabelWithVar=uiLabelMap.ProductErrorOrderNotPurchaseOrder?interpret><@uiLabelWithVar/>
<#elseif ProductReceiveInventoryAgainstPurchaseOrderProductNotFound?exists>
<#assign uiLabelWithVar=uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrderProductNotFound?interpret><@uiLabelWithVar/>
<#elseif ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive?exists>
<#assign uiLabelWithVar=uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive?interpret><@uiLabelWithVar/>
<#if ProductReceiveInventoryAgainstPurchaseOrderQuantityGoesToBackOrder?exists>
<#assign uiLabelWithVar=uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrderQuantityGoesToBackOrder?interpret><@uiLabelWithVar/>
${uiLabelMap.ProductShipmentId}  ${uiLabelMap.ProductOrderId}  <@htmlTemplate.lookupField value="${orderId?if_exists}" formName="ReceiveInventoryAgainstPurchaseOrder" name="purchaseOrderId" id="purchaseOrderId" fieldFormName="LookupOrderHeaderAndShipInfo"/> ${uiLabelMap.ProductOrderShipGroupId} 
<#if shipment?exists> <#if isPurchaseShipment> <#assign itemsAvailableToReceive = totalAvailableToReceive?default(0) > 0/> <#if orderItemDatas?exists>
<#assign rowCount = 0> <#assign totalReadyToReceive = 0/>
<#-- Must use the uiLabelMap[""] notation since the label key has . in it --> <#if itemsAvailableToReceive> <#assign alt_row = false> <#list orderItemDatas?if_exists as orderItemData> <#assign orderItem = orderItemData.orderItem> <#assign product = orderItemData.product?if_exists> <#assign itemShipGroupSeqId = orderItemData.shipGroupSeqId?if_exists> <#assign totalQuantityReceived = orderItemData.totalQuantityReceived?default(0)> <#assign availableToReceive = orderItemData.availableToReceive?default(0)> <#assign backOrderedQuantity = orderItemData.backOrderedQuantity?default(0)> <#assign fulfilledReservations = orderItemData.fulfilledReservations> class="alternate-row"> <#if availableToReceive > 0 > <#assign rowCount = rowCount + 1> <#-- toggle the row color --> <#assign alt_row = !alt_row> <#if itemsAvailableToReceive>
${uiLabelMap.ProductProduct}${uiLabelMap["GoodIdentificationType.description.UPCA"]} ${uiLabelMap.OrderOrder} ${uiLabelMap.OrderCancelled} ${uiLabelMap.OrderBackOrdered} ${uiLabelMap.CommonReceived} ${uiLabelMap.ProductOpenQuantity} ${uiLabelMap.ProductBackOrders}${uiLabelMap.CommonReceive} ${uiLabelMap.ProductInventoryItemType}
${uiLabelMap.CommonAll}
${(product.internalName)?if_exists} [${orderItem.productId?default("N/A")}]
<#assign upcaLookup = Static["org.ofbiz.base.util.UtilMisc"].toMap("productId", product.productId, "goodIdentificationTypeId", "UPCA")/> <#assign upca = delegator.findByPrimaryKeyCache("GoodIdentification", upcaLookup)?if_exists/> <#if upca?has_content> ${upca.idValue?if_exists}
${orderItem.quantity} ${orderItem.cancelQuantity?default(0)}
${backOrderedQuantity}
${totalQuantityReceived} ${orderItem.quantity - orderItem.cancelQuantity?default(0) - totalQuantityReceived}
<#if fulfilledReservations?has_content> <#list fulfilledReservations?sort_by("orderId") as fulfilledReservation> ${fulfilledReservation.orderId}
<#-- quantity field required by the chained issueOrderItemToShipment service --> <#if itemQuantitiesToReceive?exists && itemQuantitiesToReceive.get(orderItem.orderItemSeqId)?exists> <#assign quantityToReceive = itemQuantitiesToReceive.get(orderItem.orderItemSeqId)> <#else> <#assign quantityToReceive = 0> <#assign totalReadyToReceive = totalReadyToReceive + quantityToReceive/> ${uiLabelMap.CommonClear}
${uiLabelMap.CommonClearAll} ${uiLabelMap.ProductReceiveItem}
${uiLabelMap.OrderForceCompletePurchaseOrder}
<#if itemsAvailableToReceive && totalReadyToReceive < totalAvailableToReceive>

${uiLabelMap.ProductReceiveInventoryAddProductToReceive}

${uiLabelMap.ProductProductId}/${uiLabelMap.ProductGoodIdentification} @
<#elseif parameters.shipmentId?has_content>

${uiLabelMap.ProductShipmentNotFoundId}: [${shipmentId?if_exists}]