{% import "macros/widgets.html.twig" as widgets %} {% extends 'export/layout.html.twig' %} {% block export %}

{{ 'export.document_title'|trans }}

{{ 'export.period'|trans }}: {{ query.begin|date_short }} - {{ query.end|date_short }}

{{ 'export.summary'|trans }}

{% set customer = null %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% set customerCurrency = null %} {% for summary in summaries %} {% if customer is same as(null) %} {% set customer = summary.customer %} {% set customerCurrency = summary.currency %} {% endif %} {% if customer is not same as(summary.customer) %} {% set customerCurrency = summary.currency %} {% set customer = summary.customer %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% endif %} {% set customerDuration = customerDuration + summary.duration %} {% set customerRate = customerRate + summary.rate %} {% endfor %} {% if customer is not same as(null) %} {% endif %}
{{ 'label.customer'|trans }} {{ 'label.project'|trans }} {{ 'label.duration'|trans }} {{ 'label.rate'|trans }}
{{ customerDuration|duration }} {{ customerRate|money(customerCurrency) }}
{{ summary.customer }} {{ summary.project }} {{ summary.duration|duration }} {{ summary.rate|money(summary.currency) }}
{{ customerDuration|duration }} {{ customerRate|money(customerCurrency) }}
{% set columns = [ 'label.date', 'label.begin', 'label.end', 'label.username', 'label.customer', 'label.project', 'label.activity', 'label.description', 'label.exported', 'label.hourly_rate', 'label.fixed_rate', 'label.duration', 'label.rate', ] %}

{{ 'export.full_list'|trans }}

{% for columnTitle in columns %} {% endfor %} {% set timeWorked = 0 %} {% set rateTotal = 0 %} {% set currency = false %} {% for entry in entries %} {% set timeWorked = timeWorked + entry.duration %} {% set rateTotal = rateTotal + entry.rate %} {% if currency is same as(false) %} {% set currency = entry.project.customer.currency %} {% endif %} {% if currency is not same as(entry.project.customer.currency) %} {% set currency = null %} {% endif %} {% endfor %}
{{ columnTitle|trans }}
{{ entry.begin|date_short }} {{ entry.begin|time }} {{ entry.end|time }} {{ widgets.username(entry.user) }} {{ entry.project.customer.name }} {{ entry.project.name }} {{ entry.activity.name }} {% if entry.description is not empty %} {{ entry.description|desc2html }} {% endif %} {% if entry.exported %} {{ 'entryState.exported'|trans }} {% else %} {{ 'entryState.not_exported'|trans }} {% endif %} {{ entry.hourlyRate|money(entry.project.customer.currency) }} {{ entry.fixedRate|money(entry.project.customer.currency) }} {{ entry.duration|duration }} {{ entry.rate|money(entry.project.customer.currency) }}
{{ timeWorked|duration }} {% if currency is not null and currency is not same as(false) %} {{ rateTotal|money(currency) }} {% else %} {{ rateTotal|money }} {% endif %}
{% endblock %}