Files
mareike/resources/views/pdfs/income-surplus-statement.blade.php

237 lines
6.2 KiB
PHP

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<style>
@page {
margin: 15mm 12mm;
}
body {
font-family: DejaVu Sans, sans-serif;
font-size: 10pt;
color: #000;
}
h1 {
font-size: 15pt;
margin: 0 0 2mm;
}
h2 {
font-size: 11pt;
letter-spacing: 1px;
margin: 8mm 0 2mm;
border-bottom: 1px solid #000;
padding-bottom: 1mm;
}
.subline {
font-size: 9pt;
color: #444;
margin-bottom: 2mm;
}
/* Die Rechnung selbst: keine Rahmen, nur Linien vor den Summen -- so liest sich eine Aufstellung
schneller als eine Gittertabelle. */
table.statement {
width: 100%;
border-collapse: collapse;
}
table.statement td {
padding: 1.2mm 0;
vertical-align: top;
}
table.statement td.value {
text-align: right;
width: 30mm;
white-space: nowrap;
}
tr.category td {
font-weight: bold;
padding-top: 3mm;
}
tr.entry td.label {
padding-left: 8mm;
color: #333;
}
tr.entry td.value {
color: #333;
}
tr.sum td {
font-weight: bold;
border-top: 1px solid #000;
padding-top: 1.5mm;
}
tr.result td {
font-weight: bold;
font-size: 12pt;
padding-top: 5mm;
}
.positive { color: #4caf50; }
.negative { color: #f44336; }
.footnote {
margin-top: 10mm;
font-size: 8pt;
color: #444;
line-height: 1.4;
}
.page-break {
page-break-before: always;
}
/* Die Anlage bleibt eine klassische Belegtabelle mit Rahmen. */
table.receipts {
width: 100%;
border-collapse: collapse;
margin-bottom: 6mm;
}
table.receipts th,
table.receipts td {
border: 1px solid #000;
padding: 4px 6px;
font-size: 8pt;
vertical-align: top;
}
table.receipts th {
background: #f2f2f2;
font-weight: bold;
text-align: left;
}
table.receipts td.value,
table.receipts th.value {
text-align: right;
white-space: nowrap;
width: 22mm;
}
table.receipts tr.group-sum td {
font-weight: bold;
background: #fafafa;
}
h3 {
font-size: 10pt;
margin: 5mm 0 1.5mm;
}
</style>
</head>
<body>
<h1>Einnahmen-Überschuss-Rechnung</h1>
<div class="subline">
{{ $event->name }}
&middot; {{ $event->start_date->format('d.m.Y') }}&ndash;{{ $event->end_date->format('d.m.Y') }}
@if($event->location)&middot; {{ $event->location }}@endif
&middot; Stand: {{ $createdAt }}
</div>
<h2>Einnahmen</h2>
<table class="statement">
@foreach($income['categories'] as $category)
<tr class="category">
<td>{{ $category['name'] }}</td>
<td class="value">{{ $money($category['total']) }} &euro;</td>
</tr>
@foreach($category['entries'] as $entry)
<tr class="entry">
<td class="label">{{ $entry['name'] }}</td>
<td class="value">{{ $money($entry['amount']) }} &euro;</td>
</tr>
@endforeach
@endforeach
<tr class="sum">
<td>Summe Einnahmen</td>
<td class="value">{{ $money($income['total']) }} &euro;</td>
</tr>
</table>
<h2>Ausgaben</h2>
<table class="statement">
@foreach($expenses['groups'] as $group)
<tr class="entry">
<td class="label">{{ $group['name'] }}</td>
<td class="value">{{ $money($group['sum']) }} &euro;</td>
</tr>
@endforeach
<tr class="sum">
<td>Summe Ausgaben</td>
<td class="value">{{ $money($expenses['total']) }} &euro;</td>
</tr>
</table>
<table class="statement">
<tr class="result">
<td class="{{ $result->getAmount() >= 0 ? 'positive' : 'negative' }}">
{{ $result->getAmount() >= 0 ? 'Überschuss' : 'Fehlbetrag' }}
</td>
<td class="value {{ $result->getAmount() >= 0 ? 'positive' : 'negative' }}">
{{ $money($result) }} &euro;
</td>
</tr>
</table>
<div class="footnote">
Berücksichtigt sind nur tatsächlich vereinnahmte Beiträge und erfasste Belege. Nicht enthalten sind
offene Beiträge, Budget- und Schätzwerte, erstattete Beiträge sowie Auslagen, auf deren Auszahlung
verzichtet wurde.
@if($event->tax_liable)
<br />Alle Beträge sind Bruttobeträge inklusive {{ $event->vat_rate }} % Umsatzsteuer.
@endif
</div>
@php
$documentedGroups = array_filter($expenses['groups'], fn ($group) => count($group['rows']) > 0);
@endphp
@if(count($documentedGroups) > 0)
<div class="page-break"></div>
<h1>Anlage: Belege</h1>
<div class="subline">{{ $event->name }} &middot; Stand: {{ $createdAt }}</div>
@foreach($documentedGroups as $group)
<h3>{{ $group['name'] }}</h3>
<table class="receipts">
<thead>
<tr>
<th style="width: 22mm;">Beleg-Nr.</th>
<th style="width: 18mm;">Datum</th>
<th>Zweck</th>
<th class="value">Betrag</th>
</tr>
</thead>
<tbody>
@foreach($group['rows'] as $row)
<tr>
<td>{{ $row['number'] }}</td>
<td>{{ $row['date'] }}</td>
<td>{{ $row['purpose'] }}</td>
<td class="value">{{ $money($row['amount']) }} &euro;</td>
</tr>
@endforeach
<tr class="group-sum">
<td colspan="3">Zwischensumme {{ $group['name'] }}</td>
<td class="value">{{ $money($group['sum']) }} &euro;</td>
</tr>
</tbody>
</table>
@endforeach
@endif
</body>
</html>