#--
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.
-->
<#escape x as x?xml>
<#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
<#if supplierGeneralContactMechValueMap??>
<#assign contactMech = supplierGeneralContactMechValueMap.contactMech>
${uiLabelMap.OrderPurchasedFrom}:
<#assign postalAddress = supplierGeneralContactMechValueMap.postalAddress>
<#if postalAddress?has_content>
<#if postalAddress.toName?has_content>${postalAddress.toName}#if>
<#if postalAddress.attnName?has_content>${postalAddress.attnName!}#if>
${postalAddress.address1!}
<#if postalAddress.address2?has_content>${postalAddress.address2!}#if>
<#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId!}, false))! />
${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName!}#if> ${postalAddress.postalCode!}
<#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId!}, false))! />
<#if countryGeo?has_content>${countryGeo.geoName!}#if>
#if>
<#else>
<#-- here we just display the name of the vendor, since there is no address -->
<#assign vendorParty = orderReadHelper.getBillFromParty()>
${uiLabelMap.OrderPurchasedFrom}: ${Static['org.apache.ofbiz.party.party.PartyHelper'].getPartyName(vendorParty)}
#if>
#if>
<#-- list all postal addresses of the order. there should be just a billing and a shipping here. -->
<#list orderContactMechValueMaps as orderContactMechValueMap>
<#assign contactMech = orderContactMechValueMap.contactMech>
<#assign contactMechPurpose = orderContactMechValueMap.contactMechPurposeType>
<#if contactMech.contactMechTypeId == "POSTAL_ADDRESS">
<#assign postalAddress = orderContactMechValueMap.postalAddress>
${contactMechPurpose.get("description",locale)}:
<#if postalAddress?has_content>
<#if postalAddress.toName?has_content>${postalAddress.toName!}#if>
<#if postalAddress.attnName?has_content>${postalAddress.attnName!}#if>
${postalAddress.address1!}
<#if postalAddress.address2?has_content>${postalAddress.address2!}#if>
<#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId!}, false))! />
${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName!}#if> ${postalAddress.postalCode!}
<#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId!}, false))! />
<#if countryGeo?has_content>${countryGeo.geoName!}#if>
#if>
#if>
#list>
<#if orderPaymentPreferences?has_content>
${uiLabelMap.AccountingPaymentInformation}:
<#list orderPaymentPreferences as orderPaymentPreference>
<#assign paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType", false)!>
<#if (orderPaymentPreference?? && (orderPaymentPreference.getString("paymentMethodTypeId") == "CREDIT_CARD") && (orderPaymentPreference.getString("paymentMethodId")?has_content))>
<#assign creditCard = orderPaymentPreference.getRelatedOne("PaymentMethod", false).getRelatedOne("CreditCard", false)>
${Static["org.apache.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}
<#else>
${paymentMethodType.get("description",locale)!}
#if>
#list>
#if>
<#if orderHeader.getString("orderTypeId") == "SALES_ORDER" && shipGroups?has_content>
${uiLabelMap.OrderShipmentInformation}:
<#list shipGroups as shipGroup>
<#if shipGroups.size() gt 1>${shipGroup.shipGroupSeqId} - #if>
<#if (shipGroup.shipmentMethodTypeId)??>
${(shipGroup.getRelatedOne("ShipmentMethodType", false).get("description", locale))?default(shipGroup.shipmentMethodTypeId)}
#if>
<#if (shipGroup.shipAfterDate)?? || (shipGroup.shipByDate)??>
<#if (shipGroup.shipAfterDate)??> - ${uiLabelMap.OrderShipAfterDate}: ${Static["org.apache.ofbiz.base.util.UtilDateTime"].toDateString(shipGroup.shipAfterDate)}#if><#if (shipGroup.shipByDate)??> - ${uiLabelMap.OrderShipBeforeDate}: ${Static["org.apache.ofbiz.base.util.UtilDateTime"].toDateString(shipGroup.shipByDate)}#if>
#if>
#list>
#if>
<#if orderTerms?has_content && orderTerms.size() gt 0>
${uiLabelMap.OrderOrderTerms}:
<#list orderTerms as orderTerm>
${orderTerm.getRelatedOne("TermType", false).get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")} ${orderTerm.textValue?default("")}
#list>
#if>
#escape>