Files
myep-team/templates/pdf/work_month.html.twig
T

140 lines
4.9 KiB
Twig

{#
The Arbeitszeitnachweis: one month of working time for one teamer, to be printed,
signed and uploaded again.
Rendered by App\Service\Pdf\WorkMonthRenderer through Dompdf, not by the FPDI renderers
the contract and the invoice use - a table of 28 to 31 rows is exactly what coordinate
stamping cannot do. Styles have to be inline and simple: Dompdf supports little beyond
CSS 2.1, and nothing may be loaded from outside the document.
#}
<style>
@page { margin: 18mm 15mm 20mm 15mm; }
body { font-family: "DejaVu Sans", sans-serif; font-size: 9pt; color: #000; }
h1 { font-size: 14pt; margin: 0 0 2mm 0; }
/* A table rather than a float: Dompdf lays tables out reliably, floats less so. */
table.letterhead { width: 100%; border-collapse: collapse; margin-bottom: 4mm; }
table.letterhead td { padding: 0; vertical-align: top; }
table.letterhead td.mark { text-align: right; width: 42mm; }
table.letterhead img { width: 38mm; height: 11.6mm; }
.meta { width: 100%; margin-bottom: 6mm; font-size: 9pt; }
.meta td { padding: 0.6mm 0; vertical-align: top; }
.meta .label { color: #444; width: 32mm; }
table.days { width: 100%; border-collapse: collapse; }
table.days th,
table.days td { border: 0.3pt solid #999; padding: 1.2mm 1.6mm; }
table.days th { background-color: #eee; font-size: 8.5pt; text-align: left; }
table.days td.num { text-align: right; }
table.days tr.weekend td { background-color: #f6f6f6; }
table.days tr.total td { font-weight: bold; background-color: #eee; }
.signature { margin-top: 14mm; }
.signature td { padding-top: 12mm; font-size: 8pt; color: #444; }
.signature .line { border-top: 0.4pt solid #000; width: 70mm; }
.note { margin-top: 6mm; font-size: 7.5pt; color: #555; }
</style>
<table class="letterhead">
<tr>
<td><h1>Arbeitszeitnachweis</h1></td>
<td class="mark">
{% if logo|default(null) %}
<img src="{{ logo }}" alt="E&amp;P Reisen Events">
{% endif %}
</td>
</tr>
</table>
<table class="meta">
<tr>
<td class="label">Teamer:in</td>
<td>{{ teamer.fullName }}</td>
</tr>
{% if workMonth.department %}
<tr>
<td class="label">Abteilung</td>
<td>{{ workMonth.department }}</td>
</tr>
{% endif %}
<tr>
<td class="label">Monat</td>
<td>{{ workMonth.period|format_datetime(pattern='LLLL yyyy', locale='de') }}</td>
</tr>
<tr>
<td class="label">Sollstunden</td>
<td>{{ workMonth.targetMinutes|duration_hm }}</td>
</tr>
<tr>
<td class="label">Iststunden</td>
<td><strong>{{ workMonth.totalMinutes|duration_hm }}</strong></td>
</tr>
<tr>
<td class="label">Saldo</td>
<td>{{ workMonth.balanceMinutes > 0 ? '+' : '' }}{{ workMonth.balanceMinutes|duration_hm }}</td>
</tr>
<tr>
<td class="label">Pausen gesamt</td>
<td>{{ workMonth.breakMinutes|duration_hm }}</td>
</tr>
<tr>
<td class="label">Arbeitstage</td>
<td>{{ workMonth.workedDays }}{% if workMonth.absenceDays > 0 %}, freie Tage: {{ workMonth.absenceDays }}{% endif %}</td>
</tr>
</table>
<table class="days">
<thead>
<tr>
<th style="width: 21mm;">Datum</th>
<th style="width: 13mm;">Tag</th>
<th style="width: 15mm;">Beginn</th>
<th style="width: 15mm;">Ende</th>
<th style="width: 15mm;">Pause</th>
<th style="width: 18mm;">Stunden</th>
<th>Abwesenheit</th>
</tr>
</thead>
<tbody>
{% for day in days %}
<tr{% if day.weekend %} class="weekend"{% endif %}>
<td>{{ day.date|date('d.m.Y') }}</td>
<td>{{ day.date|format_datetime(pattern='EEE', locale='de') }}</td>
<td class="num">{{ day.startTime ?? '' }}</td>
<td class="num">{{ day.endTime ?? '' }}</td>
<td class="num">{{ day.breakMinutes > 0 ? day.breakMinutes|duration_hm : '' }}</td>
<td class="num">{{ day.minutes|duration_hm }}</td>
<td>{{ day.absence ?? '' }}</td>
</tr>
{% endfor %}
<tr class="total">
<td colspan="4">Gesamt</td>
<td class="num">{{ workMonth.breakMinutes|duration_hm }}</td>
<td class="num">{{ workMonth.totalMinutes|duration_hm }}</td>
<td></td>
</tr>
</tbody>
</table>
<table class="signature">
<tr>
<td style="width: 50%;">
<div class="line"></div>
Ort, Datum
</td>
<td style="width: 50%;">
<div class="line"></div>
Unterschrift {{ teamer.fullName }}
</td>
</tr>
</table>
<p class="note">
Bitte den Nachweis unterschrieben wieder im Team-Portal hochladen.
Stand der Daten: {{ workMonth.syncedAt|date('d.m.Y H:i') }} Uhr.
</p>