{% set showUserColumn = true %} {% set showRateColumn = true %} {% if query.user %} {# this is only triggered, if a user exports from his personal timesheet screen#} {% set showUserColumn = false %} {% set showRateColumn = is_granted('view_rate_own_timesheet') %} {# TODO if exporting via the admin screen, users without view_rate_own_timesheet might still see their own rates, maybe merge view_rate_own_timesheet and view_rate_other_timesheet into a new view_rate permission? #} {% endif %}

{{ 'export.document_title'|trans }}

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

{{ 'export.summary'|trans }}

{% if showRateColumn %} {% endif %} {% set customer = null %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% set customerCurrency = null %} {% set customerCount = 0 %} {% 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) %} {% if showRateColumn %} {% endif %} {% set customerCurrency = summary.currency %} {% set customer = summary.customer %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% set customerCount = 0 %} {% endif %} {% if showRateColumn %} {% endif %} {% set customerDuration = customerDuration + summary.duration %} {% set customerRate = customerRate + summary.rate %} {% set customerCount = customerCount + 1 %} {% endfor %} {% if customer is not same as(null) %} {% if showRateColumn %} {% endif %} {% 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) }}

{{ 'export.full_list'|trans }}

{% set duration = 0 %} {% set rate = 0 %} {% set currency = false %} {% if showUserColumn %} {% endif %} {% if showRateColumn %} {% endif %} {% for entry in entries %} {% set duration = duration + entry.duration %} {% 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 %} {% if showUserColumn %} {% endif %} {% if showRateColumn %} {% endif %} {% endfor %} {% if showUserColumn %} {% else %} {% endif %} {% if showRateColumn %} {% endif %}
{{ 'label.date'|trans }}{{ 'label.user'|trans }}{{ 'label.description'|trans }} {{ 'label.duration'|trans }}{{ 'label.rate'|trans }}
{{ entry.begin|date_time }} {% if entry.end %}
{{ entry.end|date_time }} {% endif %}
{{ entry.user.displayName }} {{ entry.project.customer.name }} - {{ entry.project.name }}{% if entry.activity is not null %} - {{ entry.activity.name }}{% endif %} {% if entry.description is not empty %}
{{ entry.description|escape|desc2html }} {% endif %}
{{ entry.duration|duration }} {% if is_granted('view_rate', entry) %} {% set rate = rate + entry.rate %} {{ entry.rate|money(entry.project.customer.currency) }} {% else %} – {% endif %}
{{ duration|duration }}{% if currency is not null %}{{ rate|money(currency) }}{% endif %}