{% set show_site_op_in_footer = False %} {% set show_printed_time = False %} {%- block bottomleft %}{%- endblock %} {%- block bottomright %}{%- endblock %} {%- extends "weasyprint/base.weasy.html" -%} {%- block pagesize %}portrait{%- endblock %} {%- block footer %} {% set site_op = settings.SITE.site_config.site_company %} {% if site_op %} {%- endif %} {%- endblock footer %} {%- block main %}

{{babelattr(obj.journal, 'printed_name')}}

{{_("Period from {} to {}").format(obj.invoicing_min_date, obj.invoicing_max_date)}}
{{_("Recipient")}}: {{obj.recipient}}
{{_("Date")}}: {{fdl(obj.voucher_date)}}
{{_("Our reference")}}: {{obj}} ({{obj.partner.id}}) {{language}}
{% if obj.intro %}
{% if obj.intro.startswith("<") %} {{obj.intro}} {% else %} {{restify(obj.intro)}} {% endif %}
{% else %}
{% endif %}
{% block body %} {%- set sums_by_product = SumCollector() -%} {%- set sums_by_ticket = SumCollector() -%} {%- set sums_by_ticket_product = SumCollector() -%} {%- for item in obj.items.order_by('seqno') -%} {{- sums_by_product.collect(item.product, item.qty) or '' -}} {{- sums_by_ticket.collect(item.invoiceable.ticket, item.qty) or '' -}} {{- sums_by_ticket_product.collect((item.invoiceable.ticket, item.product), item.qty) or '' -}} {%- endfor -%}
{{_("Description")}} {{_("Product")}} {{_("Quantity")}}

{%- if item.description -%} {{item.title}}

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

{{item.invoiceable.get_invoiceable_product()}} {{item.qty}}

{{_("Work by ticket")}}

{%- for product in sums_by_product.keys() -%} {%- endfor -%} {%- if len(sums_by_product) > 1 -%} {%- endif -%} {%- for ticket, qty in sums_by_ticket.items() -%} {%- for product in sums_by_product.keys() -%} {%- endfor -%} {%- if len(sums_by_product) > 1 -%} {%- endif -%} {%- endfor -%} {%- if len(sums_by_ticket) > 1 -%} {%- for product in sums_by_product.keys() -%} {%- endfor -%} {%- if len(sums_by_product) > 1 -%} {%- endif -%} {%- endif -%}
{{_("Ticket")}}{{product}}{{_("Total")}}
#{{ticket.id}} {{ticket.summary}}{{sums_by_ticket_product[ticket, product] or ""}}{{qty or ""}}
{{_("Total")}}{{sums_by_product[product] or ""}}{{sums_by_product.total() or ""}}

{{_("Total quantities")}}

{%- for product, qty in sums_by_product.items() -%} {%- endfor -%}
{{_("Product")}} {{_("Before")}} {{_("This report")}} {{_("After")}}
{{product}} ({{product.delivery_unit}}) {{obj.get_provision('purchased', product, True)}} {{qty}} {{obj.get_provision('purchased', product, False)}}
{%- endblock -%}
{% block payment %} {% endblock payment %}
{% block ending %} {% endblock ending %}
{%- endblock main %}