5.7. Example: A Basic Template

Below is a basic template for single project invoices. It displays the invoice items but not its expenses. At the end of the template, the invoice total is displayed. The template doesn't handle taxes, tax totals or discounts.

<html>
<head>
	<title>Invoice: ${invoice.number}</title>
</head>
<body>
	<!-- 1. This section describes your business -->
	<div id="business">
		<p><strong>${business.name}</strong></p>
		<p>${business.address}</p>
		<p>${business.city}, ${business.state} ${business.zip}, ${business.country}</p>
		<p>${business.phone}</p>
		<p><a href="mailto:${business.email}">${business.email}</a></p>
	</div>
	
	<!-- 2. This section describes the invoice -->
	<h1>Invoice</h1>
	
	<div id="invoice">
		<p><strong>Date:</strong> ${invoice.date?date}</p>
		<p><strong>Number:</strong> ${invoice.number}</p>
	</div>
	
	<!-- 3. This section describes the client -->
	<p><strong>Bill to:</strong></p>
	<div id="client">
		<p>${client.name}</p>
		<p>${client.address}</p>
		<p>${client.city}, ${client.state} ${client.zip}, ${client.country}</p>
	</div>
	
	<!-- 4. This section describes the invoice contents -->
	<div id="invoiceContents">
		<table>
			<!-- Invoice header -->
			<tr>
				<th class="text">Name</th>
				<th class="quantity">Quantity</th>
				<th class="money">Price</th>
				<th class="money">Amount</th>
			</tr>
			
			<!-- Invoice items -->
			<#list invoice.items as item>
			<tr>
				<td class="text">${item.name}</td>
				<td class="quantity">${item.units}</td>
				<td class="money">${item.rate}</td>
				<td class="money">${item.amount}</td>
			</tr>
			</#list>
		</table>
	</div>
	
	<!-- 5. This section displays the invoice total -->
	<div id="totals">
		<table>
			<tr>
				<td class="total">Total:</td>
				<td class="money">${invoice.total}</td>
			</tr>
		</table>
	</div>
	
	<p align="center">Payment should be made within ${invoice.dueDays}.</p>
	<p align="center">Thank you for your business!</p>
</body>
</html>