{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% import "macros/toolbar.html.twig" as toolbar %} {% import "macros/actions.html.twig" as actions %} {% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %} {% block page_actions %}{{ actions.timesheets('index') }}{% endblock %} {% block main_before %} {{ toolbar.toolbar(toolbarForm, 'collapseTimesheet', showFilter) }} {% endblock %} {% block main %} {% import _self as timesheet %} {% if entries.count == 0 %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% else %} {% set duration_only = is_duration_only() %} {% set canSeeRate = is_granted('view_rate_own_timesheet') %} {% set columns = {'date': ''} %} {% if not duration_only %} {% set columns = columns|merge({'starttime': '', 'endtime': 'hidden-xs'}) %} {% endif %} {% set columns = columns|merge({'duration': ''}) %} {% if canSeeRate %} {% set columns = columns|merge({'rate': 'hidden-xs'}) %} {% endif %} {% set columns = columns|merge({ 'customer': 'hidden-xs hidden-sm', 'project': 'hidden-xs hidden-sm', 'activity': 'hidden-xs hidden-sm', 'description': 'hidden-xs hidden-sm', 'actions': 'alwaysVisible', }) %} {% set tableName = 'timesheet' %} {{ tables.data_table_header(tableName, columns, showSummary) }} {% set day = null %} {% set dayDuration = 0 %} {% set dayRate = {} %} {% for entry in entries %} {% set customerCurrency = entry.project.customer.currency %} {% if day is same as(null) %} {% set day = entry.begin|date_short %} {% endif %} {% if showSummary and day is not same as(entry.begin|date_short) %} {{ timesheet.summary(day, dayDuration, dayRate, columns, canSeeRate) }} {% set day = entry.begin|date_short %} {% set dayDuration = 0 %} {% set dayRate = {} %} {% endif %}