{% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% extends 'export/layout.html.twig' %} {% block document_title %}{{ 'export.title'|trans }}{% endblock %} {% set showRateBudget = false %} {% set showTimeBudget = false %} {% for budget in budgets %} {% if budget.money_left > 0 %} {% set showRateBudget = true %} {% endif %} {% if budget.time_left > 0 %} {% set showTimeBudget = true %} {% endif %} {% endfor %} {% set decimal = decimal|default(false) %} {% set columnTitles = {} %} {% set columns = { 'date': true, 'username': false, 'customer': true, 'project': true, 'activity': true, 'description': false, 'exported': false, 'tags': false, } %} {% for id, field in timesheetMetaFields %} {% set columns = columns|merge({ ('t_' ~ field.name): true}) %} {% set columnTitles = columnTitles|merge({ ('t_' ~ field.name): (field.label)}) %} {% endfor %} {% for id, field in customerMetaFields %} {% set columns = columns|merge({ ('c_' ~ field.name): true}) %} {% set columnTitles = columnTitles|merge({ ('c_' ~ field.name): (field.label)}) %} {% endfor %} {% for id, field in projectMetaFields %} {% set columns = columns|merge({ ('p_' ~ field.name): true}) %} {% set columnTitles = columnTitles|merge({ ('p_' ~ field.name): (field.label)}) %} {% endfor %} {% for id, field in activityMetaFields %} {% set columns = columns|merge({ ('a_' ~ field.name): true}) %} {% set columnTitles = columnTitles|merge({ ('a_' ~ field.name): (field.label)}) %} {% endfor %} {% for id, field in userPreferences %} {% set columns = columns|merge({ ('u_' ~ field.name): true}) %} {% set columnTitles = columnTitles|merge({ ('u_' ~ field.name): (field.label)}) %} {% endfor %} {% set columns = columns|merge({ 'hourlyRate': false, 'fixedRate': false, 'duration': 'label.duration', 'rate_internal': 'label.rate_internal', 'rate': 'label.rate', }) %} {% block javascripts %} {% endblock %} {% block styles %} {% endblock %} {% block export %}
{{ 'export.period'|trans }}: {{ query.begin|date_short }} - {{ query.end|date_short }}
{{ 'label.customer'|trans }} | {{ 'label.project'|trans }} | {% if showTimeBudget %}{{ 'label.timeBudget'|trans }} | {% endif %} {% if showRateBudget %}{{ 'label.budget'|trans }} | {% endif %}{{ 'label.duration'|trans }} | {{ 'label.rate_internal'|trans }} | {{ 'label.rate'|trans }} |
---|---|---|---|---|---|---|
{% if showTimeBudget %} | {% endif %} {% if showRateBudget %} | {% endif %} | {{ customerDuration|duration(decimal) }} | {{ customerInternalRate|money(customerCurrency) }} | {{ customerRate|money(customerCurrency) }} | |
{{ summary.customer }} | {{ summary.project }} | {% if showTimeBudget %}{% if budgets[id] is defined and budgets[id].time_left > 0 %} {{ budgets[id].time_left|duration(decimal) }} {% endif %} | {% endif %} {% if showRateBudget %}{% if budgets[id] is defined and budgets[id].money_left > 0 %} {{ budgets[id].money_left|money(summary.currency) }} {% endif %} | {% endif %}{{ summary.duration|duration(decimal) }} | {{ summary.rate_internal|money(summary.currency) }} | {{ summary.rate|money(summary.currency) }} |
{% if showTimeBudget %} | {% endif %} {% if showRateBudget %} | {% endif %} | {{ customerDuration|duration(decimal) }} | {{ customerInternalRate|money(customerCurrency) }} | {{ customerRate|money(customerCurrency) }} |
{{ columnTitles[columnId]|default('label.'~columnId)|trans }} | {% endfor %}|||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ entry.begin|date_time }}
{% if entry.end %}
{{ entry.end|date_time }} {% endif %} |
{{ widgets.username(entry.user) }} | {{ 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 %} | {% if entry.exported %} {{ 'entryState.exported'|trans }} {% else %} {{ 'entryState.not_exported'|trans }} {% endif %} | {% if entry.tags is defined and entry.tags is not empty %} {{ entry.tagsAsArray|join(', ') }} {% endif %} | {% for id, field in timesheetMetaFields %}{{ tables.datatable_meta_column(entry, field) }} | {% endfor %} {% for id, field in customerMetaFields %}{{ tables.datatable_meta_column(entry.project.customer, field) }} | {% endfor %} {% for id, field in projectMetaFields %}{{ tables.datatable_meta_column(entry.project, field) }} | {% endfor %} {% for id, field in activityMetaFields %}{% if entry.activity is not null %} {{ tables.datatable_meta_column(entry.activity, field) }} {% endif %} | {% endfor %} {% for id, field in userPreferences %}{% set metaField = entry.user.preference(field.name) %} {% if not metaField is null and metaField.value is not null and metaField.value is not empty %} {{ widgets.form_type_value(field.type, metaField.value, entry.user) }} {% endif %} | {% endfor %}{{ entry.hourlyRate|money(entry.project.customer.currency) }} | {{ entry.fixedRate|money(entry.project.customer.currency) }} | {{ entry.duration|duration(decimal) }} | {% if entry.internalRate is defined %} {{ entry.internalRate|money(entry.project.customer.currency) }} {% else %} {{ entry.rate|money(entry.project.customer.currency) }} {% endif %} | {{ entry.rate|money(entry.project.customer.currency) }} |
{% endif %} {% endfor %} | {{- timeWorked|duration(decimal) -}} | {%- if currency is not null and currency is not same as(false) %} {{ rateInternalTotal|money(currency) }} {% else %} {{ rateInternalTotal|money }} {% endif -%} | {%- if currency is not null and currency is not same as(false) %} {{ rateTotal|money(currency) }} {% else %} {{ rateTotal|money }} {% endif -%} |