{# templates/report/times.html.twig #} {% extends 'base.html.twig' %} {% set monthsShort = deMonthsShort() %} {% block title %}{{ 'app.report.page_title'|trans }}{% endblock %} {% block javascripts %} {{ parent() }} {{ encore_entry_script_tags('report') }} {% endblock %} {% block body %}

{{ 'app.report.heading'|trans }}

{# ── Toolbar ──────────────────────────────────────────────────────── #}
{% if lexofficeInvoice %} {% endif %}
{# ── Filter-Panel ─────────────────────────────────────────────────── #} {% include 'report/_filter-panel.html.twig' %} {# ── Tabellen-Header ───────────────────────────────────────────────── #} {% macro sort_header(col, label, sort, dir, extra) %} {% set active = sort == col %} {% set nextDir = (active and dir == 'ASC') ? 'DESC' : 'ASC' %}
{{ label }}{% if active %}{{ dir == 'ASC' ? '▴' : '▾' }}{% endif %} {% if extra %}{{ extra }}{% endif %}
{% endmacro %}
{{ _self.sort_header('date', 'app.report.col_date'|trans, sort, dir, '') }} {{ _self.sort_header('client', 'app.report.col_client'|trans, sort, dir, '') }} {{ _self.sort_header('project', 'app.report.col_project'|trans, sort, dir, '') }} {{ _self.sort_header('service', 'app.report.col_service'|trans, sort, dir, '') }} {{ _self.sort_header('user', 'app.report.col_user'|trans, sort, dir, '') }} {{ _self.sort_header('note', 'app.report.col_note'|trans, sort, dir, '') }} {{ _self.sort_header('duration', 'app.report.col_hours'|trans, sort, dir, totalDuration) }} {{ _self.sort_header('revenue', 'app.report.col_revenue'|trans, sort, dir, totalRevenue|number_format(2, ',', '.') ~ ' €') }}
{# ── Einträge ──────────────────────────────────────────────────── #} {% for entry in entries %} {% set service = entry.service %} {% set billable = (service is null or service.billable) %} {% set hourlyRate = entry.project.hourlyRate ?? entry.project.client.hourlyRate ?? (service ? service.hourlyRate : null) %} {% set monthShort = monthsShort[entry.date|date('n') - 1] %} {% set canEdit = isAdmin or (entry.userId == currentUserId) %}
{{ entry.date|date('j') }}. {{ monthShort }} {{ entry.date|date('y') }}
{{ entry.project.client.name }}
{{ entry.project.name }}
{{ service ? service.name : '' }}
{{ userMap[entry.userId] ?? 'app.report.user_fallback'|trans({'%id%': entry.userId}) }}
{{ entry.note }}
{{ entry.durationFormatted }}
{% if billable and hourlyRate is not null %} {{ (hourlyRate * entry.duration / 60)|number_format(2, ',', '.') }} € {% endif %}
{% if canEdit and not entry.invoiced %} {% endif %} {% if canEdit %} {% endif %}
{# ── Inline-Edit-Formular ───────────────────────────────── #} {% if canEdit and not entry.invoiced %} {% endif %}
{% else %}
{{ 'app.report.no_entries'|trans }}
{% endfor %} {# ── Pagination-Footer ─────────────────────────────────────────── #}
{{ 'app.report.show'|trans }} {% for l in validLimits %} {% if l == limit %} {{ l }} {% else %} {{ l }} {% endif %} {% endfor %} {{ 'app.report.of_total'|trans({'%count%': totalCount|number_format(0, ',', '.')}) }}
{{ totalDuration }} {{ totalRevenue|number_format(2, ',', '.') }} €
{# /.report-table #}
{# /.report-card #}
{# /.report-content #}
{# /.report-page #} {% endblock %}