{% if Valid == false %}

Invalid Invoice: {{ErrorMsg}}

{% endif %} {{Seller.Company.Name}}
{% if Seller.Company.TradingName %} {{Seller.Company.TradingName}} {% endif %}

{{Seller.Company.Name}}
{% for entry in Seller.Address.AddrLines %} {{entry}}
{% endfor %} {% if Seller.Address.Country %} {{Seller.Address.Country}}
{% endif %}
{% if Seller.Address.Contact %}{{Seller.Address.Contact}}
{% endif %} {% if Seller.Address.Phone %}{{_phone}}: {{Seller.Address.Phone}}
{% endif %} {% if Seller.Address.Mail %}{{_mail}}: {{Seller.Address.Mail}}
{% endif %} {% if Seller.Company.Vat %}{{_vat}}: {{Seller.Company.Vat}}
{% endif %}

{% if HasReference %} {% endif %} {% if ProjectId != "" %} {% endif %} {% if ProjectName != "" %} {% endif %} {% if Contract != "" %} {% endif %} {% if PurchaseOrder != "" %} {% endif %} {% if SalesOrder != "" %} {% endif %}
{{InvoiceType}}: {{InvoiceId | escape_ext}}

{{_project}}: {{ProjectId | escape_ext}}
{{_project_name}}: {{ProjectName | escape_ext}}
{{_contract}}: {{Contract | escape_ext}}
{{_purchase_order}}: {{PurchaseOrder | escape_ext}}
{{_sales_order}}: {{SalesOrder | escape_ext}}

{% if Notes.List.size > 0 %} {% endif %}
{{_invoicing_address}} {{_shipping_address}} {{_invoice_data}}
{% if Buyer.Company.Name %}{{Buyer.Company.Name | escape_ext}}
{% endif %} {% if Buyer.Company.TradingName %}{{Buyer.Company.TradingName | escape_ext}}
{% endif %} {% if Buyer.Address.Contact %}{{Buyer.Address.Contact | escape_ext}}
{% endif %} {% for entry in Buyer.Address.AddrLines %} {{entry}}
{% endfor %} {% if Buyer.Address.Country %}{{Buyer.Address.Country}}
{% endif %} {% if Buyer.Company.Vat %}{{_vat}}: {{Buyer.Company.Vat}}
{% endif %}
{% if Buyer.ShipAddress.Name %}{{Buyer.ShipAddress.Name|escape_ext}}
{% endif %} {% if Buyer.ShipAddress.Contact %}{{Buyer.ShipAddress.Contact|escape_ext}}
{% endif %} {% for entry in Buyer.ShipAddress.AddrLines %} {{entry}}
{% endfor %} {% if Buyer.ShipAddress.Country %}{{Buyer.ShipAddress.Country|escape_ext}}
{% endif %}
{{_invoice_date}}: {{InvoiceDate | format_date:"d"}}
{% if DeliveryDate %}{{_delivery_date}}: {{DeliveryDate | format_date:"d"}}
{% endif %} {% if DueDate %}{{_due_date}}: {{DueDate | format_date:"d"}}
{% endif %} {% if Buyer.BuyerReference %}{{_buyer_ref}}: {{Buyer.BuyerReference|escape_ext}}
{% endif %}
{{_remarks}}:
{% for entry in Notes.List %} {{entry}}
{% endfor %}

{% if Actions['text'] %} {% endif %} {% if Actions['unit'] %} {% endif %} {% if HasItemsDiscount %} {% endif %} {% if HasMultipleVat %} {% endif %} {% if NeedsTaxCodesColumn %} {% endif %} {% for entry in Items %} {% if Actions['text'] %} {% endif %} {% if Actions['unit'] %} {% endif %} {% if HasItemsDiscount %} {% endif %} {% if HasMultipleVat %} {% endif %} {% if NeedsTaxCodesColumn %} {% endif %} {% endfor %}
{{_header_pos}} {{_header_description | escape_ext}}{{_header_details | escape_ext}}{{_header_amount}} {{_header_price}}{{_header_unit}}{{_header_discount}}{{_header_vat}}{{_header_net}} {{_header_vat_value}}{{_header_tax_code}}{{_header_gross}}
{{entry.Position | escape_ext}} {{entry.Description | escape_ext}}{{entry.Notes.Dict['text'] | escape_ext}}{{entry.Quantity}} {{entry.Price | format_number:"N2"}}{{Symbol}}{{entry.Notes.Dict['unit']}}{{entry.DiscountValue | format_number:"N2"}}{{Symbol}}{{entry.TaxPercent | format_number:"N0"}}%{{entry.NetAmount | format_number:"N2"}}{{Symbol}} {{entry.TaxValue | format_number:"N2"}}{{Symbol}}{{entry.TaxCategory}}{{entry.GrossAmount | format_number:"N2"}}{{Symbol}}
{% for entry in TaxEntries %} {% endfor %}
{{_net_sum}} {{NetAmountSum | format_number:"N2"}}{{Symbol}}
{{_header_vat}} ({{entry.TaxRate}}%) {{entry.TaxSum | format_number:"N2"}}{{Symbol}}

{{_gross_sum}} {{GrossAmountSum | format_number:"N2"}}{{Symbol}}
{{_paid_amount}} {{Payed | format_number:"N2"}}{{Symbol}}

{{_remaining_amount}} {{AmountToPay | format_number:"N2"}}{{Symbol}}
{% if HasTaxCodes or TermsDescription %}
{{_notes_and_comments}} {% if HasTaxCodes %} {% for taxData in TaxCodes %}
{{_tax_code}}: {{taxData.TaxCategory}}: {{taxData.TaxReason}}
{% endfor %} {% endif %} {% if TermsDescription %}
{{_terms_of_payment}}: {{TermsDescription | escape_ext}}
{% endif %}
{% endif %}