{% set show_site_op_in_footer = False %} {% set show_printed_time = False %} {%- extends "weasyprint/base.weasy.html" -%} {%- block pagesize %}portrait{%- endblock %} {% set site_op = settings.SITE.plugins.contacts.site_owner %} {% if site_op %} {%- block bottomleft %} @bottom-left { vertical-align: top; content: {% for ln in site_op.get_address_lines() %} '{{ln}}, ' {% endfor %} {#{site_op.get_address_html(sep=', ')}#} '{{tostring(site_op.contact_details)}}'; } {%- endblock bottomleft %} {%- block bottomright %} @bottom-right { vertical-align: top; white-space: pre; content: '{{babelattr(obj.journal, 'printed_name')}} ' '{{obj.number}}/{{obj.accounting_period.year}}\A' '{{_("Page")}} ' counter(page) ' {{_("of {0}").format("")}} ' counter(pages) {%- if show_printed_time -%} '\A{{_("Printed")}} {{fdm(dd.today())}} {{_("at")}} {{now.time().strftime("%H:%M")}}' {%- endif %}; } {%- endblock bottomright %} {%- endif %} {%- block main %}
{{_("Recipient")}}:
{{obj.recipient.get_address_html()}}

{{_("Date")}}: {{fdl(obj.voucher_date)}}

{{babelattr(obj.journal, 'printed_name')}} {{obj.number}}/{{obj.accounting_period.year}}

{{_("Our reference")}}: {{obj}}
{{_("Your reference")}}: {{obj.your_ref}} {% if getattr(obj, 'invoicing_min_date', None) %}
{{_("Period from {} to {}").format(obj.invoicing_min_date, obj.invoicing_max_date)}} {% endif %}
{{_("Your VAT id")}}: {{obj.partner.vat_id or _("N/A")}}
{{_("Your customer id")}}: {{obj.partner.id}} {% if false and obj.partner.vat_id %} {% set xmlfile, url = obj.make_xml_file(ar) %}
{{_("e-invoice")}}: {url} {% endif %}
{% if obj.intro %}
{% if obj.intro.startswith("<") %} {{obj.intro}} {% else %} {{restify(obj.intro)}} {% endif %}
{% else %}
{% endif %} {% block body %} {% set colnames = obj.get_columns_to_print() %} {# {% if not obj.report_assets() and 'asset' in colnames %} {% do colnames.remove('asset') %} {% endif %} #} {% macro cell(item, colname) %} {% if colname == "title" %} {% if item.description %}

{{str(item.title or item.product)}}

{% if item.description.startswith("<") %} {{item.description}} {% else %} {{restify(item.description)}} {% endif %} {% else %}

{{str(item.title or item.product)}}

{% endif %} {% elif colname == "product" %} {{item.product or ""}} {% elif colname == "invoiceable" %} {{item.invoiceable or ""}} {% elif colname == "unit_price" %} {{decfmt(item.unit_price)}} {% elif colname == "qty" %} {% if item.unit_price %} {{decfmt(item.qty)}} {% endif %} {% elif colname == "amount" %} {{decfmt(item.amount)}} {% elif colname == "discount_rate" %} {% if item.discount_rate %} {{decfmt(item.discount_rate)}}% {% endif %} {% elif colname == "total_incl" %} {{decfmt(item.total_incl)}} {% elif colname == "total_base" %} {{decfmt(item.total_base)}} {% else %} {{colname}} {% endif %} {% endmacro %}
{% for colname in colnames %} {##} {% endfor %} {% for item in obj.items.order_by('seqno') %} {% if item.product.subtotal %} {% else %} {% endif %} {% for colname in colnames %} {{ cell(item, colname) }} {% endfor %} {% endfor %}
{{obj.get_column_heading(colname)}}{{getattr(rt.models.trading.InvoiceItem, colname).field.verbose_name}}
{% endblock %}
{% if len(obj.vat_subtotals) > 1 %}
{% for cat, rule, total_base, total_vat in obj.vat_subtotals if total_vat or total_base %} {% endfor %}
{{_("VAT category")}} {{_("Total excl. VAT")}} {{_("VAT")}} {{_("Total incl. VAT")}}
{{cat}} ({{"{:.0%}".format(rule.rate)}}) {{decfmt(total_base)}} {{decfmt(total_vat)}} {{decfmt(total_base+total_vat)}}
{{_("Totals")}} {{decfmt(obj.total_base)}} {{decfmt(obj.total_vat)}} {{decfmt(obj.total_incl)}}
{% else %}
{{_("Total excl. VAT")}}{{decfmt(obj.total_base)}}
{{_("VAT")}}{{decfmt(obj.total_vat)}}
{{_("Total incl. VAT")}}{{decfmt(obj.total_incl)}}
{% endif %}
{% block payment %}

{% if obj.due_date %} {{_("Due date")}} : {{fds(obj.due_date)}}
{% endif %} {% if obj.payment_term %} {{_("Payment terms")}} : {{obj.payment_term}} {% endif %}

{% endblock payment %}
{% block ending %} {% if False %}

{{_("With best regards.")}}


{{this.user}}

{% if show_site_op_in_footer %}

{% set site_op = settings.SITE.plugins.contacts.site_owner %} {% for ln in site_op.get_address_lines() %} {{ln}}, {% endfor %} {#{site_op.get_address_html(sep=', ')}#} {{tostring(site_op.contact_details)}}

{% endif %} {% endif %} {% endblock ending %}
{%- endblock main %}