faster spreadsheet exporter based on opensout and other export improvements (#5238)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
{% if stats is empty %}
|
||||
{{ nothing_found() }}
|
||||
{% else %}
|
||||
{% embed 'reporting/customer/monthly_projects_data.html.twig' with {'dataTypeFormat': null, 'stats': stats, 'dataType': dataType, 'decimal': decimal} only %}
|
||||
{% embed 'reporting/customer/monthly_projects_data.html.twig' with {'stats': stats, 'dataType': dataType, 'decimal': decimal} only %}
|
||||
{% set rowspanStyle = 'vertical-align: middle' %}
|
||||
{% endembed %}
|
||||
{% endif %}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
{% if project.activities[activity.id] is defined and i <= project.activities[activity.id]['users']|length %}
|
||||
{% set user = project.activities[activity.id]['users']|slice(-i) %}
|
||||
<td>{{ user.0.name }}</td>
|
||||
<td class="text-center"{% if dataTypeFormat is not null %} data-format="{{ dataTypeFormat }}"{% endif %}>
|
||||
<td class="text-center">
|
||||
{% set value = user.0[dataType] %}
|
||||
{% block user_activity %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
@@ -62,7 +62,7 @@
|
||||
{% endblock %}
|
||||
</td>
|
||||
{% if loop.parent.loop.first %}
|
||||
<td{% if rowspan > 1 %} rowspan="{{ rowspan }}"{% endif %} class="text-center text-nowrap"{% if dataTypeFormat is not null %} data-format="{{ dataTypeFormat }}"{% endif %}>
|
||||
<td{% if rowspan > 1 %} rowspan="{{ rowspan }}"{% endif %} class="text-center text-nowrap">
|
||||
{% set value = project.activities[activity.id][dataType] %}
|
||||
{% block project_activity %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
@@ -82,7 +82,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if loop.first %}
|
||||
<th{% if rowspan > 1 %} rowspan="{{ rowspan }}" style="{{ rowspanStyle }}"{% endif %} class="text-center text-nowrap"{% if dataTypeFormat is not null %} data-format="{{ dataTypeFormat }}"{% endif %}>
|
||||
<th{% if rowspan > 1 %} rowspan="{{ rowspan }}" style="{{ rowspanStyle }}"{% endif %} class="text-center text-nowrap">
|
||||
{% set value = project[dataType] %}
|
||||
{% block project_total %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
|
||||
@@ -1,30 +1,24 @@
|
||||
{% embed 'reporting/customer/monthly_projects_data.html.twig' with {'decimal': true, 'stats': stats, 'dataType': dataType} only %}
|
||||
{% set dataTypeFormat = null %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
{% set dataTypeFormat = constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::RATE_FORMAT_NO_CURRENCY') %}
|
||||
{% elseif dataType == 'duration' %}
|
||||
{% set dataTypeFormat = constant('App\\Export\\Base\\AbstractSpreadsheetRenderer::DURATION_DECIMAL') %}
|
||||
{% endif %}
|
||||
{% set rowspanStyle = 'vertical-align:center' %}
|
||||
{% block user_activity %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
{{ value|money(currency) }}
|
||||
{% else %}
|
||||
{{ value / 3600 }}
|
||||
{{ value|duration(true) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block project_activity %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
{{ value|money(currency) }}
|
||||
{% else %}
|
||||
{{ value / 3600 }}
|
||||
{{ value|duration(true) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block project_total %}
|
||||
{% if dataType == 'rate' or dataType == 'internalRate' %}
|
||||
{{ value|money(currency) }}
|
||||
{% else %}
|
||||
{{ value / 3600 }}
|
||||
{{ value|duration(true) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
Reference in New Issue
Block a user