<#-- 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. --> <#-- Generates PDF of multiple checks in two styles: one check per page, multiple checks per page Note that this must be customized to fit specific check layouts. The layout here is copied by hand from a real template using a ruler. --> <#escape x as x?xml> <#-- define the margins of the check layout here --> ${uiLabelMap.FormFieldTitle_invoiceId}: ${parameters.invoiceId!} ${uiLabelMap.CommonDescription}: ${invoiceDescription!} ${uiLabelMap.CommonStatus}: ${statusDescription!} ${uiLabelMap.AccountingReferenceNumber}: ${referenceNumber!} ${uiLabelMap.CommonUsername}: ${userLoginName!} ${uiLabelMap.CommonDate}: ${invoiceDate?string("dd MMMMM yyyy")} ${uiLabelMap.CommonPartyId}: ${partyId!} ${uiLabelMap.AccountingPartyName}: ${partyName!} ${uiLabelMap.FormFieldTitle_accountCode} ${uiLabelMap.FormFieldTitle_accountName} ${uiLabelMap.AccountingOriginalCurrency} ${uiLabelMap.AccountingExchangeRate} ${uiLabelMap.AccountingDebitFlag} ${uiLabelMap.AccountingCreditFlag} <#assign debitTotal = 0/> <#assign creditTotal = 0/> <#list invoiceAcctgTransAndEntries as invoiceAcctgTransAndEntry> ${invoiceAcctgTransAndEntry.accountCode!} ${invoiceAcctgTransAndEntry.accountName!} ${invoiceAcctgTransAndEntry.origCurrencyUomId!} ${invoiceAcctgTransAndEntry.origAmount!}/${invoiceAcctgTransAndEntry.amount!} ${invoiceAcctgTransAndEntry.origCurrencyUomId!}/${invoiceAcctgTransAndEntry.currencyUomId!} <#if "D"==invoiceAcctgTransAndEntry.debitCreditFlag> <#assign debitTotal = debitTotal +invoiceAcctgTransAndEntry.amount> ${invoiceAcctgTransAndEntry.amount!} <#if "C"==invoiceAcctgTransAndEntry.debitCreditFlag> <#assign creditTotal = creditTotal +invoiceAcctgTransAndEntry.amount> ${invoiceAcctgTransAndEntry.amount!} <#if debitTotal == creditTotal> <#assign baseCurrencyUomId = (delegator.findOne("PartyAcctgPreference", {"partyId" : partyId}, true))!> <#if baseCurrencyUomId?has_content && "THB" == baseCurrencyUomId.baseCurrencyUomId> <#assign rule = "%bahts-and-stangs"> <#assign locale = Static["org.apache.ofbiz.base.util.UtilMisc"].parseLocale("th")!/> <#else> <#assign rule = "%dollars-and-cents"> <#assign locale = Static["org.apache.ofbiz.base.util.UtilMisc"].parseLocale("en_us")!/> <#assign amount = Static["org.apache.ofbiz.base.util.UtilNumber"].formatRuleBasedAmount(debitTotal, rule, locale).toUpperCase()> ${uiLabelMap.AccountingTotalCapital} : ${amount!} <#else> ${uiLabelMap.AccountingDebitNotEqualCredit} ${debitTotal!} ${creditTotal!} ${uiLabelMap.AccountingPreparedBy} ${uiLabelMap.AccountingApprovedBy} ${uiLabelMap.AccountingReceivedBy} ${uiLabelMap.CommonDate} ${uiLabelMap.CommonDate} ${uiLabelMap.CommonDate}