Sales Report

Client summary by year


[#if salesreport.dateIntervalStart??] [#if salesreport.dateIntervalEnd??] Date: ${salesreport.dateIntervalStart?date} - ${salesreport.dateIntervalEnd?date} [#else] Date: After ${salesreport.dateIntervalStart?date} [/#if] [#else] [#if salesreport.dateIntervalEnd??] Date: Before ${salesreport.dateIntervalEnd?date} [#else] Date: All dates [/#if] [/#if]

[#assign allInvoices=salesreport.invoices]

[#assign years=salesreport.groupDatesByYear(allInvoices)]

[#assign clients=salesreport.groupClients(allInvoices)]

Client

[#list years?sort as year]

${year}

[/#list]

Total

[#list clients?sort as client]

${client.name}[#assign clientInvoices=salesreport.filterByClient(allInvoices, client)]

[#list years?sort as year]

[#assign clientYearInvoices=salesreport.filterByDate(clientInvoices, year.toInterval())]${salesreport.calculateTotal(clientYearInvoices)}

[/#list]

${salesreport.calculateTotal(clientInvoices)}

[/#list]

Total

[#list years?sort as year]

[#assign yearInvoices=salesreport.filterByDate(allInvoices, year.toInterval())]${salesreport.calculateTotal(yearInvoices)}

[/#list]

${salesreport.calculateTotal(allInvoices)}