<#-- 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. --> <#-- Continuation of showcart.ftl: List of order items and forms to modify them. --> <#macro showAssoc productAssoc> <#assign productAssocType = (delegator.findOne("ProductAssocType", {"productAssocTypeId" : productAssoc.productAssocTypeId}, false))/> <#assign assocProduct = (delegator.findOne("Product", {"productId" : productAssoc.productIdTo}, false))/> <#if assocProduct?has_content> ${productAssoc.productIdTo} - ${(assocProduct.productName)!}(${(productAssocType.description)?default("Unknown")})
${uiLabelMap.OrderOrderItems}
<#if (shoppingCartSize > 0)>
<#if shoppingCart.getOrderType() == "PURCHASE_ORDER"> <#assign itemsFromList = false> <#list shoppingCart.items() as cartLine> <#assign cartLineIndex = shoppingCart.getItemIndex(cartLine)> <#assign lineOptionalFeatures = cartLine.getOptionalProductFeatures()> <#-- gift wrap option --> <#assign showNoGiftWrapOptions = false> <#-- end gift wrap option --> <#if shoppingCart.getAdjustments()?has_content> <#list shoppingCart.getAdjustments() as cartAdjustment> <#assign adjustmentType = cartAdjustment.getRelatedOne("OrderAdjustmentType", true)> <#if adjustmentType.get("orderAdjustmentTypeId",locale) != 'SHIPPING_CHARGES'> <#if orderShippingTotal != 0> <#if orderTaxTotal != 0>
 
${uiLabelMap.ProductProduct} <#if (shoppingCart.getOrderType() == 'SALES_ORDER') && (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
${uiLabelMap.OrderQuantity}
${uiLabelMap.CommonUnitPrice}
${uiLabelMap.OrderAdjustments}
${uiLabelMap.OrderItemTotal}

  <#if cartLine.getRequirementId()?has_content> <#if cartLine.getQuoteId()?has_content> <#if cartLine.getQuoteItemSeqId()?has_content> <#if cartLine.getItemComment()?has_content> <#if cartLine.getDesiredDeliveryDate()?has_content> <#-- inventory summary --> <#if cartLine.getProductId()??> <#assign productId = cartLine.getProductId()> <#assign product = cartLine.getProduct()> <#if shoppingCart.getOrderType() == "PURCHASE_ORDER"> <#assign currentOrderItemType = cartLine.getItemTypeGenericValue()!/> <#-- ship before/after date --> <#-- Show Associated Products (not for Variants) --> <#if cartLine.getProductId()??> <#assign itemProductAssocList = cartLine.getProduct().getRelated("MainProductAssoc", null, Static["org.apache.ofbiz.base.util.UtilMisc"].toList("productAssocTypeId", "sequenceNum"), false)!/> <#if itemProductAssocList?? && itemProductAssocList?has_content> <#assign relatedProdCount = 0/> <#list itemProductAssocList! as itemProductAssoc> <#if "PRODUCT_VARIANT" != itemProductAssoc.productAssocTypeId> <#assign relatedProdCount = relatedProdCount + 1/> <#if (relatedProdCount > 3)><#break> <@showAssoc productAssoc=itemProductAssoc />
<#if cartLine.getProductId()??> <#-- product item --> ${cartLine.getProductId()} -
${cartLine.getDescription()!} <#if shoppingCart.getOrderType() != "PURCHASE_ORDER"> <#-- only applies to sales orders, not purchase orders --> <#-- if inventory is not required check to see if it is out of stock and needs to have a message shown about that... --> <#assign itemProduct = cartLine.getProduct()> <#assign isStoreInventoryNotRequiredAndNotAvailable = Static["org.apache.ofbiz.product.store.ProductStoreWorker"].isStoreInventoryRequiredAndAvailable(request, itemProduct, cartLine.getQuantity(), false, false)> <#if isStoreInventoryNotRequiredAndNotAvailable && itemProduct.inventoryMessage?has_content> (${itemProduct.inventoryMessage}) <#else> <#-- this is a non-product item --> ${cartLine.getItemTypeDescription()!} : ${cartLine.getName()!} <#-- display the item's features --> <#assign features = ""> <#if cartLine.getFeaturesForSupplier(dispatcher,shoppingCart.getPartyId())?has_content> <#assign features = cartLine.getFeaturesForSupplier(dispatcher, shoppingCart.getPartyId())> <#elseif cartLine.getStandardFeatureList()?has_content> <#assign features = cartLine.getStandardFeatureList()> <#if features?has_content>
${uiLabelMap.ProductFeatures}: <#list features as feature>${feature.description?default("")} <#-- show links to survey response for this item --> <#if cartLine.getAttribute("surveyResponses")?has_content>
Surveys: <#list cartLine.getAttribute("surveyResponses") as surveyResponseId> ${surveyResponseId}
${uiLabelMap.OrderRequirementId}: ${cartLine.getRequirementId()!}
${uiLabelMap.OrderOrderQuoteId}: ${cartLine.getQuoteId()!} - ${cartLine.getQuoteItemSeqId()!}
${uiLabelMap.CommonComment} :

${uiLabelMap.OrderDesiredDeliveryDate}:
${cartLine.getDesiredDeliveryDate()!}
${uiLabelMap.ProductInventory}: ${uiLabelMap.ProductAtp} = ${availableToPromiseMap.get(productId)}, ${uiLabelMap.ProductQoh} = ${quantityOnHandMap.get(productId)} <#if Static["org.apache.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")> ${uiLabelMap.ProductMarketingPackageATP} = ${mktgPkgATPMap.get(productId)}, ${uiLabelMap.ProductMarketingPackageQOH} = ${mktgPkgQOHMap.get(productId)} <#if ( mktgPkgATPMap.get(cartLine.getProductId()) < cartLine.getQuantity()) && (shoppingCart.getOrderType() == 'SALES_ORDER')> <#assign backOrdered = cartLine.getQuantity() - mktgPkgATPMap.get(cartLine.getProductId())/> [${backOrdered!} ${uiLabelMap.OrderBackOrdered}] <#assign isPhysical = Static["org.apache.ofbiz.product.product.ProductWorker"].isPhysical(product)/> <#if (availableToPromiseMap.get(cartLine.getProductId()) <= 0) && (shoppingCart.getOrderType() == 'SALES_ORDER') && product.productTypeId! != "MARKETING_PKG_AUTO" && product.productTypeId! != "MARKETING_PKG_PICK" && isPhysical> [${cartLine.getQuantity()} ${uiLabelMap.OrderBackOrdered}] <#else> <#if (availableToPromiseMap.get(cartLine.getProductId()) < cartLine.getQuantity()) && (shoppingCart.getOrderType() == 'SALES_ORDER') && product.productTypeId != "MARKETING_PKG_AUTO" && product.productTypeId != "MARKETING_PKG_PICK" && isPhysical> <#assign backOrdered = cartLine.getQuantity() - availableToPromiseMap.get(cartLine.getProductId())/> [${backOrdered!} ${uiLabelMap.OrderBackOrdered}]
${uiLabelMap.OrderOrderItemType}:
${uiLabelMap.OrderShipAfterDate} <@htmlTemplate.renderDateTimeField name="shipAfterDate_${cartLineIndex}" value="${cartLine.getShipAfterDate()?default('')}" event="" action="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="shipAfterDate_${cartLineIndex}" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
 
${uiLabelMap.OrderShipBeforeDate} <@htmlTemplate.renderDateTimeField name="shipBeforeDate_${cartLineIndex}" value="${cartLine.getShipBeforeDate()?default('')}" event="" action="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="15" maxlength="30" id="shipBeforeDate_${cartLineIndex}" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>

${uiLabelMap.OrderAssociatedProducts} ${uiLabelMap.OrderQuickLookup}
<#if (cartLine.getIsPromo() && cartLine.getAlternativeOptionProductIds()?has_content)> <#-- Show alternate gifts if there are any... -->
${uiLabelMap.OrderChooseFollowingForGift}:
<#list cartLine.getAlternativeOptionProductIds() as alternativeOptionProductId> <#assign alternativeOptionProduct = delegator.findOne("Product", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("productId", alternativeOptionProductId), true)> <#assign alternativeOptionName = Static["org.apache.ofbiz.product.product.ProductContentWrapper"].getProductContentAsText(alternativeOptionProduct, "PRODUCT_NAME", locale, dispatcher, "html")!>
<#assign giftWrapOption = lineOptionalFeatures.GIFT_WRAP!> <#assign selectedOption = cartLine.getAdditionalProductFeatureAndAppl("GIFT_WRAP")!> <#if giftWrapOption?has_content> <#elseif showNoGiftWrapOptions> <#else>  
<#if cartLine.getIsPromo() || cartLine.getShoppingListId()??> ${cartLine.getQuantity()?string.number} <#else> <#if (cartLine.getSelectedAmount() > 0) >
${uiLabelMap.OrderAmount}:
<#if cartLine.getIsPromo() || (shoppingCart.getOrderType() == "SALES_ORDER" && !security.hasEntityPermission("ORDERMGR", "_SALES_PRICEMOD", session))> <@ofbizCurrency amount=cartLine.getDisplayPrice() isoCode=currencyUomId/> <#else> <#if (cartLine.getSelectedAmount() > 0) > <#assign price = cartLine.getBasePrice() / cartLine.getSelectedAmount()> <#else> <#assign price = cartLine.getBasePrice()>
<@ofbizCurrency amount=cartLine.getOtherAdjustments() isoCode=currencyUomId/>
<@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=currencyUomId/>
<#if !cartLine.getIsPromo()><#else> 

${uiLabelMap.OrderSubTotal}:
<@ofbizCurrency amount=shoppingCart.getSubTotal() isoCode=currencyUomId/>
 
${uiLabelMap.OrderAdjustment} - ${adjustmentType.get("description",locale)!} <#if cartAdjustment.productPromoId?has_content>${uiLabelMap.CommonDetails}:
<@ofbizCurrency amount=Static["org.apache.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(cartAdjustment, shoppingCart.getSubTotal()) isoCode=currencyUomId/>
 
${uiLabelMap.FacilityShippingAndHandling}
<@ofbizCurrency amount=orderShippingTotal isoCode=currencyUomId/>
${uiLabelMap.OrderSalesTax}
<@ofbizCurrency amount=orderTaxTotal isoCode=currencyUomId/>
${uiLabelMap.OrderCartTotal}:

<@ofbizCurrency amount=shoppingCart.getGrandTotal() isoCode=currencyUomId/>
 
<#else>
${uiLabelMap.OrderNoOrderItemsToDisplay}