{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/toolbar.html.twig" as toolbar %} {% import "macros/datatables.html.twig" as tables %} {% set columns = { 'date': {'class': 'alwaysVisible text-nowrap', 'orderBy': false}, 'user': {'class': 'hidden-xs hidden-sm', 'orderBy': false}, 'project': {'class': 'hidden-xs hidden-sm', 'orderBy': false}, 'activity': {'class': 'hidden-xs hidden-sm hidden-md', 'orderBy': false}, 'description': {'class': 'hidden-xs hidden-sm hidden-md timesheet-description', 'orderBy': false}, 'unit_price': {'class': 'hidden hidden-xs text-nowrap', 'orderBy': false}, 'duration': {'class': 'text-nowrap', 'orderBy': false}, 'rate_internal': {'class': 'hidden text-nowrap', 'orderBy': false}, 'total_rate': {'class': 'text-nowrap', 'orderBy': false}, 'exported': {'class': 'alwaysVisible', 'orderBy': false}, } %} {% set tableName = 'export' %} {% block page_title %}{{ 'export.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'export.subtitle'|trans }}{% endblock %} {% block page_actions %} {% set event = actions(app.user, 'export', (preview_show ? 'preview' : 'index')) %} {{ widgets.page_actions(event.actions) }} {% endblock %} {% block main_before %} {{ tables.data_table_column_modal(tableName, columns) }} {% endblock %} {% block main %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/search.html.twig" as search %} {% form_theme form '@AdminLTE/layout/form-theme-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 %} {{ form_row(form.billable) }} {{ form_row(form.exported) }} {{ form_row(form.state) }} {{ form_row(form.markAsExported) }} {% endblock %} {% block box_footer%} {{ search.searchButton(form) }} {% endblock %} {% block box_after %}{{ form_end(form) }}{% endblock %} {% endembed %} {% if preview_show %} {% if entries is empty %} {{ widgets.nothing_found() }} {% else %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% block box_title %} {{ 'button.preview'|trans }}: {{ 'export.title'|trans }} {% endblock %} {% block box_body_class %}no-padding{% 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 %}
{% for group in buttons %} {% set button = group.0 %} {% if group|length == 1 %} {% elseif group|length > 1 %}
{% endif %} {% endfor %}
{% endblock %} {% block box_body %} {# #} {% for row in by_customer %} {% set currency = row.customer.currency %} {# #} {% endfor %}
{{ 'label.customer'|trans }} {{ 'label.total_rate'|trans }}
{{ widgets.label_customer(row.customer) }} {{ row.rate|money(currency) }}
{% endblock %} {% endembed %} {% set itemsAmount = entries|length %} {% if preview_limit %} {% set entries = entries|slice(0, preview_limit) %} {% endif %} {{ tables.datatable_header(tableName, columns, query, {}) }} {% for entry in entries %} {% set currency = entry.project.customer.currency %} {% if entry.fixedRate is not null %} {% set rate = entry.fixedRate %} {% else %} {% set rate = entry.hourlyRate %} {% endif %} {{ entry.begin|date_short }} {{ widgets.label_user(entry.user) }} {{ widgets.label_project(entry.project) }}
{{ widgets.label_customer(entry.project.customer) }} {% if entry.activity is not null %} {{ widgets.label_activity(entry.activity) }} {% endif %} {{ entry.description|desc2html }} {{ rate|money(currency) }} {{ entry.duration|duration(decimal) }} {{ entry.internalRate|money(currency) }} {{ entry.rate|money(currency) }} {% if is_granted('edit_export', entry) %} {% if entry.exported %} {% else %} {% endif %} {% else %} {% if entry.exported %} {{ 'entryState.exported'|trans }} {% else %} {{ 'entryState.not_exported'|trans }} {% endif %} {% endif %} {% endfor %} {% if preview_limit and itemsAmount > preview_limit %} » {{ 'preview.skipped_rows'|trans({'%rows%': (itemsAmount - preview_limit)}) }} {% endif %} {{ tables.data_table_footer(entries) }} {% endif %} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}