0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-18 06:42:53 +00:00

fix duration and rate for html invoices ()

This commit is contained in:
Kevin Papst 2018-11-12 23:32:05 +01:00 committed by GitHub
parent 540318fcd0
commit 07cceca67e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions
templates/invoice/renderer

View file

@ -64,11 +64,20 @@
</thead>
<tbody>
{% for entry in model.calculator.entries %}
{% set duration = entry.duration|duration() %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}
{% elseif entry.hourlyRate is not null %}
{% set rate = entry.hourlyRate %}
{% else %}
{% set rate = app.user.getPreferenceValue('hourly_rate') %}
{% endif %}
<tr>
<td>{{ entry.begin|date_short }}</td>
<td>{{ entry.activity.name }} / {{ entry.project.name }}</td>
<td contenteditable="true">{{ app.user.getPreferenceValue('hourly_rate')|money(model.calculator.currency) }}</td>
<td>{{ entry.duration|duration }}</td>
<td contenteditable="true">{{ rate|money(model.calculator.currency) }}</td>
<td>{{ duration }}</td>
<td>{{ entry.rate|money(model.calculator.currency) }}</td>
</tr>
{% endfor %}

View file

@ -77,10 +77,20 @@
</thead>
<tbody>
{% for entry in model.calculator.entries %}
{% set duration = entry.duration|duration() %}
{% if entry.fixedRate is not null %}
{% set rate = entry.fixedRate %}
{% set duration = 1 %}
{% elseif entry.hourlyRate is not null %}
{% set rate = entry.hourlyRate %}
{% else %}
{% set rate = app.user.getPreferenceValue('hourly_rate') %}
{% endif %}
<tr>
<td contenteditable="true">{{ entry.description }}</td>
<td contenteditable="true">{{ app.user.getPreferenceValue('hourly_rate')|money(model.calculator.currency) }}</td>
<td contenteditable="true">{{ entry.duration|duration }}</td>
<td contenteditable="true">{{ rate|money(model.calculator.currency) }}</td>
<td contenteditable="true">{{ duration }}</td>
<td>{{ entry.rate|money(model.calculator.currency) }}</td>
</tr>
{% endfor %}