{% 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 %} {% block page_title %}{{ 'export.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'export.subtitle'|trans }}{% endblock %} {% block page_actions %} {% set actions = { 'filter': '#collapseExport', 'fas fa-toggle-off': {'id':'export-toggle-button'} } %} {{ widgets.page_actions(actions) }} {% endblock %} {% block main_before %} {{ toolbar.toolbar(form, 'collapseExport', true) }} {% endblock %} {% block main_after %}
{% endblock %} {% block main %} {% if entries is empty %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% else %} {# {% set columns = {'date': ''} %} {% if not duration_only %} {% set columns = columns|merge({'starttime': 'hidden-xs', 'endtime': 'hidden-xs'}) %} {% endif %} {% set columns = columns|merge({ 'duration': '', 'rate': '', 'customer': 'hidden-xs hidden-sm', 'project': 'hidden-xs hidden-sm', 'activity': 'hidden-xs hidden-sm', 'username': 'hidden-xs', 'description': 'hidden-xs hidden-sm', 'actions': 'alwaysVisible', }) %} #} {% set columns = { 'date': '', 'user': 'hidden-xs hidden-sm', 'customer': 'hidden-xs hidden-sm', 'project': 'hidden-xs hidden-sm', 'activity': 'hidden-xs hidden-sm', 'description': 'hidden-xs hidden-sm', 'unit_price': '', 'duration': '', 'total_rate': '', 'exported': 'alwaysVisible', } %} {% set tableName = 'export' %} {{ tables.data_table_header(tableName, columns) }} {% for entry in entries %} {% set currency = entry.project.customer.currency %} {% set duration = entry.duration|duration() %} {% if entry.fixedRate is not null %} {% set rate = entry.fixedRate %} {% set duration = 1 %} {% elseif entry.hourlyRate is not null %} {% set rate = entry.hourlyRate %} {% else %} {% set rate = entry.user.preferenceValue('hourly_rate') %} {% endif %} {{ entry.begin|date_short }} {{ widgets.label_user(entry.user) }} {{ widgets.label_customer(entry.project.customer) }} {{ widgets.label_project(entry.project) }} {{ widgets.label_activity(entry.activity) }} {{ entry.description }} {{ rate|money(currency) }} {{ duration }} {{ 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 %} {{ tables.data_table_footer(entries) }} {% if is_granted('create_export') %}
{% for button in renderer %} {% endfor %}
{% endif %} {% endif %} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}