Release 2.49 (#5820)

* bump packages
* add column summarization per customer (#5808)
* clarify database requirements
* added helper methods to fetch original expected time

Co-authored-by: GregorB54321 <34287148+GregorB54321@users.noreply.github.com>
This commit is contained in:
Kevin Papst
2026-02-15 21:31:06 +01:00
committed by GitHub
parent f376b5c8a1
commit ff6918fcab
10 changed files with 221 additions and 117 deletions

View File

@@ -17,5 +17,8 @@
{% block column_classes_total -%}
{% if column is weekend %} weekend{% endif %}
{%- endblock %}
{% block column_classes_customer_total -%}
{% if column is weekend %} weekend{% endif %}
{%- endblock %}
{% endembed %}
{% endblock %}

View File

@@ -46,6 +46,23 @@
{% elseif data.customer != totalCurrency %}
{% set totalCurrency = null %}
{% endif %}
{% set customerTotalsDuration = {} %}
{% set customerTotalsInternalRate = {} %}
{% set customerTotalsRate = {} %}
{% for column in period.dateTimes %}
{% set dateKey = column|report_date %}
{% set customerTotalsDuration = customerTotalsDuration|merge({(dateKey): 0}) %}
{% set customerTotalsInternalRate = customerTotalsInternalRate|merge({(dateKey): 0}) %}
{% set customerTotalsRate = customerTotalsRate|merge({(dateKey): 0}) %}
{% endfor %}
{% for project in data.projects %}
{% for column in project.data.data %}
{% set dateKey = column.date|report_date %}
{% set customerTotalsDuration = customerTotalsDuration|merge({(dateKey): (customerTotalsDuration[dateKey] + column.duration)}) %}
{% set customerTotalsInternalRate = customerTotalsInternalRate|merge({(dateKey): (customerTotalsInternalRate[dateKey] + column.internalRate)}) %}
{% set customerTotalsRate = customerTotalsRate|merge({(dateKey): (customerTotalsRate[dateKey] + column.rate)}) %}
{% endfor %}
{% endfor %}
<tr class="summary">
<td>{{ widgets.label_customer(data.customer) }}</td>
<td class="text-center total">
@@ -59,7 +76,20 @@
{% endif %}
{% if with_links %}</a>{% endif %}
</td>
<td colspan="{{ columns }}"></td>
{% for column in period.dateTimes %}
{% set dateKey = column|report_date %}
<td class="text-nowrap text-center day-total {% block column_classes_customer_total %}{% endblock %}">
{% if customerTotalsRate[dateKey] > 0 or customerTotalsInternalRate[dateKey] > 0 or customerTotalsDuration[dateKey] > 0 %}
{% if dataType == 'rate' %}
<strong>{{ customerTotalsRate[dateKey]|money(currency) }}</strong>
{% elseif dataType == 'internalRate' %}
<strong>{{ customerTotalsInternalRate[dateKey]|money(currency) }}</strong>
{% else %}
<strong>{{ customerTotalsDuration[dateKey]|duration(decimal) }}</strong>
{% endif %}
{% endif %}
</td>
{% endfor %}
</tr>
{% for project in data.projects %}
{% set absoluteDuration = absoluteDuration + project.duration %}

View File

@@ -14,5 +14,6 @@
{% block column_classes_project %}{% endblock %}
{% block column_classes_activity %}{% endblock %}
{% block column_classes_total %}{% endblock %}
{% block column_classes_customer_total %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -5,4 +5,5 @@
{% block column_classes_project %}{% endblock %}
{% block column_classes_activity %}{% endblock %}
{% block column_classes_total %}{% endblock %}
{% block column_classes_customer_total %}{% endblock %}
{% endembed %}