<#-- 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 invoiceDetailList?has_content> <#list invoiceDetailList as invoiceDetail> <#assign invoice = invoiceDetail.invoice /> <#if invoiceDetail.billToParty?has_content> <#assign billToParty = invoiceDetail.billToParty /> <#assign partyName = delegator.findOne("PartyNameView", {"partyId" : billToParty.partyId}, true)> ${screens.render("component://order/widget/ordermgr/OrderPrintScreens.xml#CompanyLogo")} ${invoice.getRelatedOne("InvoiceType", false).get("description",locale)!} ${uiLabelMap.AccountingInvoiceDateAbbr}: ${invoiceDetail.invoiceDate!} ${uiLabelMap.AccountingCustNr}: <#if partyName?has_content>${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!} <#if invoiceDetail.billToPartyTaxId?has_content> ${uiLabelMap.PartyTaxId}: ${invoiceDetail.billToPartyTaxId} ${uiLabelMap.AccountingInvNr}: <#if invoice?has_content>${invoice.invoiceId} <#if invoice?has_content && invoice.description?has_content> ${uiLabelMap.AccountingDescr}: ${invoice.description} <#if billToParty?has_content> ${uiLabelMap.CommonTo}: <#if invoiceDetail.billingAddress?has_content> <#assign billingAddress = invoiceDetail.billingAddress /> <#assign billToPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("partyId", billToParty.partyId, "compareDate", invoice.invoiceDate, "userLogin", userLogin))/> ${billToPartyNameResult.fullName?default(billingAddress.toName)?default("Billing Name Not Found")} <#if billingAddress.attnName??> ${billingAddress.attnName} ${billingAddress.address1!} <#if billingAddress.address2??> ${billingAddress.address2} <#assign stateGeo = (delegator.findOne("Geo", {"geoId", billingAddress.stateProvinceGeoId!}, false))! /> ${billingAddress.city!} <#if stateGeo?has_content>${stateGeo.geoName!} ${billingAddress.postalCode!} <#else> ${uiLabelMap.AccountingNoGenBilAddressFound} <#if partyName?has_content>${partyName.firstName!} ${partyName.lastName!} ${partyName.groupName!} <#if invoiceDetail.orders?has_content> <#assign orders = invoiceDetail.orders! /> ${uiLabelMap.AccountingOrderNr}: <#list orders as order> ${order} <#if invoiceDetail.invoiceItems?has_content> <#assign invoiceItems = invoiceDetail.invoiceItems! /> ${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", false)> <#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> <#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} <#assign currentShipmentId = newShipmentId> ${invoiceItem.invoiceItemSeqId} ${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!/> <#-- the grand total --> ${uiLabelMap.AccountingTotalCapital} <#if invoiceDetail.invoiceTotal?has_content> <#assign invoiceTotal = invoiceDetail.invoiceTotal! /> <@ofbizCurrency amount=invoiceTotal isoCode=invoice.currencyUomId!/> ${uiLabelMap.AccountingTotalExclTax} <#if invoiceDetail.invoiceNoTaxTotal?has_content> <#assign invoiceNoTaxTotal = invoiceDetail.invoiceNoTaxTotal! /> <@ofbizCurrency amount=invoiceNoTaxTotal isoCode=invoice.currencyUomId!/>