{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% set totalDuration = 0 %} {% set totalRates = {} %} {% if too_many is not same as (true) and preview_show and entries is not empty %} {% for row in by_customer %} {% set totalDuration = totalDuration + row.duration %} {% set customerCurrency = row.customer.currency %} {% if totalRates[customerCurrency] is not defined %} {% set totalRates = totalRates|merge({(customerCurrency): 0.00}) %} {% endif %} {% set totalRates = totalRates|merge({(customerCurrency): totalRates[customerCurrency] + row.rate}) %} {% endfor %} {% endif %} {% set columns = { 'avatar': {'class': 'text-nowrap w-avatar d-none d-md-table-cell', 'title': false, 'orderBy': false}, 'date': {'class': 'alwaysVisible text-nowrap', 'orderBy': false}, 'user': {'class': 'd-none', 'orderBy': false}, 'project': {'class': 'd-none d-sm-table-cell', 'orderBy': false}, 'activity': {'class': 'd-none', 'orderBy': false}, 'description': {'class': 'd-none d-xl-table-cell timesheet-description', 'orderBy': false}, 'unit_price': {'class': 'd-none text-nowrap text-end', 'orderBy': false}, 'duration': {'class': 'text-end text-nowrap', 'orderBy': false}, 'internalRate': {'class': 'text-end d-none text-nowrap', 'orderBy': false}, 'total_rate': {'class': 'text-end text-nowrap', 'orderBy': false}, 'actions': {'class': 'actions alwaysVisible', 'orderBy': false}, } %} {% set tableName = 'export' %} {% set editExported = is_granted('edit_exported_timesheet') %} {% set showMarkAsExportedButton = false %} {% set showToggleButton = false %} {% if entries is not empty and form.markAsExported is defined %} {% set showMarkAsExportedButton = form.exported.vars.value != constant('App\\Repository\\Query\\TimesheetQuery::STATE_EXPORTED') %} {% set showToggleButton = preview_show and form.exported.vars.value != constant('App\\Repository\\Query\\TimesheetQuery::STATE_ALL') %} {% endif %} {% block status %} {% from "macros/status.html.twig" import status_duration, status_money %} {% if totalDuration > 0 %} {{ status_duration(totalDuration|duration) }} {% endif %} {% for totalCurrency, totalRate in totalRates %} {{ status_money(totalRate|money(totalCurrency)) }} {% endfor %} {% endblock %} {% block main_before %} {{ tables.data_table_column_modal(tableName, columns) }} {% endblock %} {% block main %} {% embed '@theme/embeds/card.html.twig' %} {% import "macros/search.html.twig" as search %} {% form_theme form 'form/horizontal.html.twig' %} {% block box_title %}{{ 'export.filter'|trans }}{% endblock %} {% block box_before %}{{ form_start(form) }}{% endblock %} {% block box_body %} {{ form_errors(form) }} {{ form_row(form.searchTerm) }} {{ form_row(form.daterange) }} {{ form_row(form.customers) }} {{ form_row(form.projects) }} {{ form_row(form.activities) }} {{ form_row(form.tags) }} {% if form.users is defined %} {{ form_row(form.users) }} {% endif %} {% if form.teams is defined %} {{ form_row(form.teams) }} {% endif %} {{ form_row(form.billable) }} {{ form_row(form.exported) }} {{ form_row(form.state) }} {% if form.markAsExported is defined %} {{ form_row(form.markAsExported) }} {% endif %} {% endblock %} {% block box_footer%} {{ search.searchButton(form) }} {% endblock %} {% block box_after %}{{ form_end(form) }}{% endblock %} {% endembed %} {% if too_many is same as (true) %} {{ widgets.callout('danger', 'error.too_many_entries') }} {% elseif preview_show %} {% if entries is empty %} {{ widgets.nothing_found() }} {% else %} {% embed '@theme/embeds/card.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_title %} {{ 'preview'|trans }} {% endblock %} {% block box_attributes %}id="preview_export"{% endblock %} {% block box_body_class %}p-0{% endblock %} {% block box_footer %} {% set buttons = {} %} {% for button in renderer %} {% set title = button.title %} {% set group = [] %} {% if buttons[(title)] is defined %} {% set group = buttons[(title)] %} {% endif %} {% set group = group|merge([button]) %} {% set buttons = buttons|merge({(title): group}) %} {% endfor %} {% if showMarkAsExportedButton %}
{{ 'customer'|trans }} | {{ 'duration'|trans }} | {{ 'total_rate'|trans }} |
---|---|---|
{{ widgets.label_customer(row.customer) }} | {{ row.duration|duration(decimal) }} | {{ row.rate|money(currency) }} |