fix duration and rate for html invoices (#414)
This commit is contained in:
@@ -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 %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user