0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-04-16 10:11:17 +00:00

show user account number in report export ()

This commit is contained in:
Kevin Papst 2022-03-29 12:48:42 +02:00 committed by GitHub
parent 4ff2153e15
commit 2c2ba2e32c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = '' %}
{% if dataType == 'rate' or dataType == 'internalRate' %}
{% 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 = '' %}
{% if dataType == 'rate' or dataType == 'internalRate' %}
{% set dataTypeFormat = ' data-format="' ~ constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') ~ '"' %}

View file

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