Files
kimai/templates/invoice/renderer/timesheet.html.twig
Kevin Papst 8069e332fe release 2.0 beta (#3722)
* remove twitter link
* remove WIP file
* adjust release draft message
* reset code coverage threshold back to 0.5
* changed wordings
* re-activate wizard for fixture accounts
* fix repo url and license
* license identifier
* bump version
* moved Kimai 1 import command from core to plugin
* do not traverse into invoice template subdirectories (#3735)
* fix branch alias
* composer update
* switch language on wizard select
* new twig function to create qr code
* fix daily stats in timesheet listing
* improved html invoice templates
2023-01-12 12:10:11 +01:00

130 lines
5.4 KiB
Twig

{% import "macros/widgets.html.twig" as widgets %}
{% extends 'invoice/layout.html.twig' %}
{% block invoice %}
{% set isDecimal = true %}
{% set project = model.query.project %}
{% set activity = model.query.activity %}
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
<span contenteditable="true">{{ model.template.title }}</span>
</h2>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table class="table no-border table-sm">
<tr>
<th class="ps-0">{{ 'invoice.from'|trans }}</th>
<td contenteditable="true">
{% if model.query.user is not empty %}
{{ widgets.username(model.query.user) }}
{% else %}
{{ model.template.company }}
{% endif %}
</td>
</tr>
<tr>
<th class="ps-0">{{ 'date'|trans }}</th>
<td contenteditable="true">
{% if model.query.begin|date('m') != model.query.end|date('m') or model.query.begin|date('Y') != model.query.end|date('Y') %}
{{ model.query.begin|date_short }} - {{ model.query.end|date_short }}
{% else %}
{{ model.query.end|month_name }} {{ model.query.end|date('Y') }}
{% endif %}
</td>
</tr>
<tr>
<th class="ps-0">{{ 'customer'|trans }}</th>
<td contenteditable="true">
{% if model.customer.number is not empty %}[{{ model.customer.number }}]{% endif %}
{{ model.customer.name }}{% if model.customer.contact is not empty %} / {{ model.customer.contact }}{% endif %}
</td>
</tr>
{% if project is not null %}
<tr>
<th class="ps-0">{{ 'project'|trans }}</th>
<td contenteditable="true">
{{ project.name }}
{% if project.orderNumber is not empty %}
({{ 'orderNumber'|trans }}: {{ project.orderNumber }})
{% endif %}
</td>
</tr>
{% endif %}
{% if activity is not null %}
<tr>
<th class="ps-0">{{ 'activity'|trans }}</th>
<td contenteditable="true">
{{ activity.name }}
</td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class="row invoice-items mt-2 mb-3">
<div class="col-xs-12 table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ 'date'|trans }}</th>
{% if model.query.user is empty %}
<th>{{ 'user'|trans }}</th>
{% endif %}
<th>{{ 'activity'|trans }}</th>
<th class="text-right">{{ 'hours'|trans }}</th>
</tr>
</thead>
<tbody>
{% for entry in model.calculator.entries %}
<tr>
<td>{{ entry.begin|date_short }}</td>
{% if model.query.user is empty %}
<td>{{ widgets.username(entry.user) }}</td>
{% endif %}
<td contenteditable="true">
{% if entry.description is not empty %}
{{ entry.description|nl2br }}
{% else %}
{% if entry.activity is not null %}{{ entry.activity.name }} / {% endif %}{{ entry.project.name }}
{% endif %}
</td>
<td class="text-right text-nowrap">{{ entry.duration|duration(isDecimal) }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th></th>
{% if model.query.user is empty %}
<th></th>
{% endif %}
<th>{{ 'invoice.total_working_time'|trans }}</th>
<th class="text-right text-nowrap">{{ model.calculator.timeWorked|duration(isDecimal) }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-12">
{% if model.template.paymentTerms is not empty %}
<p class="lead">{{ 'payment_terms'|trans }}</p>
<p class="text-muted well well-sm no-shadow" contenteditable="true" style="margin-bottom: 100px">
{{ model.template.paymentTerms|trim|nl2br }}
</p>
{% endif %}
<div class="table-responsive">
<p class="bt-1 pb-4 pt-1">{{ 'invoice.signature_user'|trans }}</p>
<p class="bt-1 pb-4 pt-1">{{ 'invoice.signature_customer'|trans }}</p>
</div>
</div>
</div>
{% endblock %}