> For the complete documentation index, see [llms.txt](https://help.orderdesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.orderdesk.com/technical-documentation/templates-and-documents/vat-receipt-template.md).

# VAT Receipt Template

This is an example of a receipt template that creates VAT values from the available prices.

## Embedded code sample

```twig
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ store_name }} Receipt</title>
<link rel="stylesheet" href="{{ base_url }}/css/receipt.css">
<style type="text/css">
/* CUSTOM CSS HERE */


</style>
</head>

<body id="printpage">

{# Set Vat Rate (.2 for 20%) #}
{% set vat_rate = ".2" %}

{% for key, order in orders %}


{{ key > 0 ? '<div class="page-break"></div>' }}
<div class="main">

	{# This is a good place to put in a logo if you want - this page is not SSL so you can link to an image on your website like this: #}
	{# <img src="your_image_url" alt="{{ store_name|e }}"> #}
	<div class="header_logo">{{ store_name }}</div>

	<div class="wrapper">
		<div class="wrapper-table">
			<ul>
				<li class="invoice-title">Receipt</li>
				<li>&nbsp;</li>
				<li><b>Date:</b> {{ order.date_added|date_modify("+0 hours")|date(store_date_format, store_timezone) }}</li>
				<li><b>Order Number:</b> {{ order.source_id }}</li>
				<li><b>Email:</b> {{ order.email }}</li>
				{% if order.shipping.phone %}<li><b>Phone:</b> {{ order.shipping.phone }}</li>{% endif %}
				{% if order.shipping_method %}<li><b>Shipping:</b> {{ order.shipping_method }}</li>{% endif %}

				{# Checkout Data #}
				{% if order.checkout_data|length > 0 %}
					{% for key, val in order.checkout_data %}
					<li><b>{{ key }}:</b> {{ val }}</li>
					{% endfor %}
				{% endif %}
			</ul>
			<br>

			<table class="address_table" cellpadding="0" cellspacing="0" border="0">
				<tbody>
					<tr>
						<td>
							<b>Invoice Address:</b><br />
							{{ order.customer.first_name }} {{ order.customer.last_name }}<br>
							{% if order.customer.company %}{{ order.customer.company }}<br>{% endif %}
							{{ order.customer.address1 }}<br>
							{% if order.customer.address2 %}{{ order.customer.address2 }}<br>{% endif %}
							{{ order.customer.city }}, {{ order.customer.state }} {{ order.customer.postal_code }}<br>
							{{ order.customer.country != store_country ? order.customer.country }}<br>
						</td>
						<td>
							<b>Shipping Address:</b><br />
							{{ order.shipping.first_name }} {{ order.shipping.last_name }}<br>
							{% if order.shipping.company %}{{ order.shipping.company }}<br>{% endif %}
							{{ order.shipping.address1 }}<br>
							{% if order.shipping.address2 %}{{ order.shipping.address2 }}<br>{% endif %}
							{% if order.shipping.address3 %}{{ order.shipping.address3 }}<br>{% endif %}
							{% if order.shipping.address4 %}{{ order.shipping.address4 }}<br>{% endif %}
							{{ order.shipping.city }}, {{ order.shipping.state }} {{ order.shipping.postal_code }}<br>
							{{ order.shipping.country != store_country ? order.shipping.country }}<br>
						</td>
					</tr>
				</tbody>
			</table>

			{# Show Products #}
			<table class="product_table" cellpadding="5" cellspacing="5" border="0">
				<thead>
					<tr>
						<th class="product_header">Product</td>
						<th class="price_header" class="short_cell">Price</th>
						<th class="qty_header" class="short_cell">Qty</th>
						<th class="vat_header" class="short_cell">VAT</th>
						<th class="subtotal_header product_total_price_header" class="short_cell">Subtotal</th>
					</tr>
				</thead>
				<tbody>

				{# List of Items in Order #}
				{% for item in order.order_items %}
					<tr>
						<td>
							{{ item.name }}

							{# Checkout Data and Variations #}
							{% if item.variation_list|length > 0 %}
								<ul>
								{% for key, val in item.variation_list %}
									<li><b>{{ key }}:</b> {{ val }}</li>
								{% endfor %}
								</ul>
							{% endif %}
						</td>
						<td>{{ item.price|pre_vat(vat_rate)|money_format }}</td>
						<td>{{ item.quantity }}</td>
						<td>{{ (item.price|vat_amount(vat_rate) * item.quantity)|money_format }}</td>
						<td>{{ (item.quantity * item.price)|money_format }}</td>
					</tr>
				{% endfor %}

				{# Show Totals #}

				{% if order.shipping_total > 0 %}
				<tr>
					<td colspan="4" align="right"><b>Shipping:</b></td>
					<td>{{ order.shipping_total|money_format }}</td>
				</tr>
				{% endif %}

				<tr>
					<td colspan="4" align="right"><b>VAT:</b></td>
					<td>{{ order.order_total|vat_amount(vat_rate)|money_format }}</td>
				</tr>

				{% if order.tax_total > 0 %}
				<tr>
					<td colspan="4" align="right"><b>Tax:</b></td>
					<td>{{ order.tax_total|money_format }}</td>
				</tr>
				{% endif %}

				{% if order.discount_list|length > 0 %}
					{% for discount in order.discount_list %}
					<tr>
						<td colspan="4" align="right"><b>{{ discount.name|e }}:</b></td>
						<td>{{ discount.amount|money_format }}</td>
					</tr>
					{% endfor %}
				{% endif %}

				<tr>
					<td colspan="4" align="right"><b>Total:</b></td>
					<td>{{ order.order_total|money_format }}</td>
				</tr>

				</tbody>
			</table>
		</div>
	</div>

	{# Show a Nice Shadow Image at the Bottom of The Table #}
	<div class="shadowimg"><img src="{{ base_url }}/images/paper-shadow.png" width="505" height="8" alt="shadow" /></div>

	{# This is a nice place to put a thank-you message #}
	<p class="receipt_footer"></p>
</div>

{% endfor %}

</body>
</html>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.orderdesk.com/technical-documentation/templates-and-documents/vat-receipt-template.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
