{% extends 'invoice/layout.html.twig' %} {% block invoice %}
{{ 'invoice.from'|trans }}
{{ model.template.company }}
{{ model.template.address|trim|nl2br }}
{% set customerPhone = model.customer.phone|default(model.customer.mobile) %} {{ 'invoice.to'|trans }}
{{ model.customer.company|default(model.customer.name) }}
{{ model.customer.address|nl2br }} {% if model.customer.phone is not empty %}
{{ 'label.phone'|trans }}: {{ model.customer.phone }} {% endif %} {% if model.customer.email is not empty %}
{{ 'label.email'|trans }}: {{ model.customer.email }} {% endif %}

{{ 'invoice.number'|trans }}: {{ model.numberGenerator.invoiceNumber }}

{{ 'invoice.due_days'|trans }}: {{ model.dueDate|date_short }} {% if model.customer.number is not empty %}
{{ 'label.number'|trans }}: {{ model.customer.number }} {% endif %} {% if model.query.project is not empty and model.query.project.orderNumber is not empty %}
{{ 'label.orderNumber'|trans }}: {{ model.query.project.orderNumber }} {% endif %}

{% for entry in model.calculator.entries %} {% set duration = entry.duration|duration %} {% if entry.fixedRate %} {% set rate = entry.fixedRate %} {% set duration = entry.amount %} {% elseif entry.hourlyRate is not null %} {% set rate = entry.hourlyRate %} {% else %} {% set rate = app.user.getPreferenceValue('hourly_rate') %} {% endif %} {% endfor %}
{{ 'label.date'|trans }} {{ 'label.description'|trans }} {{ 'label.unit_price'|trans }} {{ 'label.hours'|trans }} {{ 'label.total_rate'|trans }}
{{ entry.begin|date_short }} {% if entry.description is not empty %} {{ entry.description|nl2br }} {% else %} {{ entry.activity.name }} / {{ entry.project.name }} {% endif %} {{ rate|money(model.calculator.currency) }} {{ duration }} {{ entry.rate|money(model.calculator.currency) }}
{% if model.template.paymentTerms is not empty %}

{{ 'label.payment_terms'|trans }}

{{ model.template.paymentTerms|trim|nl2br }}

{% endif %}

{{ 'invoice.due_days'|trans }} {{ model.dueDate|date_short }}

{{ 'invoice.subtotal'|trans }} {{ model.calculator.subtotal|money(model.calculator.currency) }}
{{ 'invoice.tax'|trans }} ({{ model.calculator.vat }}%) {{ model.calculator.tax|money(model.calculator.currency) }}
{{ 'invoice.total'|trans }} {{ model.calculator.total|money(model.calculator.currency) }}
{% endblock %}