<html>
<meta charset="UTF-8"> 
<body style="margin-left: 50mm;">
This is a sales invoice.

<div>
{% block recipient %}
{{obj.partner.get_address_html()}}
{% endblock %}
</div>

<div>
{% block intro %}
<h2>{{obj}}</h2>


{{_("User")}}: {{this.user}}
<br>
{{_("Date")}}: {{fdl(obj.voucher_date)}}

{% endblock %}
</div>

<div>
{% block body %}
{% if False %}
{{as_table(rt.models.sales.ItemsByInvoicePrint.request(master_instance=obj))}}
{% else %}
<table border="1" width="100%">
<tr>
<td>{{_("Description")}}</td>
<td>{{_("Unit price")}}</td>
<td>{{_("Quantity")}}</td>
<td>{{_("Price")}}</td>
</tr>
{% for item in obj.items.order_by('seqno') %}
<tr>
<td>
{% if item.description %}
<p><b>{{item.title}}</b></p>
{% if item.description.startswith("<") %}
{{item.description}}
{% else %}
{{restify(item.description)}}
{% endif %}
{% else %}
<p>{{item.title}}</p>
{% endif %}
</td>
<td align="right">
{{item.unit_price or ''}}
</td>
<td align="right">
{% if item.unit_price %}
{{item.qty}}
{% endif %}
</td>
<td align="right">
{{item.total_incl or ''}}
</td>
</tr>
{% endfor %}
</table>
{% endif %}

{% endblock %}
</div>



<div>
{% block payment %}
<p class="Default">
{% if obj.due_date %}
{{_("Due date")}} : {{fds(obj.due_date)}}
<br/>
{% endif %}
{% if obj.payment_term %}
{{_("Payment terms")}} : {{obj.payment_term}}
{% endif %}
</p>
{% endblock %}
</div>

</body>
</html>
