{%- set fallback = app.request is not null ? app.request.locale : 'en' -%} {%- set language = model.template.language|default(fallback) -%} {%- set isDecimal = true -%} {%- set currency = model.currency -%} {%- set project = model.query.project -%} {% block title %}{{ model.invoiceNumber }}-{{ model.customer.company|default(model.customer.name)|u.snake }}{% endblock %}
{{ model.customer.company|default(model.customer.name) }}
{{ model.customer.address|nl2br }}
{% set classLeft = 'text-left' %} {% set classRight = 'text-right text-nowrap padding-left' %} {% if model.customer.number is not empty %} {% endif %} {% if project is not null and project.orderNumber is not empty %} {% endif %} {% if model.customer.vatId is not empty %} {% endif %}
{{ 'date'|trans }} {{ model.invoiceDate|date_short }}
{{ 'invoice.service_date'|trans }} {{ model.query.end|month_name }} {{ model.query.end|date('Y') }}
{{ 'invoice.number'|trans }} {{ model.invoiceNumber }}
{{ 'invoice.due_days'|trans }} {{ model.dueDate|date_short }}
{{ 'number'|trans }} {{ model.customer.number }}
{{ 'orderNumber'|trans }} {{ project.orderNumber }}
{{ 'vat_id'|trans }} {{ model.customer.vatId }}

{{ model.template.title }}

{% if model.customer.invoiceText is not empty%}

{{ model.customer.invoiceText|md2html }}

{% endif %} {% for entry in model.calculator.entries %} {% set duration = entry.duration|duration(isDecimal) %} {% if entry.fixedRate is not null %} {% set rate = entry.fixedRate %} {% set duration = entry.amount|amount %} {% else %} {% set rate = entry.hourlyRate %} {% endif %} {% endfor %} {% if model.calculator.tax > 0 or not model.isHideZeroTax() %} {% endif %}
{{ 'description'|trans }} {{ 'unit_price'|trans }} {{ 'amount'|trans }} {{ 'total_rate'|trans }}
{% if entry.description is not empty %} {{ entry.description|nl2br }} {% else %} {% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }} {% endif %} {{ rate|money(currency) }} {{ duration }} {{ entry.rate|money(currency) }}
{{ 'invoice.subtotal'|trans }} {{ model.calculator.subtotal|money(currency) }}
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%) {{ model.calculator.tax|money(currency) }}
{{ 'invoice.total'|trans }} {{ model.calculator.total|money(currency) }}
{% if model.template.paymentTerms is not empty %}

{{ model.template.paymentTerms|md2html }}

{% endif %}