Release 2.0.21 (#4030)
* increase padding in wizard * fix theme chooser in wizard * improve dynamic export columns in PDFs * added label for total column * bump theme bundle * improve avatar list spacing * be more flexible parsing times - fixes #4031
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
{% set showCustomerSummary = showCustomerSummary ?? true %}
|
||||
{% set showTotalSummary = showTotalSummary ?? true %}
|
||||
{% set showDateTimeShort = showDateTimeShort ?? false %}
|
||||
{% set showSummaryHourlyRate = showSummaryHourlyRate ?? false %}
|
||||
{% set now = create_date('now', app.user) %}
|
||||
{% set decimal = decimal ?? false %}
|
||||
{# this is only triggered, if a user exports from his personal timesheet screen #}
|
||||
@@ -14,8 +15,26 @@
|
||||
{# if exporting via the admin screen, users without view_rate_own_timesheet might still see their own rates #}
|
||||
{% set showRateColumn = is_granted('view_rate_own_timesheet') %}
|
||||
{% endif %}
|
||||
{% set summaryColumns = ['customer', 'project'] %}
|
||||
{% if showTimeBudget %}
|
||||
{% set summaryColumns = summaryColumns|merge(['timeBudget']) %}
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
{% set summaryColumns = summaryColumns|merge(['budget']) %}
|
||||
{% endif %}
|
||||
{% if showSummaryHourlyRate %}
|
||||
{% set summaryColumns = summaryColumns|merge(['hourlyRate']) %}
|
||||
{% endif %}
|
||||
{% set summaryColumns = summaryColumns|merge(['duration']) %}
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
{% set summaryColumns = summaryColumns|merge(['internalRate']) %}
|
||||
{% endif %}
|
||||
{% set summaryColumns = summaryColumns|merge(['rate']) %}
|
||||
{% endif %}
|
||||
<html{% if app.request is defined and app.request is not null %} lang="{{ app.request.locale }}"{% endif %}>
|
||||
<head>
|
||||
<title>{% block document_title %}{{ 'export'|trans }}{% endblock %}</title>
|
||||
{% block styles %}
|
||||
<style>
|
||||
{{ encore_entry_css_source('export-pdf')|raw }}
|
||||
@@ -64,21 +83,15 @@ mpdf-->
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'customer'|trans }}</th>
|
||||
<th>{{ 'project'|trans }}</th>
|
||||
{% if showTimeBudget %}
|
||||
<th class="center">{{ 'timeBudget'|trans }}</th>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<th class="center">{{ 'budget'|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="center">{{ 'duration'|trans }}</th>
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
<th class="center">{{ 'internalRate'|trans }}</th>
|
||||
{% for summaryColumn in summaryColumns %}
|
||||
{% if summaryColumn == 'customer' %}
|
||||
<th>{{ 'customer'|trans }}</th>
|
||||
{% elseif summaryColumn == 'project' %}
|
||||
<th>{{ 'project'|trans }}</th>
|
||||
{% else %}
|
||||
<th class="center">{{ summaryColumn|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="center">{{ 'rate'|trans }}</th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -106,21 +119,17 @@ mpdf-->
|
||||
{% endif %}
|
||||
{% if customer is not same as(summary.customer) %}
|
||||
<tr class="summary">
|
||||
<td colspan="2">
|
||||
</td>
|
||||
{% if showTimeBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
{% for summaryColumn in summaryColumns %}
|
||||
{% if summaryColumn == 'duration' %}
|
||||
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
{% elseif summaryColumn == 'internalRate' %}
|
||||
<td class="totals cost">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
{% elseif summaryColumn == 'rate' %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% else %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% set customer = summary.customer %}
|
||||
@@ -130,29 +139,34 @@ mpdf-->
|
||||
{% set customerCount = 0 %}
|
||||
{% endif %}
|
||||
<tr class="{{ cycle(['odd', 'even'], customerCount) }}">
|
||||
<td>{{ summary.customer }}</td>
|
||||
<td>{{ summary.project }}</td>
|
||||
{% if showTimeBudget %}
|
||||
<td class="center">
|
||||
{% if budgets[id] is defined and budgets[id].time_left > 0 %}
|
||||
{{ budgets[id].time_left|duration(decimal) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<td class="center">
|
||||
{% if budgets[id] is defined and budgets[id].money_left > 0 %}
|
||||
{{ budgets[id].money_left|money(summary.currency) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="duration">{{ summary.duration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
{% for summaryColumn in summaryColumns %}
|
||||
{% if summaryColumn == 'customer' %}
|
||||
<td>{{ summary.customer }}</td>
|
||||
{% elseif summaryColumn == 'project' %}
|
||||
<td>{{ summary.project }}</td>
|
||||
{% elseif summaryColumn == 'timeBudget' %}
|
||||
<td class="center">
|
||||
{% if budgets[id] is defined and budgets[id].time_left > 0 %}
|
||||
{{ budgets[id].time_left|duration(decimal) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% elseif summaryColumn == 'budget' %}
|
||||
<td class="center">
|
||||
{% if budgets[id] is defined and budgets[id].money_left > 0 %}
|
||||
{{ budgets[id].money_left|money(summary.currency) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% elseif summaryColumn == 'hourlyRate' %}
|
||||
{% set summaryHourlyRate = summary.duration/3600 %}
|
||||
<td class="cost">{{ summaryHourlyRate > 0 ? (summary.rate/summaryHourlyRate)|money(summary.currency) : '' }}</td>
|
||||
{% elseif summaryColumn == 'duration' %}
|
||||
<td class="duration">{{ summary.duration|duration(decimal) }}</td>
|
||||
{% elseif summaryColumn == 'internalRate' %}
|
||||
<td class="cost">{{ summary.rate_internal|money(summary.currency) }}</td>
|
||||
{% elseif summaryColumn == 'rate' %}
|
||||
<td class="cost">{{ summary.rate|money(summary.currency) }}</td>
|
||||
{% endif %}
|
||||
<td class="cost">{{ summary.rate|money(summary.currency) }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% set customerDuration = customerDuration + summary.duration %}
|
||||
{% set customerRate = customerRate + summary.rate %}
|
||||
@@ -161,20 +175,17 @@ mpdf-->
|
||||
{% endfor %}
|
||||
{% if showCustomerSummary and customer is not same as(null) %}
|
||||
<tr class="summary">
|
||||
<td colspan="2"></td>
|
||||
{% if showTimeBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
{% for summaryColumn in summaryColumns %}
|
||||
{% if summaryColumn == 'duration' %}
|
||||
<td class="totals duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
{% elseif summaryColumn == 'internalRate' %}
|
||||
<td class="totals cost">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
{% elseif summaryColumn == 'rate' %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% else %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if showTotalSummary and not multiCurrency %}
|
||||
@@ -182,19 +193,17 @@ mpdf-->
|
||||
<td class="totals" colspan="2">
|
||||
{{ 'sum.total'|trans }}
|
||||
</td>
|
||||
{% if showTimeBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals duration">{{ totalDuration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
{% if showInternalRate %}
|
||||
<td class="totals cost">{{ totalInternalRate|money(customerCurrency) }}</td>
|
||||
{% for summaryColumn in summaryColumns %}
|
||||
{% if summaryColumn == 'duration' %}
|
||||
<td class="totals duration">{{ totalDuration|duration(decimal) }}</td>
|
||||
{% elseif summaryColumn == 'internalRate' %}
|
||||
<td class="totals cost">{{ totalInternalRate|money(customerCurrency) }}</td>
|
||||
{% elseif summaryColumn == 'rate' %}
|
||||
<td class="totals cost">{{ totalRate|money(customerCurrency) }}</td>
|
||||
{% elseif summaryColumn not in ['customer', 'project'] %}
|
||||
<td></td>
|
||||
{% endif %}
|
||||
<td class="totals cost">{{ totalRate|money(customerCurrency) }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user