<#-- 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 security.hasEntityPermission("ORDERMGR", "_UPDATE", session) && (!orderHeader.salesChannelEnumId?? || orderHeader.salesChannelEnumId != "POS_SALES_CHANNEL")>

<#if shipGroups?has_content && (!orderHeader.salesChannelEnumId?? || orderHeader.salesChannelEnumId != "POS_SALES_CHANNEL")> <#if parameters.view?has_content && parameters.view = "OISGA">

<#assign index = 0> <#list orderItemDatas as orderItemData> <#assign orderItem = orderItemData.orderItem> <#assign OISGAssContents = orderItemData.OISGAssContents> <#assign product = orderItemData.product!> <#assign quantityOrdered = orderItemData.quantityOrdered?default(0)> <#assign totalQuantityToPlan = orderItemData.totalQuantityToPlan> <#assign quantityNotAvailable = orderItemData.quantityNotAvailable> <#assign rowCount = 0> <#if index != 0> <#if (quantityOrdered > 0) > <#list OISGAssContents as OISGAssContent> <#assign OISG = OISGAssContent.getRelatedOne("OrderItemShipGroup")> <#assign orderShipments = OISGAssContent.getRelated("OrderShipment", null, null, false)> <#assign rowCount = rowCount + 1> <#if !orderItem.statusId?exists || orderItem.statusId == "ITEM_CREATED" || orderItem.statusId == "ITEM_APPROVED" && (orderHeader.statusId != "ORDER_SENT" && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED" && orderHeader.statusId != "ORDER_CANCELLED")> <#assign index = index + 1>
${uiLabelMap.OrderItemId} ${uiLabelMap.ProductProduct} ${uiLabelMap.CommonQuantity} ${uiLabelMap.ProductQuantityNotAvailable}

${product.internalName!} [${orderItem.productId!}]
${quantityOrdered}
${quantityNotAvailable}
<#if !orderItem.statusId?exists || orderItem.statusId == "ITEM_CREATED" || orderItem.statusId == "ITEM_APPROVED">

 
[${OISG.shipGroupSeqId}] <#if OISG.shipByDate?has_content>, ${uiLabelMap.OrderShipBeforeDate} : ${OISG.shipByDate?date}
<#if orderType == "SALES_ORDER"> <#list orderShipments as orderShipment>
${uiLabelMap.OrderPlannedInShipment} : ${orderShipment.shipmentId!}:${orderShipment.shipmentItemSeqId!} - ${orderShipment.quantity!}
<#elseif orderType == "PURCHASE_ORDER"> <#list orderShipments as orderShipment> <#if orderShipment.quantity?has_content & orderShipment.quantity!=0.0 >
${uiLabelMap.OrderPlannedInReceive} : ${orderShipment.shipmentId!}:${orderShipment.shipmentItemSeqId!} - ${orderShipment.quantity!}
<#else> <#assign shipmentItem = orderShipment.getShipmentItem()>
${uiLabelMap.OrderPlannedRejected} : ${orderShipment.shipmentId!}:${orderShipment.shipmentItemSeqId!} - ${shipmentItem.quantity!}
${OISGAssContent.quantity!}
<#if (orderShipments.size()?default(0)) == 0> <#else>
 
${uiLabelMap.OrderAddToshipGroup} :
${uiLabelMap.CommonAdd}
<#else> <#list shipGroups as shipGroup> <#assign shipmentMethodType = shipGroup.getRelatedOne("ShipmentMethodType", false)!> <#assign shipGroupAddress = shipGroup.getRelatedOne("PostalAddress", false)!>

<#-- the setting of shipping method is only supported for sales orders at this time --> <#if orderHeader.orderTypeId == "SALES_ORDER"> <#if orderHeader?has_content && orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED"> <#if !shipGroup.contactMechId?has_content && !shipGroup.shipmentMethodTypeId?has_content> <#assign noShipment = "true">
 ${uiLabelMap.OrderAddress}  
<#if orderHeader?has_content && orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED"> <#else> ${(shipGroupAddress.address1)?default("")}
 ${uiLabelMap.CommonMethod}  
<#if orderHeader?has_content && orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED"> <#-- passing the shipmentMethod value as the combination of three fields value i.e shipmentMethodTypeId & carrierPartyId & roleTypeId. Values are separated by "@" symbol. --> <#else> <#if (shipGroup.carrierPartyId)?default("_NA_") != "_NA_"> ${shipGroup.carrierPartyId!} <#if shipmentMethodType?has_content> ${shipmentMethodType.get("description",locale)?default("")}
    ${uiLabelMap.OrderNewShippingAddress}
${uiLabelMap.OrderNotShipped}
<#if shipGroup.supplierPartyId?has_content> <#assign OISGAContent = shipGroup.getRelated("OrderItemShipGroupAssoc", null, null, false)> <#if OISGAContent.size() == 0> <#-- This section appears when Shipment of order is in picked status and its items are packed,this case comes when new shipping estimates based on weight of packages are more than or less than default percentage (defined in shipment.properties) of original shipping estimate--> <#-- getShipGroupEstimate method of ShippingEvents class can be used for get shipping estimate from system, on the basis of new package's weight --> <#if shippingRateList?has_content> <#if orderReadHelper.getOrderTypeId() != "PURCHASE_ORDER"> <#-- tracking number --> <#if shipGroup.trackingNumber?has_content || orderShipmentInfoSummaryList?has_content> <#if shipGroup.maySplit?has_content && noShipment?default("false") != "true"> <#if shipGroup.isGift?has_content && noShipment?default("false") != "true"> <#assign shipGroupShipments = shipGroup.getRelated("PrimaryShipment", null, null, false)> <#if shipGroupShipments?has_content> <#-- shipment actions --> <#if security.hasEntityPermission("ORDERMGR", "_UPDATE", session) && ((orderHeader.statusId == "ORDER_CREATED") || (orderHeader.statusId == "ORDER_APPROVED") || (orderHeader.statusId == "ORDER_SENT"))> <#-- Manual shipment options -->

${uiLabelMap.DeleteOrderItemShipGroup}
 ${uiLabelMap.ProductDropShipment} - ${uiLabelMap.PartySupplier}   ${Static["org.apache.ofbiz.party.party.PartyHelper"].getPartyName(delegator, shipGroup.supplierPartyId, false)!shipGroup.supplierPartyId}

<#list shippingRateList as shippingRate>
 ${uiLabelMap.OrderOnlineUPSShippingEstimates}
<#assign shipmentMethodAndAmount = shippingRate.shipmentMethodTypeId + "@" + "UPS" + "*" + shippingRate.rate> <#if (shippingRate.rate > -1)> <@ofbizCurrency amount=shippingRate.rate isoCode=orderReadHelper.getCurrency()/> <#else> ${uiLabelMap.OrderCalculatedOffline}

 ${uiLabelMap.OrderTrackingNumber}   <#-- TODO: add links to UPS/FEDEX/etc based on carrier partyId --> <#if shipGroup.trackingNumber?has_content> ${shipGroup.trackingNumber} <#if orderShipmentInfoSummaryList?has_content> <#list orderShipmentInfoSummaryList as orderShipmentInfoSummary> <#if orderShipmentInfoSummary.shipGroupSeqId! == shipGroup.shipGroupSeqId!>
<#if (orderShipmentInfoSummaryList?size > 1)>${orderShipmentInfoSummary.shipmentPackageSeqId}: ${uiLabelMap.CommonIdCode}: ${orderShipmentInfoSummary.trackingCode?default("[${uiLabelMap.OrderNotYetKnown}]")} <#if orderShipmentInfoSummary.boxNumber?has_content> ${uiLabelMap.ProductBox} #${orderShipmentInfoSummary.boxNumber} <#if orderShipmentInfoSummary.carrierPartyId?has_content>(${uiLabelMap.ProductCarrier}: ${orderShipmentInfoSummary.carrierPartyId})

 ${uiLabelMap.OrderSplittingPreference}  
<#if shipGroup.maySplit?upper_case == "N"> ${uiLabelMap.FacilityWaitEntireOrderReady} <#if security.hasEntityPermission("ORDERMGR", "_UPDATE", session)> <#if orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_CANCELLED">
${uiLabelMap.OrderAllowSplit} <#else> ${uiLabelMap.FacilityShipAvailable}

 ${uiLabelMap.OrderInstructions}   <#if (!orderHeader.statusId.equals("ORDER_COMPLETED")) && !(orderHeader.statusId.equals("ORDER_REJECTED")) && !(orderHeader.statusId.equals("ORDER_CANCELLED"))>
<#if shipGroup.shippingInstructions?has_content>
${uiLabelMap.CommonEdit}
<#else> ${uiLabelMap.CommonAdd}
<#else> <#if shipGroup.shippingInstructions?has_content> ${shipGroup.shippingInstructions} <#else> ${uiLabelMap.OrderThisOrderDoesNotHaveShippingInstructions}

 ${uiLabelMap.OrderGiftMessage}  
<#if shipGroup.giftMessage?has_content> ${uiLabelMap.CommonEdit} <#else> ${uiLabelMap.CommonAdd}

 ${uiLabelMap.OrderShipAfterDate}

 ${uiLabelMap.OrderShipBeforeDate}
 
<@htmlTemplate.renderDateTimeField name="shipAfterDate" event="" action="" value="${shipGroup.shipAfterDate!}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="shipAfterDate_${shipGroup.shipGroupSeqId}" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
<@htmlTemplate.renderDateTimeField name="shipByDate" event="" action="" value="${shipGroup.shipByDate!}" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="shipByDate_${shipGroup.shipGroupSeqId}" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
 ${uiLabelMap.ProductEstimatedShipDate}   <#if shipGroup.estimatedShipDate?has_content><#assign estimatedShipDate=shipGroup.estimatedShipDate?date><#else><#assign estimatedShipDate="-"/> <@htmlTemplate.renderDisplayField type="date" imageLocation="" idName="" description="${estimatedShipDate}" title="" class="" alert=""/>
 ${uiLabelMap.OrderOrderQuoteEstimatedDeliveryDate}   <#if shipGroup.estimatedDeliveryDate?has_content><#assign estimatedDeliveryDate=shipGroup.estimatedDeliveryDate?date><#else><#assign estimatedDeliveryDate="-"/> <@htmlTemplate.renderDisplayField type="date" imageLocation="" idName="" description="${estimatedDeliveryDate}" title="" class="" alert=""/>

 ${uiLabelMap.FacilityShipments}   <#list shipGroupShipments as shipment>
${uiLabelMap.CommonNbr}${shipment.shipmentId}   ${uiLabelMap.ProductPackingSlip} <#if "SALES_ORDER" == orderHeader.orderTypeId && "ORDER_COMPLETED" == orderHeader.statusId> <#assign shipmentRouteSegments = delegator.findByAnd("ShipmentRouteSegment", {"shipmentId" : shipment.shipmentId}, null, false)> <#if shipmentRouteSegments?has_content> <#assign shipmentRouteSegment = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(shipmentRouteSegments)> <#if "UPS" == (shipmentRouteSegment.carrierPartyId)!> ${uiLabelMap.ProductEmailReturnShippingLabelUPS}

<#if orderHeader.orderTypeId == "SALES_ORDER"> <#if !shipGroup.supplierPartyId?has_content> <#if orderHeader.statusId == "ORDER_APPROVED"> ${uiLabelMap.OrderPackShipmentForShipGroup}
${uiLabelMap.OrderNewShipmentForShipGroup}
<#else> <#assign facilities = facilitiesForShipGroup.get(shipGroup.shipGroupSeqId)> <#if facilities?has_content>
<#else> ${uiLabelMap.ProductShipmentQuickComplete} ${uiLabelMap.OrderNewDropShipmentForShipGroup} [${shipGroup.shipGroupSeqId}]