<#-- 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> <#-- list of orders --> <#if orders?has_content> ${uiLabelMap.AccountingOrderNr}: <#list orders as order>${order} <#-- list of terms --> <#if terms?has_content> ${uiLabelMap.AccountingAgreementItemTerms} <#list terms as term> <#assign termType = term.getRelatedOne("TermType", false)/> ${termType.description!} ${term.description!} ${term.termDays!} ${term.textValue!} ${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", false)> <#assign isItemAdjustment = Static["org.apache.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "InvoiceItemType", "invoiceItemTypeId", itemType.getString("invoiceItemTypeId"), "parentTypeId", "INVOICE_ADJ")/> <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false)!> <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling", null, null, false)!> <#if itemBillings?has_content> <#assign itemBilling = Static["org.apache.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)> <#if itemBilling?has_content> <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance", false)!> <#if itemIssuance?has_content> <#assign newShipmentId = itemIssuance.shipmentId> <#assign issuedDateTime = itemIssuance.issuedDateTime/> <#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?? & newShipmentId != currentShipmentId> <#-- the shipment id is printed at the beginning for each group of invoice items created for the same shipment --> ${uiLabelMap.ProductShipmentId}: ${newShipmentId}<#if issuedDateTime??> ${uiLabelMap.CommonDate}: ${Static["org.apache.ofbiz.base.util.UtilDateTime"].toDateString(issuedDateTime)} <#assign currentShipmentId = newShipmentId> <#if !isItemAdjustment> ${invoiceItem.productId!} ${description!} <#if invoiceItem.quantity??>${invoiceItem.quantity?string.number} <#if invoiceItem.quantity??><@ofbizCurrency amount=invoiceItem.amount! isoCode=invoice.currencyUomId!/> <@ofbizCurrency amount=(Static["org.apache.ofbiz.accounting.invoice.InvoiceWorker"].getInvoiceItemTotal(invoiceItem)) isoCode=invoice.currencyUomId!/> <#else> <#if !(invoiceItem.parentInvoiceId?? && invoiceItem.parentInvoiceItemSeqId??)> ${description!} <@ofbizCurrency amount=(Static["org.apache.ofbiz.accounting.invoice.InvoiceWorker"].getInvoiceItemTotal(invoiceItem)) isoCode=invoice.currencyUomId!/> <#-- blank line --> <#-- blank line --> <#-- the grand total --> ${uiLabelMap.AccountingTotalCapital} <@ofbizCurrency amount=invoiceTotal isoCode=invoice.currencyUomId!/> ${uiLabelMap.AccountingTotalExclTax} <@ofbizCurrency amount=invoiceNoTaxTotal isoCode=invoice.currencyUomId!/> <#if vatTaxIds?has_content> ${uiLabelMap.AccountingVat} ${uiLabelMap.AccountingAmount} <#list vatTaxIds as vatTaxId> <#assign taxRate = delegator.findOne("TaxAuthorityRateProduct", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("taxAuthorityRateSeqId", vatTaxId), true)/> ${taxRate.description} <@ofbizCurrency amount=vatTaxesByType[vatTaxId] isoCode=invoice.currencyUomId!/> <#-- a block with the invoice message--> <#if invoice.invoiceMessage?has_content>${invoice.invoiceMessage}