{% set fallback = app.request is not null ? app.request.locale : 'en' %} {% set language = model.template.language|default(fallback) %} {% set isDecimal = model.template.decimalDuration|default(false) %} {% set currency = model.currency %} {% 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 model.query.project is not empty and model.query.project.orderNumber is not empty %} {% endif %} {% if model.customer.vatId is not empty %} {% endif %}
{{ 'label.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 }}
{{ 'label.number'|trans }} {{ model.customer.number }}
{{ 'label.orderNumber'|trans }} {{ model.query.project.orderNumber }}
{{ 'label.vat_id'|trans }} {{ model.customer.vatId }}

{{ model.template.title }}

{% 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 %}
{{ 'label.description'|trans }} {{ 'label.unit_price'|trans }} {{ 'label.amount'|trans }} {{ 'label.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 %}