added internal rates (#1591)
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
{% extends 'export/renderer/default.pdf.twig' %}
|
||||
{% block summary %}
|
||||
{% for budget in budgets %}
|
||||
{% if budget.money_left > 0 %}
|
||||
{% set showRateBudget = true %}
|
||||
{% endif %}
|
||||
{% if budget.time_left > 0 %}
|
||||
{% set showTimeBudget = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
{% extends 'export/pdf-layout.html.twig' %}
|
||||
{% set showRateBudget = false %}
|
||||
{% set showTimeBudget = false %}
|
||||
{% for budget in budgets %}
|
||||
{% if budget.money_left > 0 %}
|
||||
{% set showRateBudget = true %}
|
||||
{% endif %}
|
||||
{% if budget.time_left > 0 %}
|
||||
{% set showTimeBudget = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
2
templates/export/renderer/default-internal.pdf.twig
Normal file
2
templates/export/renderer/default-internal.pdf.twig
Normal file
@@ -0,0 +1,2 @@
|
||||
{% extends 'export/pdf-layout.html.twig' %}
|
||||
{% set showInternalRate = true %}
|
||||
@@ -51,6 +51,7 @@
|
||||
'hourlyRate': false,
|
||||
'fixedRate': false,
|
||||
'duration': 'label.duration',
|
||||
'rate_internal': 'label.rate_internal',
|
||||
'rate': 'label.rate',
|
||||
}) %}
|
||||
|
||||
@@ -63,38 +64,40 @@
|
||||
document.getElementById('summary-show').addEventListener('click', function(event) {
|
||||
document.getElementById('export-summary').style.display = event.target.checked ? 'block' : 'none';
|
||||
});
|
||||
{% if showTimeBudget %}
|
||||
document.getElementById('summary-timeBudget').addEventListener('click', function(event) {
|
||||
var cells = document.getElementsByClassName('export-timeBudget');
|
||||
for (var columnCell of cells) {
|
||||
columnCell.style.display = event.target.checked ? 'table-cell' : 'none';
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
document.getElementById('summary-budget').addEventListener('click', function(event) {
|
||||
var cells = document.getElementsByClassName('export-budget');
|
||||
for (var columnCell of cells) {
|
||||
columnCell.style.display = event.target.checked ? 'table-cell' : 'none';
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
document.getElementById('summary-duration').addEventListener('click', function(event) {
|
||||
if (!document.getElementById('summary-rate').checked) {
|
||||
return;
|
||||
}
|
||||
document.getElementById('summary-rate').disabled = !event.target.checked;
|
||||
var cells = document.getElementsByClassName('summary-duration');
|
||||
for (var columnCell of cells) {
|
||||
columnCell.style.display = event.target.checked ? 'table-cell' : 'none';
|
||||
}
|
||||
});
|
||||
document.getElementById('summary-rate').addEventListener('click', function(event) {
|
||||
if (!document.getElementById('summary-duration').checked) {
|
||||
return;
|
||||
}
|
||||
document.getElementById('summary-duration').disabled = !event.target.checked;
|
||||
var cells = document.getElementsByClassName('summary-rate');
|
||||
for (var columnCell of cells) {
|
||||
columnCell.style.display = event.target.checked ? 'table-cell' : 'none';
|
||||
}
|
||||
});
|
||||
document.getElementById('summary-rate-internal').addEventListener('click', function(event) {
|
||||
var cells = document.getElementsByClassName('summary-rate-internal');
|
||||
for (var columnCell of cells) {
|
||||
columnCell.style.display = event.target.checked ? 'table-cell' : 'none';
|
||||
}
|
||||
});
|
||||
document.getElementById('summary-show').addEventListener('click', function(event) {
|
||||
document.getElementById('export-summary').style.display = event.target.checked ? 'block' : 'none';
|
||||
});
|
||||
@@ -177,6 +180,12 @@
|
||||
{{ 'label.duration'|trans }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="summary-rate-internal">
|
||||
<input type="checkbox" id="summary-rate-internal" name="summary-rate-internal" checked>
|
||||
{{ 'label.rate_internal'|trans }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="summary-rate">
|
||||
<input type="checkbox" id="summary-rate" name="summary-rate" checked>
|
||||
@@ -232,6 +241,7 @@
|
||||
<th class="center export-budget">{{ 'label.budget'|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="duration summary-duration">{{ 'label.duration'|trans }}</th>
|
||||
<th class="cost summary-rate-internal">{{ 'label.rate_internal'|trans }}</th>
|
||||
<th class="cost summary-rate">{{ 'label.rate'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -239,6 +249,7 @@
|
||||
{% set customer = null %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% set customerInternalRate = 0 %}
|
||||
{% set customerCurrency = null %}
|
||||
{% for id, summary in summaries %}
|
||||
{% if customer is same as(null) %}
|
||||
@@ -247,7 +258,7 @@
|
||||
{% endif %}
|
||||
{% if customer is not same as(summary.customer) %}
|
||||
<tr class="summary">
|
||||
<td colspan="2"></td>
|
||||
<td colspan="2"> </td>
|
||||
{% if showTimeBudget %}
|
||||
<td class="export-timeBudget"></td>
|
||||
{% endif %}
|
||||
@@ -255,12 +266,14 @@
|
||||
<td class="export-budget"></td>
|
||||
{% endif %}
|
||||
<td class="totals duration summary-duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
<td class="totals cost summary-rate-internal">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
<td class="totals cost summary-rate">{{ customerRate|money(customerCurrency) }}</td>
|
||||
</tr>
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% set customerInternalRate = 0 %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>{{ summary.customer }}</td>
|
||||
@@ -280,14 +293,16 @@
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="duration summary-duration">{{ summary.duration|duration(decimal) }}</td>
|
||||
<td class="cost summary-rate-internal">{{ summary.rate_internal|money(summary.currency) }}</td>
|
||||
<td class="cost summary-rate">{{ summary.rate|money(summary.currency) }}</td>
|
||||
</tr>
|
||||
{% set customerDuration = customerDuration + summary.duration %}
|
||||
{% set customerRate = customerRate + summary.rate %}
|
||||
{% set customerInternalRate = customerInternalRate + summary.rate_internal %}
|
||||
{% endfor %}
|
||||
{% if customer is not same as(null) %}
|
||||
<tr class="summary">
|
||||
<td colspan="2"></td>
|
||||
<td colspan="2"> </td>
|
||||
{% if showTimeBudget %}
|
||||
<td class="export-timeBudget"></td>
|
||||
{% endif %}
|
||||
@@ -295,12 +310,19 @@
|
||||
<td class="export-budget"></td>
|
||||
{% endif %}
|
||||
<td class="totals duration summary-duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
<td class="totals cost summary-rate-internal">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
<td class="totals cost summary-rate">{{ customerRate|money(customerCurrency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{#
|
||||
============================================
|
||||
SUMMARY: BY ACTIVITY
|
||||
============================================
|
||||
#}
|
||||
|
||||
<table class="items table table-condensed table-bordered dataTable" id="summary-activity" style="display:none">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -308,6 +330,7 @@
|
||||
<th>{{ 'label.project'|trans }}</th>
|
||||
<th>{{ 'label.activity'|trans }}</th>
|
||||
<th class="duration summary-duration">{{ 'label.duration'|trans }}</th>
|
||||
<th class="cost summary-rate-internal">{{ 'label.rate_internal'|trans }}</th>
|
||||
<th class="cost summary-rate">{{ 'label.rate'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -315,39 +338,45 @@
|
||||
{% set customer = null %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% set customerInternalRate = 0 %}
|
||||
{% set customerCurrency = null %}
|
||||
{% for summary in summaries %}
|
||||
{% if customer is same as(null) %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% endif %}
|
||||
{% if customer is not same as(summary.customer) %}
|
||||
<tr class="summary">
|
||||
<td colspan="3"></td>
|
||||
<td class="totals duration summary-duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
<td class="totals cost summary-rate">{{ customerRate|money(customerCurrency) }}</td>
|
||||
</tr>
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% endif %}
|
||||
{% for activitySummary in summary.activities %}
|
||||
<tr>
|
||||
<td>{{ summary.customer }}</td>
|
||||
<td>{{ summary.project }}</td>
|
||||
<td>{{ activitySummary.activity }}</td>
|
||||
<td class="duration summary-duration">{{ activitySummary.duration|duration(decimal) }}</td>
|
||||
<td class="cost summary-rate">{{ activitySummary.rate|money(activitySummary.currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% set customerDuration = customerDuration + summary.duration %}
|
||||
{% set customerRate = customerRate + summary.rate %}
|
||||
{% if customer is same as(null) %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% endif %}
|
||||
{% if customer is not same as(summary.customer) %}
|
||||
<tr class="summary">
|
||||
<td colspan="3"></td>
|
||||
<td class="totals duration summary-duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
<td class="totals cost summary-rate-internal">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
<td class="totals cost summary-rate">{{ customerRate|money(customerCurrency) }}</td>
|
||||
</tr>
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% set customerInternalRate = 0 %}
|
||||
{% endif %}
|
||||
{% for activitySummary in summary.activities %}
|
||||
<tr>
|
||||
<td>{{ summary.customer }}</td>
|
||||
<td>{{ summary.project }}</td>
|
||||
<td>{{ activitySummary.activity }}</td>
|
||||
<td class="duration summary-duration">{{ activitySummary.duration|duration(decimal) }}</td>
|
||||
<td class="cost summary-rate-internal">{{ activitySummary.rate_internal|money(activitySummary.currency) }}</td>
|
||||
<td class="cost summary-rate">{{ activitySummary.rate|money(activitySummary.currency) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% set customerDuration = customerDuration + summary.duration %}
|
||||
{% set customerRate = customerRate + summary.rate %}
|
||||
{% set customerInternalRate = customerInternalRate + summary.rate_internal %}
|
||||
{% endfor %}
|
||||
{% if customer is not same as(null) %}
|
||||
<tr class="summary">
|
||||
<td colspan="3"></td>
|
||||
<td class="totals duration summary-duration">{{ customerDuration|duration(decimal) }}</td>
|
||||
<td class="totals cost summary-rate-internal">{{ customerInternalRate|money(customerCurrency) }}</td>
|
||||
<td class="totals cost summary-rate">{{ customerRate|money(customerCurrency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
@@ -372,10 +401,16 @@
|
||||
<tbody>
|
||||
{% set timeWorked = 0 %}
|
||||
{% set rateTotal = 0 %}
|
||||
{% set rateInternalTotal = 0 %}
|
||||
{% set currency = false %}
|
||||
{% for entry in entries %}
|
||||
{% set timeWorked = timeWorked + entry.duration %}
|
||||
{% set rateTotal = rateTotal + entry.rate %}
|
||||
{% if entry.internalRate is defined %}
|
||||
{% set rateInternalTotal = rateInternalTotal + entry.internalRate %}
|
||||
{% else %}
|
||||
{% set rateInternalTotal = rateInternalTotal + entry.rate %}
|
||||
{% endif %}
|
||||
{% if currency is same as(false) %}
|
||||
{% set currency = entry.project.customer.currency %}
|
||||
{% endif %}
|
||||
@@ -459,6 +494,13 @@
|
||||
<td class="column-duration text-nowrap" {% if not columns.duration %}style="display: none"{% endif %}>
|
||||
{{ entry.duration|duration(decimal) }}
|
||||
</td>
|
||||
<td class="column-rate_internal text-nowrap" {% if not columns.rate_internal %}style="display: none"{% endif %}>
|
||||
{% if entry.internalRate is defined %}
|
||||
{{ entry.internalRate|money(entry.project.customer.currency) }}
|
||||
{% else %}
|
||||
{{ entry.rate|money(entry.project.customer.currency) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="column-rate text-nowrap" {% if not columns.rate %}style="display: none"{% endif %}>
|
||||
{{ entry.rate|money(entry.project.customer.currency) }}
|
||||
</td>
|
||||
@@ -467,13 +509,20 @@
|
||||
{# leave in tbody instead of adding it to tfoot, as tfoot will be repeated on each page when printing #}
|
||||
<tr>
|
||||
{% for id, visibility in columns %}
|
||||
{% if id != 'duration' and id != 'rate' %}
|
||||
{% if id not in ['duration', 'rate', 'rate_internal'] %}
|
||||
<th class="column-{{ id }}" {% if not visibility %}style="display: none"{% endif %}></th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<th class="text-nowrap column-duration">
|
||||
{{- timeWorked|duration(decimal) -}}
|
||||
</th>
|
||||
<th class="text-nowrap column-rate_internal">
|
||||
{%- if currency is not null and currency is not same as(false) %}
|
||||
{{ rateInternalTotal|money(currency) }}
|
||||
{% else %}
|
||||
{{ rateInternalTotal|money }}
|
||||
{% endif -%}
|
||||
</th>
|
||||
<th class="text-nowrap column-rate">
|
||||
{%- if currency is not null and currency is not same as(false) %}
|
||||
{{ rateTotal|money(currency) }}
|
||||
|
||||
@@ -1,274 +1 @@
|
||||
{% set showUserColumn = true %}
|
||||
{% set showRateColumn = true %}
|
||||
{% set decimal = decimal|default(false) %}
|
||||
{% set showRateBudget = false %}
|
||||
{% set showTimeBudget = false %}
|
||||
{% if query.user %}
|
||||
{# this is only triggered, if a user exports from his personal timesheet screen#}
|
||||
{% set showUserColumn = false %}
|
||||
{% set showRateColumn = is_granted('view_rate_own_timesheet') %}
|
||||
{# TODO if exporting via the admin screen, users without view_rate_own_timesheet might still see their own rates, maybe merge view_rate_own_timesheet and view_rate_other_timesheet into a new view_rate permission? #}
|
||||
{% endif %}
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
table.items {
|
||||
border: 0.1mm solid #000000;
|
||||
width: 100%;
|
||||
font-size: 9pt;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
td, th {
|
||||
padding: 7px;
|
||||
}
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
.items td {
|
||||
border-left: 0.1mm solid #000000;
|
||||
border-right: 0.1mm solid #000000;
|
||||
}
|
||||
.items tr.even {
|
||||
/*background-color: #e0ebff;*/
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.items tr.summary {
|
||||
background-color: #efefef;
|
||||
}
|
||||
.items tr.summary td {
|
||||
font-weight: bold;
|
||||
border-top: 0.1mm solid #000000;
|
||||
border-bottom: 0.1mm solid #000000;
|
||||
}
|
||||
table thead th {
|
||||
background-color: #ececec;
|
||||
border: 0.1mm solid #000000;
|
||||
font-weight: bold;
|
||||
font-size: 10pt;
|
||||
text-align: left;
|
||||
}
|
||||
.items td.totals {
|
||||
font-weight: bold;
|
||||
border: 0.1mm solid #000000;
|
||||
}
|
||||
.items .center,
|
||||
.items td.duration,
|
||||
.items td.cost {
|
||||
text-align: center;
|
||||
}
|
||||
.text-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!--mpdf
|
||||
<htmlpagefooter name="myfooter">
|
||||
<table style="border-top: 1px solid #000000; font-size: 9pt; padding-top: 3mm; width: 100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
{{ 'export.page_of'|trans({'%page%': '{PAGENO}', '%pages%': '{nb}'}) }}
|
||||
{% if not showUserColumn %}
|
||||
–
|
||||
{{ 'label.user'|trans }}: {{ query.user.displayName }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td align="right">
|
||||
{% if kimai_context.branding.company is not empty %}
|
||||
{{ kimai_context.branding.company|raw }} – {{ now|date_full }}
|
||||
{% else %}
|
||||
{{ 'export.date_copyright'|trans({'%date%': now|date_full, '%kimai%': '<a href="' ~ constant('App\\Constants::HOMEPAGE') ~ '">' ~ constant('App\\Constants::SOFTWARE') ~ '</a>'})|raw }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
<sethtmlpagefooter name="myfooter" value="on" />
|
||||
mpdf-->
|
||||
{% block summary %}
|
||||
<h2 style="margin-bottom: 0; padding-bottom: 0">{{ 'export.document_title'|trans }}</h2>
|
||||
<p>
|
||||
{{ 'export.period'|trans }}:
|
||||
{{ query.begin|date_short }} - {{ query.end|date_short }}
|
||||
</p>
|
||||
<h3>{{ 'export.summary'|trans }}</h3>
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'label.customer'|trans }}</th>
|
||||
<th>{{ 'label.project'|trans }}</th>
|
||||
{% if showTimeBudget %}
|
||||
<th class="center">{{ 'label.timeBudget'|trans }}</th>
|
||||
{% endif %}
|
||||
{% if showRateBudget %}
|
||||
<th class="center">{{ 'label.budget'|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="center">{{ 'label.duration'|trans }}</th>
|
||||
{% if showRateColumn %}
|
||||
<th class="center">{{ 'label.rate'|trans }}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set customer = null %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% set customerCurrency = null %}
|
||||
{% set customerCount = 0 %}
|
||||
{% for id, summary in summaries %}
|
||||
{% if customer is same as(null) %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% 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 %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% set customerCurrency = summary.currency %}
|
||||
{% set customer = summary.customer %}
|
||||
{% set customerDuration = 0 %}
|
||||
{% set customerRate = 0 %}
|
||||
{% 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 %}
|
||||
<td class="cost">{{ summary.rate|money(summary.currency) }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% set customerDuration = customerDuration + summary.duration %}
|
||||
{% set customerRate = customerRate + summary.rate %}
|
||||
{% set customerCount = customerCount + 1 %}
|
||||
{% endfor %}
|
||||
{% if 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 %}
|
||||
<td class="totals cost">{{ customerRate|money(customerCurrency) }}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<pagebreak>
|
||||
{% endblock %}
|
||||
|
||||
{% block items %}
|
||||
<h3>{{ 'export.full_list'|trans }}</h3>
|
||||
|
||||
{% set duration = 0 %}
|
||||
{% set rate = 0 %}
|
||||
{% set currency = false %}
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'label.date'|trans }}</th>
|
||||
{% if showUserColumn %}
|
||||
<th>{{ 'label.user'|trans }}</th>
|
||||
{% endif %}
|
||||
<th>{{ 'label.description'|trans }}</th>
|
||||
<th class="center">{{ 'label.duration'|trans }}</th>
|
||||
{% if showRateColumn %}
|
||||
<th class="center">{{ 'label.rate'|trans }}</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
{% set duration = duration + entry.duration %}
|
||||
{% if currency is same as(false) %}
|
||||
{% set currency = entry.project.customer.currency %}
|
||||
{% endif %}
|
||||
{% if currency is not same as(entry.project.customer.currency) %}
|
||||
{% set currency = null %}
|
||||
{% endif %}
|
||||
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
|
||||
<td class="text-nowrap">
|
||||
{{ entry.begin|date_time }}
|
||||
{% if entry.end %}
|
||||
<br>
|
||||
{{ entry.end|date_time }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if showUserColumn %}
|
||||
<td>{{ entry.user.displayName }}</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
{{ entry.project.customer.name }} - {{ entry.project.name }}{% if entry.activity is not null %} - {{ entry.activity.name }}{% endif %}
|
||||
{% if entry.description is not empty %}
|
||||
<br>
|
||||
<i>{{ entry.description|escape|desc2html }}</i>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="duration">{{ entry.duration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
<td class="cost">
|
||||
{% if is_granted('view_rate', entry) %}
|
||||
{% set rate = rate + entry.rate %}
|
||||
{{ entry.rate|money(entry.project.customer.currency) }}
|
||||
{% else %}
|
||||
–
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="summary">
|
||||
{% if showUserColumn %}
|
||||
<td colspan="3"></td>
|
||||
{% else %}
|
||||
<td colspan="2"></td>
|
||||
{% endif %}
|
||||
<td class="totals duration">{{ duration|duration(decimal) }}</td>
|
||||
{% if showRateColumn %}
|
||||
<td class="totals cost">{% if currency is not null %}{{ rate|money(currency) }}{% endif %}</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{% extends 'export/pdf-layout.html.twig' %}
|
||||
|
||||
Reference in New Issue
Block a user