{% extends 'reporting/layout.html.twig' %} {% block report %}
{% if team %}

Time Analysis — {{ team.name }}

{{ from }} – {{ to }} {% set tb = 0 %}{% set tn = 0 %}{% set tu = 0 %}{% set tt = 0 %} {% for r in rows %} {% set tb = tb + r.billable_hours %} {% set tn = tn + r.nonbillable_hours %} {% set tu = tu + r.unproductive_hours %} {% set tt = tt + r.total_hours %} {% endfor %}
Name Billable Non-Billable Unproductive Total Hours
{{ r.alias ?: r.username }} {{ r.billable_hours|number_format(2) }} {{ r.nonbillable_hours|number_format(2) }} {{ r.unproductive_hours|number_format(2) }} {{ r.total_hours|number_format(2) }}
TOTAL {{ tb|number_format(2) }} {{ tn|number_format(2) }} {{ tu|number_format(2) }} {{ tt|number_format(2) }}
{% macro pivot(rows, cols, title) %}

{{ title }}

{% for uc in cols %}{% endfor %} {% if rows is empty %} {% else %} {% for pr in rows %} {% for uc in cols %} {% endfor %} {% endfor %} {% set gt = 0 %} {% for uc in cols %} {% set ct = 0 %}{% for pr in rows %}{% set ct = ct + pr.users[uc]|default(0) %}{% endfor %} {% set gt = gt + ct %} {% endfor %} {% endif %}
CompanyProject{{ uc }}TOTAL
No data for this period
{{ pr.company }} {{ pr.project }}{{ pr.users[uc]|default(0) > 0 ? pr.users[uc]|number_format(1) }}{{ pr.total|number_format(1) }}
TOTAL{{ ct > 0 ? ct|number_format(1) }}{{ gt|number_format(1) }}
{% endmacro %} {% import _self as self %} {{ self.pivot(projectRows, userColumns, 'Billable Projects') }} {{ self.pivot(nonbillRows, userColumnsNB, 'Non-Billable Projects') }} {{ self.pivot(unprodRows, userColumnsUP, 'Unproductive Projects') }}
{% endif %}
{% endblock %}