show user account number in report export (#3224)

This commit is contained in:
Kevin Papst
2022-03-29 12:48:42 +02:00
committed by GitHub
parent 4ff2153e15
commit 2c2ba2e32c
3 changed files with 15 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
{% embed 'reporting/user_list_period_data.html.twig' %} {% embed 'reporting/user_list_period_data.html.twig' with {'showAccountNumber': true, 'stats': stats, 'dataType': dataType, 'period_attribute': period_attribute} only %}
{% set dataTypeFormat = '' %} {% set dataTypeFormat = '' %}
{% if dataType == 'rate' or dataType == 'internalRate' %} {% if dataType == 'rate' or dataType == 'internalRate' %}
{% set dataTypeFormat = ' data-format="' ~ constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') ~ '"' %} {% set dataTypeFormat = ' data-format="' ~ constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') ~ '"' %}

View File

@@ -1,4 +1,4 @@
{% embed 'reporting/user_list_period_data.html.twig' %} {% embed 'reporting/user_list_period_data.html.twig' with {'showAccountNumber': true, 'stats': stats, 'dataType': dataType, 'period_attribute': period_attribute} only %}
{% set dataTypeFormat = '' %} {% set dataTypeFormat = '' %}
{% if dataType == 'rate' or dataType == 'internalRate' %} {% if dataType == 'rate' or dataType == 'internalRate' %}
{% set dataTypeFormat = ' data-format="' ~ constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') ~ '"' %} {% set dataTypeFormat = ' data-format="' ~ constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') ~ '"' %}

View File

@@ -4,6 +4,7 @@
{%- set totalsDuration = {} -%} {%- set totalsDuration = {} -%}
{%- set totalsInternalRate = {} -%} {%- set totalsInternalRate = {} -%}
{%- set totalsRate = {} -%} {%- set totalsRate = {} -%}
{%- set showAccountNumber = showAccountNumber is defined ? showAccountNumber : false -%}
{% if dataType == 'rate' %} {% if dataType == 'rate' %}
{% set dataTypeTitle = 'stats.amountTotal' %} {% set dataTypeTitle = 'stats.amountTotal' %}
{% elseif dataType == 'internalRate' %} {% elseif dataType == 'internalRate' %}
@@ -15,6 +16,9 @@
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
{% if showAccountNumber %}
<th>{{ 'label.account_number'|trans }}</th>
{% endif %}
<th class="text-center reportDataTypeTitle">{{ dataTypeTitle|trans }}</th> <th class="text-center reportDataTypeTitle">{{ dataTypeTitle|trans }}</th>
{% for column in stats.0.getDateTimes() %} {% for column in stats.0.getDateTimes() %}
{% block period_name %}{% endblock %} {% block period_name %}{% endblock %}
@@ -37,6 +41,9 @@
{{ label_dot(userPeriod.user.displayName, userPeriod.user.color) }} {{ label_dot(userPeriod.user.displayName, userPeriod.user.color) }}
{% endblock %} {% endblock %}
</td> </td>
{% if showAccountNumber %}
<td>{{ userPeriod.user.accountNumber }}</td>
{% endif %}
{% for period in attribute(userPeriod, period_attribute) %} {% for period in attribute(userPeriod, period_attribute) %}
{% if period.totalDuration > 0 %} {% if period.totalDuration > 0 %}
{% set usersTotalDuration = usersTotalDuration + period.totalDuration %} {% set usersTotalDuration = usersTotalDuration + period.totalDuration %}
@@ -55,7 +62,7 @@
{% set totalsInternalRate = totalsInternalRate|merge({(reportDateKey): (totalsInternalRate[reportDateKey] + period.totalInternalRate)}) %} {% set totalsInternalRate = totalsInternalRate|merge({(reportDateKey): (totalsInternalRate[reportDateKey] + period.totalInternalRate)}) %}
{% set totalsRate = totalsRate|merge({(reportDateKey): (totalsRate[reportDateKey] + period.totalRate)}) %} {% set totalsRate = totalsRate|merge({(reportDateKey): (totalsRate[reportDateKey] + period.totalRate)}) %}
{% endfor %} {% endfor %}
<th class="text-nowrap text-center total{% block user_total_cell_class %}{% endblock %}"{% block user_total_cell_attribute %}{% endblock %}> <td class="text-nowrap text-center total{% block user_total_cell_class %}{% endblock %}"{% block user_total_cell_attribute %}{% endblock %}>
{% if dataType == 'rate' %} {% if dataType == 'rate' %}
{% block total_rate_user %}{% endblock %} {% block total_rate_user %}{% endblock %}
{% elseif dataType == 'internalRate' %} {% elseif dataType == 'internalRate' %}
@@ -63,7 +70,7 @@
{% else %} {% else %}
{% block total_duration_user %}{% endblock %} {% block total_duration_user %}{% endblock %}
{% endif %} {% endif %}
</th> </td>
{% for period in attribute(userPeriod, period_attribute) %} {% for period in attribute(userPeriod, period_attribute) %}
<td class="text-nowrap text-center day-total{% block period_cell_class %}{% endblock %}"{% block period_cell_attribute %}{% endblock %}> <td class="text-nowrap text-center day-total{% block period_cell_class %}{% endblock %}"{% block period_cell_attribute %}{% endblock %}>
{% if period.totalDuration > 0 or period.totalRate > 0 or period.totalInternalRate > 0 %} {% if period.totalDuration > 0 or period.totalRate > 0 or period.totalInternalRate > 0 %}
@@ -82,7 +89,10 @@
</tbody> </tbody>
<tfoot> <tfoot>
<tr class="summary"> <tr class="summary">
<td>{{ dataTypeTitle|trans }}</td> <td>{{ dataTypeTitle|trans }}</td>
{% if showAccountNumber %}
<td></td>
{% endif %}
<td class="text-center text-nowrap{% block total_period_cell_class %}{% endblock %}"{% block total_period_cell_attribute %}{% endblock %}> <td class="text-center text-nowrap{% block total_period_cell_class %}{% endblock %}"{% block total_period_cell_attribute %}{% endblock %}>
{% if dataType == 'rate' %} {% if dataType == 'rate' %}
{% block total_rate %} {% block total_rate %}