<#-- 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> <#-- master layout specifies the overall layout of the pages and its different sections. --> <#-- main body --> <#-- a header --> <#-- a footer --> <#-- the region-before and -after must be declared as fo:static-content and before the fo:flow. only 1 fo:flow per fo:page-sequence --> ${screens.render("component://order/widget/ordermgr/OrderPrintForms.xml#CompanyLogo")} ${uiLabelMap.CommonTo}: <#if billingAddress?has_content> <#assign billingPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", billingParty.partyId, "compareDate", invoice.invoiceDate, "userLogin", userLogin))/> ${billingPartyNameResult.fullName?default(billingAddress.toName)?default("Billing Name Not Found")} <#if billingAddress.attnName?exists> ${billingAddress.attnName} ${billingAddress.address1?if_exists} <#if billingAddress.address2?exists> ${billingAddress.address2} ${billingAddress.city?if_exists} ${billingAddress.stateProvinceGeoId?if_exists} ${billingAddress.postalCode?if_exists} <#else> ${uiLabelMap.AccountingNoGenBilAddressFound}${billingParty.partyId} <#if billingPartyTaxId?has_content> Tax ID: ${billingPartyTaxId} ${invoice.getRelatedOne("InvoiceType").get("description",locale)} ${uiLabelMap.AccountingInvoiceDateAbbr}: ${invoiceDate?if_exists} ${uiLabelMap.AccountingCustNr}: <#if invoice?has_content>${billingParty.partyId} ${uiLabelMap.AccountingInvNr}: <#if invoice?has_content>${invoice.invoiceId} ${uiLabelMap.AccountingDescr}: <#if invoice?has_content>${invoice.description?if_exists} <#-- Inserts a newline. white-space-collapse="false" specifies that the stuff inside fo:block is to repeated verbatim --> <#-- list of orders --> <#if orders?has_content> ${uiLabelMap.AccountingOrderNr}: <#list orders as order> ${order} <#-- TODO: put shipment information here or somewhere --> <#-- Insert newline --> <#-- this part is the footer. Use it for standard boilerplate text. --> <#-- displays page number. "theEnd" is an id of a fo:block at the very end --> ${uiLabelMap.CommonPage} ${uiLabelMap.CommonOf} Powered by OFBiz at www.ofbiz.org <#-- end of footer --> <#-- this part is the main body which lists the items --> ${uiLabelMap.AccountingItemNr} ${uiLabelMap.AccountingProduct} ${uiLabelMap.CommonDescription} ${uiLabelMap.CommonQty} ${uiLabelMap.AccountingUnitPrice} ${uiLabelMap.CommonAmount} <#assign currentShipmentId = ""> <#assign newShipmentId = ""> <#-- if the item has a description, then use its description. Otherwise, use the description of the invoiceItemType --> <#list invoiceItems as invoiceItem> <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType")> <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct")?if_exists> <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists> <#if itemBillings?has_content> <#assign itemBilling = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)> <#if itemBilling?has_content> <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance")?if_exists> <#if itemIssuance?has_content> <#assign newShipmentId = itemIssuance.shipmentId> <#if invoiceItem.description?has_content> <#assign description=invoiceItem.description> <#elseif taxRate?has_content & taxRate.get("description",locale)?has_content> <#assign description=taxRate.get("description",locale)> <#elseif itemType.get("description",locale)?has_content> <#assign description=itemType.get("description",locale)> <#if newShipmentId?exists & newShipmentId != currentShipmentId> <#-- the shipment id is printed at the beginning for each group of invoice items created for the same shipment --> <#-- blank line --> ${uiLabelMap.ProductShipmentId}: ${newShipmentId} <#assign currentShipmentId = newShipmentId> <#-- blank line --> ${invoiceItem.invoiceItemSeqId} ${invoiceItem.productId?if_exists} ${description?if_exists} <#if invoiceItem.quantity?exists>${invoiceItem.quantity?string.number} <#if invoiceItem.quantity?exists><@ofbizCurrency amount=invoiceItem.amount?if_exists isoCode=invoice.currencyUomId?if_exists/> <#if invoiceItem.quantity?exists><@ofbizCurrency amount=(invoiceItem.quantity?double * invoiceItem.amount?double) isoCode=invoice.currencyUomId?if_exists/><#else><@ofbizCurrency amount=(invoiceItem.amount?double) isoCode=invoice.currencyUomId?if_exists/> <#-- blank line --> <#-- blank line --> <#-- the grand total --> ${uiLabelMap.AccountingTotalCapital} <@ofbizCurrency amount=invoiceTotal isoCode=invoice.currencyUomId?if_exists/> Total excl. tax <@ofbizCurrency amount=invoiceNoTaxTotal isoCode=invoice.currencyUomId?if_exists/> <#if invoice.invoiceMessage?has_content>${invoice.invoiceMessage} <#-- marks the end of the pages and used to identify page-number at the end -->