#--
This is a meta-template that is used to generate invoice templates.
-->
${invoiceTitle} ${'$'}{invoice.number}
<#if showPageBackground>
#if>
${invoiceTitle}
<@showInvoiceHeader/>
<@showInvoiceItemsByProject/>
<#if showSubtotalInvoice>
<@showInvoiceSubtotal/>
#if>
[#if invoice.taxable] |
<#if showSubtotalTax>
<@showInvoiceTaxes/>
#if>
<#if showSubtotalTaxes>
<@showInvoiceTaxesSubtotal/>
#if>
<#if showTotalInvoice>
<@showInvoiceTotal/>
#if>
[/#if] |
<#if showSubtotalPayments>
<@showSubtotalPaymentsMacro/>
#if>
<#if showSubtotalPayment>
<@showSubtotalPaymentMacro/>
#if>
<#if showInvoiceBalance>
<@showInvoiceBalanceMacro/>
#if>
<#if showPaidStamp>
[#if invoice.paid]
[/#if]
#if>
<#if showClientStatement>
<@showClientStatementMacro/>
#if>
<#macro showClientStatementMacro>
[#if client.openInvoices?size != 0]
${clientStatementHeader}
<#if showClientStatementColumnNumber>
${clientStatementColumnNumber} |
#if>
<#if showClientStatementColumnDate>
${clientStatementColumnDate} |
#if>
<#if showClientStatementColumnDueDate>
${clientStatementColumnDueDate} |
#if>
<#if showClientStatementColumnAge>
${clientStatementColumnAge} |
#if>
<#if showClientStatementColumnGrandTotal>
${clientStatementColumnGrandTotal} |
#if>
<#if showClientStatementColumnPayments>
${clientStatementColumnPayments} |
#if>
<#if showClientStatementColumnBalance>
${clientStatementColumnBalance} |
#if>
[#list client.openInvoices?sort_by("ageInDays") as invoice] |
<#if showClientStatementColumnNumber>
${'$'}{invoice.number} |
#if>
<#if showClientStatementColumnDate>
${'$'}{invoice.date?date?string.short} |
#if>
<#if showClientStatementColumnDueDate>
${'$'}{invoice.dueDate?date?string.short} |
#if>
<#if showClientStatementColumnAge>
${'$'}{invoice.ageInDays?string("#0")} |
#if>
<#if showClientStatementColumnGrandTotal>
${'$'}{invoice.grandTotal} |
#if>
<#if showClientStatementColumnPayments>
${'$'}{invoice.paymentsTotal} |
#if>
<#if showClientStatementColumnBalance>
${'$'}{invoice.balance} |
#if>
[/#list] |
<#if showClientStatementColumnNumber>
|
#if>
<#if showClientStatementColumnDate>
|
#if>
<#if showClientStatementColumnDueDate>
|
#if>
<#if showClientStatementColumnAge>
|
#if>
<#if showClientStatementColumnGrandTotal>
|
#if>
<#if showClientStatementColumnPayments>
|
#if>
<#if showClientStatementColumnBalance>
${'$'}{client.balance} |
#if>
${clientStatementFooter}
[/#if]
#macro>
<#macro showSubtotalPaymentMacro>
[#list invoice.payments?sort_by("date") as payment] |
<#if showColumnDate>
${'$'}{payment.date?date?string.short} |
#if>
|
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{payment.amount}
|
#if>
[/#list] |
#macro>
<#macro showSubtotalPaymentsMacro>
${subtotalPaymentsName} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.paymentsTotal}
|
#if>
#macro>
<#macro showInvoiceBalanceMacro>
${invoiceBalanceName} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.balance}
|
#if>
#macro>
<#macro showInvoiceTaxesSubtotal>
${subtotalTaxesName} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.taxesTotal}
|
#if>
#macro>
<#macro showInvoiceTaxes>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{tax.name} <#if showInvoiceTaxRate>${'$'}{tax.defaultRate}#if> |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.taxTotal(tax)}
|
#if>
[/#list] |
#macro>
<#macro showInvoiceTotal>
${totalInvoiceName} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.grandTotal}
|
#if>
#macro>
<#macro showInvoiceHeader>
<#if showColumnDate>
${columnDate} |
#if>
${columnName} |
<#if showColumnCatalogItem>
${columnCatalogItem} |
#if>
<#if showColumnTime>
${columnTime} |
#if>
<#if showColumnQuantity>
${columnQuantity} |
#if>
<#if showColumnMeasure>
${columnMeasure} |
#if>
<#if showColumnPrice>
${columnPrice} |
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{tax.name} <#if showItemTaxRate>${'$'}{tax.defaultRate}#if> |
[/#list] |
#if>
<#if showColumnTotal>
${columnTotal} |
#if>
#macro>
<#macro showProducts products>
<#if showProductsHeader>
${productsHeaderName} |
#if>
[#list ${products}?sort_by("date") as product] |
<#if showColumnDate>
${'$'}{product.date?date?string.short} |
#if>
${'$'}{product.name}
<#if showItemDescription>
${'$'}{product.description}
#if>
|
<#if showColumnCatalogItem>
${'$'}{product.catalogItem!"-"} |
#if>
<#if showColumnTime>
- |
#if>
<#if showColumnQuantity>
${'$'}{product.quantity}
[#if product.quantityDiscounted]
${'$'}{product.regularQuantity}
[/#if]
|
#if>
<#if showColumnMeasure>
${'$'}{product.unitOfMeasure} |
#if>
<#if showColumnPrice>
${'$'}{product.price}
[#if product.priceDiscounted]
${'$'}{product.regularPrice}
[/#if]
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{invoice.taxTotal(tax, product)} |
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{product.total} |
#if>
[/#list] |
#macro>
<#macro showExpenses expenses>
<#if showExpensesHeader>
${expensesHeaderName} |
#if>
[#list ${expenses}?sort_by("date") as expense] |
<#if showColumnDate>
${'$'}{expense.date?date?string.short} |
#if>
${'$'}{expense.name}
<#if showItemDescription>
${'$'}{expense.description}
#if>
|
<#if showColumnCatalogItem>
${'$'}{expense.catalogItem!"-"} |
#if>
<#if showColumnTime>
- |
#if>
<#if showColumnQuantity>
${'$'}{expense.quantity} |
#if>
<#if showColumnMeasure>
${'$'}{expense.unitOfMeasure} |
#if>
<#if showColumnPrice>
${'$'}{expense.price} |
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{invoice.taxTotal(tax, expense)} |
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{expense.total} |
#if>
[/#list] |
#macro>
<#macro showServices services>
<#if showServicesHeader>
${servicesHeaderName} |
#if>
[#list ${services}?sort_by("date") as service] |
<#if showColumnDate>
${'$'}{service.date?date?string.short} |
#if>
${'$'}{service.name}
<#if showItemDescription>
${'$'}{service.description}
#if>
|
<#if showColumnCatalogItem>
${'$'}{service.catalogItem!"-"} |
#if>
<#if showColumnTime>
<#if useDecimalTimeFormat>${'$'}{service.billableTimeAsDecimal}<#else>${'$'}{service.billableTimeAsHour}#if> |
#if>
<#if showColumnQuantity>
${'$'}{service.quantity}
[#if service.quantityDiscounted]
${'$'}{service.regularQuantity}
[/#if]
|
#if>
<#if showColumnMeasure>
${'$'}{service.unitOfMeasure} |
#if>
<#if showColumnPrice>
${'$'}{service.price}
[#if service.priceDiscounted]
${'$'}{service.regularPrice}
[/#if]
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{invoice.taxTotal(tax, service)} |
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{service.total} |
#if>
<#if showServiceTime && showColumnTime>
<#if groupServiceTimeByDate>
<@showServiceTimeByDate service="service"/>
<#else>
<@showServiceTimeMacro service="service"/>
#if>
#if>
[/#list] |
#macro>
<#macro showServiceTimeMacro service>
[#list ${service}.timeEntries?sort_by("date") as timeEntry] |
<#if showColumnDate>
|
#if>
${'$'}{timeEntry.description} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
${'$'}{timeEntry.date?string("MMM dd")} - <#if useDecimalTimeFormat>${'$'}{timeEntry.elapsedTimeAsDecimal}<#else>${'$'}{timeEntry.elapsedTimeAsHour}#if> |
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
|
#if>
[/#list] |
#macro>
<#macro showServiceTimeByDate service>
[#list ${service}.timeEntriesByDate?sort_by("date") as timeEntry] |
<#if showColumnDate>
|
#if>
${'$'}{timeEntry.description} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
${'$'}{timeEntry.date?string("MMM dd")} - <#if useDecimalTimeFormat>${'$'}{timeEntry.elapsedTimeAsDecimal}<#else>${'$'}{timeEntry.elapsedTimeAsHour}#if> |
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
|
#if>
[/#list] |
#macro>
<#macro showInvoiceSubtotal>
${subtotalInvoiceName} |
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
<#if useDecimalTimeFormat>${'$'}{invoice.billableTimeAsDecimal}<#else>${'$'}{invoice.billableTimeAsHour}#if> |
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
${'$'}{invoice.taxTotal(tax)} |
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{invoice.total}
[#if invoice.totalDiscounted]
${'$'}{invoice.regularTotal}
[/#if]
|
#if>
#macro>
<#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>
|
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{project.servicesSubtotal} |
#if>
#if>
[/#if] |
[#if project.products?size != 0] |
<@showProducts products="project.products"/>
<#if showSubtotalProducts>
<#if showColumnDate>
|
#if>
|
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{project.productsSubtotal} |
#if>
#if>
[/#if] |
[#if project.expenses?size != 0] |
<@showExpenses expenses="project.expenses"/>
<#if showSubtotalExpenses>
<#if showColumnDate>
|
#if>
|
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
|
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes?sort_by("name") as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{project.expensesSubtotal} |
#if>
#if>
[/#if] |
<#if showSubtotalProject>
[#if invoice.projects?size != 1] |
<#if showColumnDate>
|
#if>
|
<#if showColumnCatalogItem>
|
#if>
<#if showColumnTime>
<#if useDecimalTimeFormat>${'$'}{project.billableTimeAsDecimal}<#else>${'$'}{project.billableTimeAsHour}#if> |
#if>
<#if showColumnQuantity>
|
#if>
<#if showColumnMeasure>
|
#if>
<#if showColumnPrice>
|
#if>
<#if showColumnTax>
[#list invoice.taxes as tax] |
|
[/#list] |
#if>
<#if showColumnTotal>
${'$'}{project.total} |
#if>
[/#if] |
#if>
[/#list] |
#macro>