<#-- This is a meta-template that is used to generate invoice templates. It supports the following settings: - showColumnDate - showColumnTime - showColumnCategory - showColumnQuantity - showColumnMeasure - showColumnPrice - showColumnTotal - showSubtotalProject - showSubtotalServices - showSubtotalExpenses - showSubtotalInvoice - showSubtotalTaxes - showItemDescription - showServiceDiscount - showServiceTime - groupServiceTimeByDate - showInvoiceNotes - showInvoiceDiscount - tableBorderColor - tableBackgroundColor - tableHeaderForegroundColor - tableHeaderBackgroundColor --> Invoice No. ${'$'}{invoice.number}

${i18n("invoice")}

<@showClient/>
<@showInvoiceDetails/>

<@showInvoiceHeader/> <@showInvoiceItemsByProject/> <#if showSubtotalInvoice> <@showInvoiceSubtotal/> <#if showSubtotalTax> <@showInvoiceTaxes/> <#if showSubtotalTaxes> <@showInvoiceTaxesSubtotal/> <#if showTotalInvoice> <@showInvoiceTotal/> <#if showInvoiceBalance> <@showInvoiceBalanceMacro/>
[#if invoice.taxable]
[/#if]
<#if showClientOpenInvoices> <@showOpenInvoices/>

Thank you for your business!


<#if showInvoiceNotes>

${'$'}{invoice.notes}

<#macro showOpenInvoices>

[#if client.openInvoices?size != 0]

Open invoices


${i18n("invoice.number")} ${i18n("invoice.date")} ${i18n("invoice.duedate")} ${i18n("invoice.age")} ${i18n("invoice.total")} Amount Paid Amount Due
[#list client.openInvoices?sort_by("ageInDays") as invoice]
${'$'}{invoice.number} ${'$'}{invoice.date?date?string.short} ${'$'}{invoice.dueDate?date?string.short} ${'$'}{invoice.ageInDays?string("#0")} days ${'$'}{invoice.grandTotal} ${'$'}{invoice.paymentsTotal} ${'$'}{invoice.balance}
[/#list]
Total ${'$'}{client.balance}

[/#if]

<#macro showInvoiceDetails> <#if showInvoicePurchaseOrder>
${i18n("invoice")} #:${'$'}{invoice.number}
${i18n("invoice.date")}:${'$'}{invoice.date?date}
${i18n("invoice.duedate")}:${'$'}{invoice.dueDate?date}
PO #:${'$'}{contract.reference}
<#macro showBusiness>

${'$'}{business.name}

${'$'}{business.address}

${'$'}{business.city}, ${'$'}{business.state} ${'$'}{business.zip}

${'$'}{business.phone}

${'$'}{business.email}

${'$'}{business.website}

<#if showBusinessNumber>

${'$'}{business.businessNumber}

<#if showBusinessTaxNumber>

${'$'}{business.taxNumber}

<#if showBusinessOtherNumber>

${'$'}{business.otherNumber}

<#macro showClient>

${'$'}{client.name}

${'$'}{client.attention}

${'$'}{client.address}

${'$'}{client.city}, ${'$'}{client.state} ${'$'}{client.zip}

${'$'}{client.phone}

${'$'}{client.email}

<#if showClientBusinessNumber>

${'$'}{client.businessNumber}

<#if showClientTaxNumber>

${'$'}{client.taxNumber}

<#if showClientOtherNumber>

${'$'}{client.otherNumber}

<#macro showBusinessLogoMacro>
<#macro showInvoiceBalanceMacro> <#if showColumnDate>

Total Due

<#else>

Total Due

<#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{invoice.balance}

<#macro showInvoiceTaxesSubtotal> <#if showColumnDate>

Taxes

<#else>

Taxes

<#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{invoice.taxesTotal}

<#macro showInvoiceTaxes> [#list invoice.taxes?sort_by("name") as tax] <#if showColumnDate>

${'$'}{tax.name} <#if showInvoiceTaxRate>${'$'}{tax.defaultRate}

<#else>

${'$'}{tax.name} <#if showInvoiceTaxRate>${'$'}{tax.defaultRate}

<#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{invoice.taxTotal(tax)}

[/#list] <#macro showInvoiceTotal> <#if showColumnDate>

Grand Total

<#else>

Grand Total

<#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{invoice.grandTotal}

<#macro showInvoiceHeader> <#if showColumnDate>

${i18n("item.date")}

${i18n("item.name")}

<#if showColumnCategory>

${i18n("item.category")}

<#if showColumnTime>

${i18n("item.time")}

<#if showColumnQuantity>

${i18n("item.quantity")}

<#if showColumnMeasure>

${i18n("item.unitofmeasure.short")}

<#if showColumnPrice>

${i18n("item.price")}

<#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax]

${'$'}{tax.name} <#if showItemTaxRate>${'$'}{tax.defaultRate}

[/#list] <#if showColumnTotal>

${i18n("item.total")}

<#macro showExpenses expenses>

${i18n("item.type.expenses")}

[#list ${expenses}?sort_by("date") as expense] <#if showColumnDate>

${'$'}{expense.date?date?string.short}

${'$'}{expense.name}

<#if showItemDescription>

${'$'}{expense.description}

<#if showColumnCategory>

${'$'}{expense.itemCategory!"-"}

<#if showColumnTime>

-

<#if showColumnQuantity>

${'$'}{expense.quantity}

<#if showColumnMeasure>

${'$'}{expense.unitOfMeasure}

<#if showColumnPrice>

${'$'}{expense.price}

<#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax]

${'$'}{invoice.taxTotal(tax, expense)}

[/#list] <#if showColumnTotal>

${'$'}{expense.total}

[/#list] <#macro showServices services>

${i18n("item.type.services")}

[#list ${services}?sort_by("date") as service] <#if showColumnDate>

${'$'}{service.date?date?string.short}

${'$'}{service.name}

<#if showItemDescription>

${'$'}{service.description}

<#if showColumnCategory>

${'$'}{service.itemCategory!"-"}

<#if showColumnTime>

${'$'}{service.billableTimeAsDecimal}

<#if showColumnQuantity>

${'$'}{service.quantity}

<#if showServiceDiscount>

[#if service.quantityDiscounted]

${'$'}{service.regularQuantity}

[/#if]

<#if showColumnMeasure>

${'$'}{service.unitOfMeasure}

<#if showColumnPrice>

${'$'}{service.price}

<#if showServiceDiscount>

[#if service.priceDiscounted]

${'$'}{service.regularPrice}

[/#if]

<#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax]

${'$'}{invoice.taxTotal(tax, service)}

[/#list] <#if showColumnTotal>

${'$'}{service.total}

<#if showServiceTime && showColumnTime> <#if groupServiceTimeByDate> <@showServiceTimeByDate service="service"/> <#else> <@showServiceTimeMacro service="service"/> [/#list] <#macro showServiceTimeMacro service> [#list ${service}.timeEntries?sort_by("date") as timeEntry] <#if showColumnDate>

${'$'}{timeEntry.description}

<#if showColumnCategory> <#if showColumnTime>

${'$'}{timeEntry.date?string("MMM dd")} - ${'$'}{timeEntry.elapsedTimeAsDecimal}

<#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes as tax] [/#list] <#if showColumnTotal> [/#list] <#macro showServiceTimeByDate service> [#list ${service}.timeEntriesByDate?sort_by("date") as timeEntry] <#if showColumnDate> <#if showColumnCategory> <#if showColumnTime>

${'$'}{timeEntry.date?string("MMM dd")} - ${'$'}{timeEntry.elapsedTimeAsDecimal}

<#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes as tax] [/#list] <#if showColumnTotal> [/#list] <#macro showInvoiceSubtotal> <#if showColumnDate>

Total

<#else>

Total

<#if showColumnCategory> <#if showColumnTime>

${'$'}{invoice.billableTimeAsDecimal}

<#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax]

${'$'}{invoice.taxTotal(tax)}

[/#list] <#if showColumnTotal>

${'$'}{invoice.total}

<#if showInvoiceDiscount>

[#if invoice.totalDiscounted]

${'$'}{invoice.regularTotal}

[/#if]

<#macro showInvoiceItemsByProject> [#list invoice.projects?sort_by("name") as project]

${'$'}{project.name}

[#if project.services?size != 0] <@showServices services="project.services"/> <#if showSubtotalServices> <#if showColumnDate> <#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{project.servicesSubtotal}

[/#if] [#if project.expenses?size != 0] <@showExpenses expenses="project.expenses"/> <#if showSubtotalExpenses> <#if showColumnDate> <#if showColumnCategory> <#if showColumnTime> <#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes?sort_by("name") as tax] [/#list] <#if showColumnTotal>

${'$'}{project.expensesSubtotal}

[/#if] <#if showSubtotalProject> [#if invoice.projects?size != 1] <#if showColumnDate> <#if showColumnCategory> <#if showColumnTime>

<#if showColumnTime>${'$'}{project.billableTimeAsDecimal}

<#if showColumnQuantity> <#if showColumnMeasure> <#if showColumnPrice> <#if showColumnTax> [#list invoice.taxes as tax] [/#list] <#if showColumnTotal>

${'$'}{project.total}

[/#if] [/#list]