{% extends 'page_setup.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block form_addon %} {% set event = actions(app.user, 'contract_links', 'index', {year: year, user: user}) %} {{ widgets.actions(event.actions, {button_class: '', large: false}) }} {% endblock %} {% block main %} {% if not withWorkHourConfiguration %} {% set warningMsg %} {{ 'work_times_should.none_configured'|trans }} {% if is_granted('contract', user) %} {{ 'action.edit'|trans }} {% endif %} {% endset %} {% from '@theme/components/alert.html.twig' import alert %} {{ alert({type: 'info', description: warningMsg|raw, important: true}) }} {% endif %} {% if summaries|length > 0 %} {% embed '@theme/embeds/card.html.twig' with {'fullsize': true} %} {% from "macros/status.html.twig" import status_duration %} {% from "macros/widgets.html.twig" import work_times_result %} {% block box_title %} {{ 'export.summary'|trans }} {{ status_duration(work_times_result(summaries.expectedTime, summaries.actualTime, decimal)) }} {% endblock %} {% block box_body_classes %}card-table table-responsive{% endblock %} {% block box_body %}
{{ 'sum.total'|trans }} | {% for month in year.months %}{{ month.month|month_name }} | {% endfor %}|
---|---|---|
{{ summary.title|trans }} | {% if summary.expectedTime > 0 %} {{ work_times_result(summary.expectedTime, summary.actualTime, decimal) }} {% else %} {{ summary.actualTime|duration(decimal) }} {% endif %} | {% for month in summary.months %} {% set monthShould = month.expectedTime %} {% set monthIs = month.actualTime %} {% set dateKey = '_' ~ month.month.format('m') %} {% set monthTotalShouldTmp = monthTotalShould[dateKey] + monthShould %} {% set monthTotalIsTmp = monthTotalIs[dateKey] + monthIs %} {% set monthTotalShould = monthTotalShould|merge({(dateKey): monthTotalShouldTmp}) %} {% set monthTotalIs = monthTotalIs|merge({(dateKey): monthTotalIsTmp}) %}{% if now < month.month and monthShould > 0 %} {{ monthShould|duration(decimal) }} {% else %} {{ work_times_result(monthShould, monthIs, decimal) }} {% endif %} | {% endfor %}
{{ 'sum.total'|trans }} | {{ work_times_result(summaries.expectedTime, summaries.actualTime, decimal) }} | {% for month in year.months %} {% set dateKey = '_' ~ month.month.format('m') %}{{ work_times_result(monthTotalShould[dateKey], monthTotalIs[dateKey], decimal) }} | {% endfor %}
{% endif %} | {{ 'month'|trans }} | {{ 'sum.total'|trans }} | {{ 'work_times_should'|trans }} | {{ 'work_times_is'|trans }} | {% for day in 1..31 %}{% if day < 10 %}0{% endif %}{{ day }} | {% endfor %}||
---|---|---|---|---|---|---|---|
{% if month.locked %} {% else %} {% endif %} | {% endif %}{{ month.month|month_name }} | {% if showStats %} {{ work_times_result(monthShould, monthIs, decimal) }} {% endif %} | {{ monthShould|duration(decimal) }} | {{ monthIs|duration(decimal) }} | {% set dayCount = 0 %} {% for day in month.days %} {% set class = 'text-end contractDay text-nowrap' %} {% if day.workingTime.expectedTime == 0 %} {% set class = class ~ ' weekend' %} {% endif %} {% if day.workingTime.expectedTime > 0 and day.workingTime.actualTime == 0 and now > day.day %} {% set class = class ~ ' bg-orange-lt' %} {% elseif day.workingTime.expectedTime == 0 and day.workingTime.actualTime > 0 and now > day.day %} {% set class = class ~ ' bg-yellow-lt' %} {% endif %}{% if (day.workingTime.expectedTime != 0 or day.workingTime.actualTime != 0) and (now > day.day or day.workingTime.actualTime > 0) %} {% if day.hasAddons() %} {% set statusTitle = '' %} {% for addon in day.getAddons() %} {% set statusTitle = statusTitle ~ (addon.title|trans) ~ ' (' ~ addon.visibleDuration|duration(decimal) ~ ')' %} {% if not loop.last %} {% set statusTitle = statusTitle ~ ', ' %} {% endif %} {% endfor %} {% endif %} {{ work_times_result(day.workingTime.expectedTime, day.workingTime.actualTime, decimal) }} {% endif %} | {% set dayCount = dayCount + 1 %} {% endfor %} {% if dayCount < 31 %} {% for day in 1..(31-dayCount)%}{% endfor %} {% endif %} | {% set event = actions(app.user, 'contract_month', 'index', {'year': year, 'month': month}) %} {{ table_actions(event.actions) }} |
{% endif %} | {{ work_times_result(yearShould, yearIs, decimal) }} | {{ yearShould|duration(decimal) }} | {{ yearIs|duration(decimal) }} | {% for day in 1..31 %}{% endfor %} |