<#if !orderItem.productId?? || orderItem.productId == "_?_">
${orderItem.itemDescription?default("")}
<#else>
<#assign product = orderItem.getRelatedOne("Product", true)!/> <#-- should always exist because of FK constraint, but just in case -->
"
class="linktext">${orderItem.productId} - ${orderItem.itemDescription?default("")}
<#assign orderItemAttributes = orderItem.getRelated("OrderItemAttribute", null, null, false)/>
<#if orderItemAttributes?has_content>
<#list orderItemAttributes as orderItemAttribute>
${orderItemAttribute.attrName} : ${orderItemAttribute.attrValue}
#list>
#if>
<#if product?has_content>
<#if product.piecesIncluded?? && product.piecesIncluded?long != 0>
[${uiLabelMap.OrderPieces}: ${product.piecesIncluded}]
#if>
<#if (product.quantityIncluded?? && product.quantityIncluded != 0) || product.quantityUomId?has_content>
<#assign quantityUom = product.getRelatedOne("QuantityUom", true)!/>
[${uiLabelMap.CommonQuantity}
: ${product.quantityIncluded!} ${((quantityUom.abbreviation)?default(product.quantityUomId))!}]
#if>
<#if (product.productWeight?? && product.productWeight != 0) || product.weightUomId?has_content>
<#assign weightUom = product.getRelatedOne("WeightUom", true)!/>
[${uiLabelMap.CommonWeight}
: ${product.productWeight!} ${((weightUom.abbreviation)?default(product.weightUomId))!}]
#if>
<#if (product.productHeight?? && product.productHeight != 0) || product.heightUomId?has_content>
<#assign heightUom = product.getRelatedOne("HeightUom", true)!/>
[${uiLabelMap.CommonHeight}
: ${product.productHeight!} ${((heightUom.abbreviation)?default(product.heightUomId))!}]
#if>
<#if (product.productWidth?? && product.productWidth != 0) || product.widthUomId?has_content>
<#assign widthUom = product.getRelatedOne("WidthUom", true)!/>
[${uiLabelMap.CommonWidth}
: ${product.productWidth!} ${((widthUom.abbreviation)?default(product.widthUomId))!}]
#if>
<#if (product.productDepth?? && product.productDepth != 0) || product.depthUomId?has_content>
<#assign depthUom = product.getRelatedOne("DepthUom", true)!/>
[${uiLabelMap.CommonDepth}
: ${product.productDepth!} ${((depthUom.abbreviation)?default(product.depthUomId))!}]
#if>
#if>
<#if maySelectItems?default("N") == "Y">
<#assign returns = orderItem.getRelated("ReturnItem", null, null, false)!>
<#if returns?has_content>
<#list returns as return>
<#assign returnHeader = return.getRelatedOne("ReturnHeader", false)>
<#if returnHeader.statusId != "RETURN_CANCELLED">
<#if returnHeader.statusId == "RETURN_REQUESTED" || returnHeader.statusId == "RETURN_APPROVED">
<#assign displayState = "Return Pending">
<#else>
<#assign displayState = "Returned">
#if>
${displayState} (#${return.returnId})
#if>
#list>
#if>
#if>
<#if !(maySelectItems?default("N") == "Y")>
#if>
${orderItem.quantity?string.number}
<#if maySelectItems?default("N") == "Y">
<#assign pickedQty = localOrderReadHelper.getItemPickedQuantityBd(orderItem)>
<#if pickedQty gt 0 && orderHeader.statusId == "ORDER_APPROVED">${pickedQty?default(0)?string.number}<#else>${pickedQty?default(0)?string.number}#if>
<#assign shippedQty = localOrderReadHelper.getItemShippedQuantity(orderItem)>
${shippedQty?default(0)?string.number}
<#assign canceledQty = localOrderReadHelper.getItemCanceledQuantity(orderItem)>
${canceledQty?default(0)?string.number}
#if>
<@ofbizCurrency amount=orderItem.unitPrice isoCode=currencyUomId/>
<@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem) isoCode=currencyUomId/>
<#if workEfforts??>
<@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem)*rentalQuantity isoCode=currencyUomId/>
<#else>
<@ofbizCurrency amount=localOrderReadHelper.getOrderItemTotal(orderItem) isoCode=currencyUomId/>
#if>
<#if maySelectItems?default("N") == "Y" && roleTypeId! == "PLACING_CUSTOMER">
#if>
#if>
<#-- now cancel reason and comment field -->
<#if maySelectItems?default("N") == "Y" && (orderHeader.statusId != "ORDER_SENT" && orderItem.statusId != "ITEM_COMPLETED" && orderItem.statusId != "ITEM_CANCELLED" && pickedQty == 0)>
${uiLabelMap.EcommerceAdjustment}
: ${StringUtil.wrapString(localOrderReadHelper.getAdjustmentType(orderItemAdjustment))}
<#if orderItemAdjustment.description?has_content>
: ${StringUtil.wrapString(orderItemAdjustment.description)}#if>
<#if orderItemAdjustment.orderAdjustmentTypeId == "SALES_TAX">
<#if orderItemAdjustment.primaryGeoId?has_content>
<#assign primaryGeo = orderItemAdjustment.getRelatedOne("PrimaryGeo", true)/>
<#if primaryGeo.geoName?has_content>
${uiLabelMap.OrderJurisdiction}: ${primaryGeo.geoName} [${primaryGeo.abbreviation!}]
#if>
<#if orderItemAdjustment.secondaryGeoId?has_content>
<#assign secondaryGeo = orderItemAdjustment.getRelatedOne("SecondaryGeo", true)/>
(${uiLabelMap.CommonIn}: ${secondaryGeo.geoName} [${secondaryGeo.abbreviation!}])
#if>
#if>
<#if orderItemAdjustment.sourcePercentage??>${uiLabelMap.EcommerceRate}
: ${orderItemAdjustment.sourcePercentage}#if>
<#if orderItemAdjustment.customerReferenceId?has_content>${uiLabelMap.OrderCustomerTaxId}
: ${orderItemAdjustment.customerReferenceId}#if>
<#if orderItemAdjustment.exemptAmount??>${uiLabelMap.EcommerceExemptAmount}
: ${orderItemAdjustment.exemptAmount}#if>
#if>
<@ofbizCurrency amount=localOrderReadHelper.getOrderItemAdjustmentTotal(orderItem, orderItemAdjustment) isoCode=currencyUomId/>
<#if maySelectItems?default("N") == "Y">
#if>
#list>
<#-- show the order item ship group info -->
<#assign orderItemShipGroupAssocs = orderItem.getRelated("OrderItemShipGroupAssoc", null, null, false)!>
<#if orderItemShipGroupAssocs?has_content>
<#list orderItemShipGroupAssocs as shipGroupAssoc>
<#assign shipGroup = shipGroupAssoc.getRelatedOne("OrderItemShipGroup", false)!>
<#assign shipGroupAddress = (shipGroup.getRelatedOne("PostalAddress", false))!>