{% extends 'reporting/layout.html.twig' %} {% block report_title %}{{ report_title|trans({}, 'reporting') }}{% endblock %} {% block report %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_before %} {{ form_start(form, {'attr': {'class': 'form-inline'}}) }} {% endblock %} {% block box_after %} {{ form_end(form) }} {% endblock %} {% block box_title %} {% if form.user is defined %} {{ form_row(form.user, {'label': false}) }} {% else %} {{ widgets.username(user) }} {% endif %} {{ form_widget(form.date) }} {% endblock %} {% block box_body_class %}{{ box_id }} table-responsive no-padding{% endblock %} {% block box_body %} {% set totals = {'totals': 0} %} {% set columns = 2 %} {% for day in days.dateTimes %} {% set columns = columns + 1 %} {% set totals = totals|merge({(day|report_date): 0}) %} {% endfor %} {% set oldCustomer = null %} {% for pid, project in rows|sort((a,b) => a.project.customer.id <=> b.project.customer.id) %} {% if oldCustomer is null or oldCustomer != project.project.customer.id %} {% set oldCustomer = project.project.customer.id %} {% endif %} {% set totals = totals|merge({'totals': (totals['totals'] + project.duration)}) %} {% for day in project.days.days %} {% endfor %} {% for activity in project.activities %} {% for day in activity.days.days %} {% endfor %} {% endfor %} {% endfor %} {% for day in days.dateTimes %} {% endfor %}
    {{ day|day_name(true) }}
{{ day|format_date('short') }}
{{ widgets.label_customer(project.project.customer) }}
{{ widgets.label_project(project.project) }} {{ project.duration|duration }} {% if day.duration > 0 %} {% set totals = totals|merge({(day.date|report_date): (totals[day.date|report_date] + day.duration)}) %} {{ day.duration|duration }} {% endif %}
{{ widgets.label_activity(activity.activity) }} {{ activity.duration|duration }} {% if day.duration > 0 %} {{ day.duration|duration }} {% endif %}
{{ totals['totals']|duration }} {{ totals[day|report_date]|duration }}
{% endblock %} {% endembed %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}