{% include "karni_commerce/documents/_style.html" %}

{% if invoice %}Invoice{% else %}Order summary{% endif %}

{% if invoice %}
Number {{ invoice.reference }}
Issued {{ invoice.issued_at|date:"j F Y" }}
{% else %}
Not paid yet: the invoice is issued with the payment.
{% endif %}
Order {{ order.number }}, placed {{ order.created_at|date:"j F Y" }}
{{ seller.name|default:business }}{% if seller.trading_name and seller.trading_name != seller.name %} {{ seller.trading_name }}{% endif %} {{ seller.address }}{% if seller.phone %} {{ seller.phone }}{% endif %}{% if seller.email %} {{ seller.email }}{% endif %}{% if seller.tax_number %} Tax number {{ seller.tax_number }}{% endif %}

Billed to

{% with address=billing %}{% include "karni_commerce/documents/_address.html" %}{% endwith %}
{{ order.email }}
{% if order.needs_shipping %}

Sent to

{% with address=shipping %}{% include "karni_commerce/documents/_address.html" %}{% endwith %}
{% endif %}
{% if order.tax_total %}{% endif %} {% for line in lines %} {% if order.tax_total %}{% endif %} {% endfor %}
ItemQuantityPriceTaxAmount
{{ line.name }}{% if line.sku %}
{{ line.sku }}
{% endif %}{% for detail in line.details %}
{{ detail.label }}: {{ detail.value }}
{% endfor %}
{{ line.quantity }} {{ line.unit_price|floatformat:2 }}{{ line.tax_rate|floatformat:"-2" }}%{{ line.line_total|floatformat:2 }}
{% if order.discount_total %}{% endif %} {% if order.needs_shipping %}{% endif %} {% for tax in order.tax_lines %}{% endfor %} {% if order.amount_paid %}{% endif %} {% if order.amount_refunded %}{% endif %}
Items{{ order.subtotal|floatformat:2 }} {{ order.currency }}
Discount{% if order.coupon_code %} ({{ order.coupon_code }}){% endif %}-{{ order.discount_total|floatformat:2 }} {{ order.currency }}
Shipping{% if order.shipping_method %} ({{ order.shipping_method }}){% endif %}{{ order.shipping_total|floatformat:2 }} {{ order.currency }}
{{ tax.name }} {{ tax.rate|floatformat:"-2" }}%{% if order.prices_include_tax %} (included){% endif %}{{ tax.amount }} {{ order.currency }}
Total{{ order.total|floatformat:2 }} {{ order.currency }}
Paid{{ order.amount_paid|floatformat:2 }} {{ order.currency }}
Refunded-{{ order.amount_refunded|floatformat:2 }} {{ order.currency }}
{% if footer %}{% endif %}