A template used for creating invoices in PDF format.

Description

PDF printout templates are now PDF themes.

From now on, the HTML templates of PDF printouts are defined in PDF themes, which are separate from the store theme. PDF themes are installed in the store's themes/print folder.

Any PDF templates included in the store themes will continue to function. However, we recommend you to create a designated PDF theme out of the printouts as soon as possible.

Learn more about the update.

The invoice template is used only if one of MyCashflow's built-in payment services (Anticipated payment and Invoice) has been selected as the order payment method.

Invoices can be printed in the admin panel, in the Documents section of the order page. Additionally, you may also want to add the link to download the invoice to order email templates by using the {OrderDownloadInvoice} tag.

It is often useful to add information regarding previous payments to the invoice – especially if the order is invoiced in installments.

You can see the template's HTML output in the admin panel by defining the page's URL address in the following way:

/flow/kuitti.php?t=invoice&tilaus=ORDERNUMBER&pdf=false

The template's HTML file is converted intothe PDF format by using the Prince XML program, which has a robust CSS support and, to some extent, supports JavaScript as well.

To see instructions for designers, check the program's user guide.

Read more about formatting PDF printouts in MyCashflow.

Template properties

Template location
themes/print/THEME/invoice.html
Template URL
The printouts do not have a URL address.
Scope

Default theme implementation

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{%Invoice} {OrderNumber}</title>

<link rel="stylesheet" type="text/css" href="{ThemeUrl}/css/printables.css?date=20170803"/>

</head>

<body>

	<div id="ReceiptHeader">
		<div id="Logo">
			{Logo}
		</div>
		<div id="ReceiptTitle">
			<h4>{ShopName}</h4>
			<h1>{%Invoice} {OrderNumber}</h1>
		</div>
	</div>

	<div id="InfoWrapper">
		<div id="ShippingAddress">
			{OrderShippingCompany(after:'<br/>')}
			{OrderShippingName(after:'<br/>')}
			{OrderShippingAddress(after:'<br/>')}
			{OrderShippingZip}
			{OrderShippingCity(after:'<br/>')}
			{OrderShippingCountry(after:'<br/>')}
			{OrderShippingEmail(after:'<br/>')}
			{OrderShippingPhone}
		</div>
		<div id="OrderInfo">
			<dl>
				<dt>{%CheckoutCustomerInformation}</dt>
				<dd>{OrderCustomerInformation}</dd>
			</dl>
			{OrderInfo}
		</div>
	</div>

	{OrderProducts(
		before: '
			<div id="PrintProducts">
				<table>
					<thead>
						<tr>
							<th scope="col" class="CartProduct">{%Product}</th>
							<th scope="col">{%ShippingDate}</th>
							<th scope="col">{%Quantity}</th>
							<th scope="col">{%Price}</th>
							<th scope="col" class="CartTotal">{%Total}</th>
						</tr>
					</thead>
		',
		helper: '{{
			<tr>
				<th class="CartProduct">
					<h3>
						{OrderProductName}
						{OrderProductVariation(before: ' <br/><em class="ProductVariation">',after:'</em>')}
						{OrderProductDownloadLink(before: ' <br/><span style="font-weight: normal;">{%ProductDownload}: </span><strong class="ProductDownloadLink">',after:'</strong>')}
					</h3>
					{OrderProductCode(
						before: '<dl><dt>{%ProductCode}</dt><dd>',
						after: '</dd></dl>'
					)}
					{OrderProductWarranty(
						before: '<dl><dt>{%Warranty}</dt><dd>',
						after: '&nbsp;{%Months}</dd></dl>'
					)}
					{OrderProductChoices}
				</th>
				<td>{OrderProductShippingStatus}</td>
				<td>{OrderProductQuantity}</td>
				<td>
					{OrderProductPrice(
						after: '<br><small>{%VAT}&nbsp;{OrderProductTaxRate(after:'%')}</small>',
						before: '{OrderProductComparePrice(before: '<span style="color: #888; text-decoration: line-through;">', after: '</span>')}&ensp;'
					)}
				</td>
				<td class="CartTotal">
					{OrderProductTotal(
						after: '<br><small>{OrderProductTotalTax}</small>'
					)}
				</td>
			</tr>
		}}',
		after: '
					<tfoot>
						<tr class="CartTotal">
							<th scope="row" colspan="4">{%CheckoutProductsTotal} <br><small>{%VAT}</small></th>
							<td class="CartTotal">
								{OrderSubTotal}<br>
								<small>{OrderSubtotalTax}</small>
							</td>
						</tr>
						{OrderShippingCosts(
							before: '<tr class="CartTotal"><th scope="row" colspan="4">{%ShippingCosts}: {OrderShippingMethod}<br><small>{%VAT}&nbsp;{OrderShippingCostsTaxRate(after:'%')}</small></th><td class="CartTotal">',
							after: '<br><small>{OrderShippingCostsTax}</small></td></tr>'
						)}
						{OrderPaymentCosts(
							before: '<tr class="CartTotal"><th scope="row" colspan="4">{%PaymentCosts}: {OrderPaymentMethod}<br><small>{%VAT}&nbsp;{OrderPaymentCostsTaxRate(after:'%')}</small></th><td class="CartTotal">',
							after: '<br><small>{OrderPaymentCostsTax}</small></td></tr>'
						)}
						<tr class="CartTotal" id="FullTotal">
							<th scope="row" colspan="4">{%Total} <br><small>{%VAT}</small></th>
							<td class="CartTotal">
								{OrderTotal}<br>
								<small>{OrderTax}</small>
							</td>
						</tr>
					</tfoot>
				</table>
			</div>
		'
	)}

	<div id="VatInfo">
		{OrderTotalsByTaxRate}
		{OrderVATDescription}
	</div>

	<table id="PaymentDetails">
		<tr>
			<td width="10%">{%InvoiceRecipientAccountNumber}</td>
			<td width="30%">{ContactBankAccount}</td>
			<td width="60%" colspan="3" rowspan="3" id="OrderPaymentTransactions">
				<h4>{%InvoiceBankTransfer}</h4>
				<p>{%InvoicePaymentReferenceInfo}</p>

				<h4>{%OrderPaymentTransactions}</h4>
				{OrderPaymentTransactions}
			</td>
		</tr>
		<tr>
			<td width="10%">{%InvoiceRecipientName}</td>
			<td width="30%">{ContactCompany}</td>
		</tr>
		<tr>
			<td rowspan="3">{%InvoicePayer}</td>
			<td rowspan="3">{OrderCustomerInformation}</td>
		</tr>
		<tr>
			<td width="10%">{%PaymentReference}</td>
			<td width="50%" colspan="2">{OrderPaymentReference}</td>
		</tr>
		<tr>
			<td width="10%">{%InvoiceDueDate}</td>
			<td width="25%">{OrderDueDate(expiry:'14')}</td>
			<td width="25%" id="OrderOpenTotal">{OrderOpenTotal}</td>
		</tr>
	</table>

	<div id="ReceiptContact">
		<p id="PrintContactAddress">
			{ContactCompany}
			{ContactBusinessID(
				before: ' (',
				after: ')'
			)}
			<br>
			{ContactStreetAddress1(
				after: '
					{ContactStreetAddress2(
						before: ',&nbsp;'
					)}
				'
			)}
			<br>
			{ContactZip} {ContactCity(after:',&nbsp;')} {ContactCountry}
		</p>
		<p id="PrintContactElectrical">
			{ContactEmail(after:'<br>')}
			{ContactInternet(after:'<br>')}
			{ContactPhone(after:'<br>')}
		</p>
		<div id="PrintBanner">
			{Banners(
				name: 'print',
				sort: 'random',
				limit: 1,
				helper: '{{
					{BannerText}
				}}'
			)}
		</div>
	</div>

</body>
</html>