{% extends 'reporting/layout.html.twig' %} {% import "macros/datatables.html.twig" as tables %} {% block report_title %}{{ 'report_project_view'|trans({}, 'reporting') }}{% endblock %} {% set columns = { 'name': {'class': 'alwaysVisible'}, 'today': {'class': 'text-nowrap text-right', 'title': 'daterangepicker.today'|trans({}, 'daterangepicker')}, 'week': {'class': 'text-nowrap text-right', 'title': 'agendaWeek'|trans}, 'month': {'class': 'text-nowrap text-right', 'title': 'month'|trans}, 'durationTotal': {'class': 'hidden-md hidden-sm hidden-xs text-nowrap text-right', 'title': 'stats.durationTotal'|trans}, 'timeBudget': {'class': 'text-nowrap', 'title': 'label.timeBudget'|trans}, 'budget': {'class': 'text-nowrap', 'title': 'label.budget'|trans}, 'stateDuration': {'class': 'hidden-sm hidden-xs text-nowrap text-right', 'title': 'entryState.not_exported'|trans}, 'stateMoney': {'class': 'hidden-sm hidden-xs text-nowrap text-right', 'title': 'entryState.not_exported'|trans}, 'projectEnd': {'class': 'hidden-md hidden-sm hidden-xs hidden text-nowrap text-center', 'title': 'label.project_end'|trans}, 'comment': {'class': 'hidden-md hidden-sm hidden-xs hidden', 'title': 'label.comment'|trans}, } %} {% set tableName = 'project_view_reporting' %} {% block main_before %} {{ tables.data_table_column_modal(tableName, columns) }} {% endblock %} {% block report %} {% set hasData = entries|length > 0 %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/progressbar.html.twig" as progress %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% block box_body_class %}project-view-reporting-box {% if hasData %}no-padding{% endif %} table-responsive{% endblock %} {% block box_before %} {{ form_start(form, {'attr': {'class': 'form-inline form-reporting', 'id': 'project-view-form'}}) }} {% endblock %} {% block box_after %} {{ form_end(form) }} {% endblock %} {% block box_tools %} {{ widgets.action_button('visibility', {'modal': '#modal_project_view_reporting', 'class': 'btn-sm'}) }} {% endblock %} {% block box_title %} {{ form_widget(form) }} {% endblock %} {% block box_body %} {% if not hasData %} {{ widgets.nothing_found() }} {% else %} {{ tables.datatable_header(tableName, columns, null, {'bordered': true, 'striped': false, 'boxClass': ''}) }} {% for id, mapping in entries|sort((a, b) => a.customer.name <=> b.customer.name) %} {% if is_granted('budget', mapping.customer) %} {{ widgets.label_customer(mapping.customer) }} {% for entry in mapping.projects|sort((a, b) => a.project.name <=> b.project.name) %} {% set project = entry.project %} {% set currency = project.customer.currency %} {% if is_granted('budget', project) %} {{ widgets.label_project(project) }} {{ entry.durationDay|duration }} {{ entry.durationWeek|duration }} {{ entry.durationMonth|duration }} {{ entry.durationTotal|duration }} {% if project.timeBudget > 0 %} {{ progress.progressbar(project.timeBudget, entry.durationTotal|default(0), entry.durationTotal|duration ~ ' / ' ~ project.timeBudget|duration, '') }} {% endif %} {% if project.budget > 0 %} {{ progress.progressbar(project.budget, entry.rateTotal|default(0), entry.rateTotal|money(currency) ~ ' / ' ~ project.budget|money(currency), '') }} {% endif %} {% if is_granted('create_export') %} {{ entry.notExportedDuration|duration }} {% else %} {{ entry.notExportedDuration|duration }} {% endif %} {% if is_granted('view_invoice') %} {{ entry.notExportedRate|money(currency) }} {% else %} {{ entry.notExportedRate|money(currency) }} {% endif %} {% if project.end is not null %}{{ project.end|date_short }}{% endif %} {{ project.comment }} {% endif %} {% endfor %} {% endif %} {% endfor %} {{ tables.data_table_footer(entries) }} {% endif %} {% endblock %} {% endembed %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}