{% set showUserColumn = showUserColumn ?? true %} {% set showInternalRate = showInternalRate ?? false %} {% set showRateColumn = showRateColumn ?? is_granted('view_rate_other_timesheet') %} {% set showRateBudget = showRateBudget ?? false %} {% set showTimeBudget = showTimeBudget ?? false %} {% set showTotalSummary = showTotalSummary ?? true %} {% set now = create_date('now', app.user) %} {% set decimal = decimal ?? false %} {# this is only triggered, if a user exports from his personal timesheet screen #} {% if query.user is not null %} {% set showUserColumn = false %} {# if exporting via the admin screen, users without view_rate_own_timesheet might still see their own rates #} {% set showRateColumn = is_granted('view_rate_own_timesheet') %} {% endif %} {% block styles %} {% endblock %} {% block pdf_footer %} {% endblock %} {% block summary %}

{{ 'export.document_title'|trans }}

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

{{ 'export.summary'|trans }}

{% if showTimeBudget %} {% endif %} {% if showRateBudget %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %} {% set customer = null %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% set customerInternalRate = 0 %} {% set customerCurrency = null %} {% set customerCount = 0 %} {% set multiCurrency = false %} {% set totalDuration = 0 %} {% set totalInternalRate = 0 %} {% set totalRate = 0 %} {% for id, summary in summaries %} {% set totalDuration = totalDuration + summary.duration %} {% set totalInternalRate = totalInternalRate + summary.rate_internal %} {% set totalRate = totalRate + summary.rate %} {% if customerCurrency is not null and customerCurrency is not same as(summary.currency) %} {% set multiCurrency = true %} {% endif %} {% if customer is same as(null) %} {% set customer = summary.customer %} {% set customerCurrency = summary.currency %} {% endif %} {% if customer is not same as(summary.customer) %} {% if showTimeBudget %} {% endif %} {% if showRateBudget %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %} {% set customerCurrency = summary.currency %} {% set customer = summary.customer %} {% set customerDuration = 0 %} {% set customerRate = 0 %} {% set customerInternalRate = 0 %} {% set customerCount = 0 %} {% endif %} {% if showTimeBudget %} {% endif %} {% if showRateBudget %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %} {% set customerDuration = customerDuration + summary.duration %} {% set customerRate = customerRate + summary.rate %} {% set customerInternalRate = customerInternalRate + summary.rate_internal %} {% set customerCount = customerCount + 1 %} {% endfor %} {% if customer is not same as(null) %} {% if showTimeBudget %} {% endif %} {% if showRateBudget %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %} {% endif %} {% if showTotalSummary and not multiCurrency %} {% if showTimeBudget %} {% endif %} {% if showRateBudget %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %} {% endif %}
{{ 'label.customer'|trans }} {{ 'label.project'|trans }}{{ 'label.timeBudget'|trans }}{{ 'label.budget'|trans }}{{ 'label.duration'|trans }}{{ 'label.rate_internal'|trans }}{{ 'label.rate'|trans }}
{{ customerDuration|duration(decimal) }}{{ customerInternalRate|money(customerCurrency) }}{{ customerRate|money(customerCurrency) }}
{{ summary.customer }} {{ summary.project }} {% if budgets[id] is defined and budgets[id].time_left > 0 %} {{ budgets[id].time_left|duration(decimal) }} {% endif %} {% if budgets[id] is defined and budgets[id].money_left > 0 %} {{ budgets[id].money_left|money(summary.currency) }} {% endif %} {{ summary.duration|duration(decimal) }}{{ summary.rate_internal|money(summary.currency) }}{{ summary.rate|money(summary.currency) }}
{{ customerDuration|duration(decimal) }}{{ customerInternalRate|money(customerCurrency) }}{{ customerRate|money(customerCurrency) }}
{{ 'sum.total'|trans }} {{ totalDuration|duration(decimal) }}{{ totalInternalRate|money(customerCurrency) }}{{ totalRate|money(customerCurrency) }}
{% endblock %} {% block items %}

{{ 'export.full_list'|trans }}

{% set duration = 0 %} {% set rate = 0 %} {% set rateInternal = 0 %} {% set currency = false %} {% if showUserColumn %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% 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 %} {# no check for is_granted('view_rate', entry) because it is only available for timesheets, but maybe missing for other potential export repositories #} {% set rate = rate + entry.rate %} {% set rateInternal = rateInternal + entry.internalRate %} {% set entryRate = entry.rate|money(entry.project.customer.currency) %} {% set entryRateInternal = entry.internalRate|money(entry.project.customer.currency) %} {% if showInternalRate %} {% endif %} {% endif %} {% endfor %} {% if showUserColumn %} {% else %} {% endif %} {% if showRateColumn %} {% if showInternalRate %} {% endif %} {% endif %}
{{ 'label.date'|trans }}{{ 'label.user'|trans }}{{ 'label.description'|trans }} {{ 'label.duration'|trans }}{{ 'label.rate_internal'|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|desc2html }} {% endif %}
{{ entry.duration|duration(decimal) }}{{ entryRateInternal }}{{ entryRate }}
{{ duration|duration(decimal) }}{% if currency is not null %}{{ rateInternal|money(currency) }}{% endif %}{% if currency is not null %}{{ rate|money(currency) }}{% endif %}
{% endblock %}