226 lines
7.4 KiB
PHP
226 lines
7.4 KiB
PHP
<!DOCTYPE html lang="de">
|
||
<html>
|
||
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Rechnung {{ $invoice['nr'] }}</title>
|
||
@if($isPDF)
|
||
<link rel="stylesheet" href="{{ public_path('/storage/css/invoice.css') }}">
|
||
@else
|
||
<link rel="stylesheet" href="/storage/css/invoice.css">
|
||
@endif
|
||
|
||
<style>
|
||
@font-face {
|
||
font-family: 'Clear Sans';
|
||
src: url('{{ $fontPath }}/ClearSans-Regular.ttf') format('truetype');
|
||
font-weight: normal;
|
||
font-style: normal;
|
||
}
|
||
|
||
@font-face {
|
||
font-family: 'Clear Sans';
|
||
src: url('{{ $fontPath }}/ClearSans-Bold.ttf') format('truetype');
|
||
font-weight: bold;
|
||
font-style: normal;
|
||
}
|
||
|
||
@font-face {
|
||
font-family: 'Clear Sans';
|
||
src: url('{{ $fontPath }}/ClearSans-Medium.ttf') format('truetype');
|
||
font-weight: medium;
|
||
font-style: normal;
|
||
}
|
||
|
||
@font-face {
|
||
font-family: 'Clear Sans';
|
||
src: url('{{ $fontPath }}/ClearSans-Light.ttf') format('truetype');
|
||
font-weight: light;
|
||
font-style: normal;
|
||
}
|
||
</style>
|
||
</head>
|
||
|
||
<body>
|
||
<!-- Fixed page elements need to bee direct descendents of body for Dompdf -->
|
||
<!-- see https://github.com/dompdf/dompdf/issues/1190 -->
|
||
<img id="logo"
|
||
@if($isPDF)
|
||
src="{{ public_path('storage/pdf/Logo.svg') }}"
|
||
@else
|
||
src="/storage/pdf/Logo.svg"
|
||
@endif />
|
||
|
||
<address>
|
||
<div class="sender">
|
||
{{ $companyName }},
|
||
{{ $companyAddress['lineOne'] }},
|
||
@if($companyAddress['lineTwo'])
|
||
{{ $companyAddress['lineTwo'] }}
|
||
@endif
|
||
{{ $companyAddress['postalCode'] }}
|
||
{{ $companyAddress['city'] }}
|
||
</div>
|
||
<div class="recipient">
|
||
{{ $invoice['customer']['companyName'] }}<br />
|
||
{{ $invoice['billingData']['contactFirstName'] }} {{ $invoice['billingData']['contactLastName'] }}<br />
|
||
@if($invoice['billingData']['billingAddress']['lineOne'])
|
||
{{ $invoice['billingData']['billingAddress']['lineOne'] }}<br />
|
||
@endif
|
||
@if($invoice['billingData']['billingAddress']['lineTwo'])
|
||
{{ $invoice['billingData']['billingAddress']['lineTwo'] }}<br />
|
||
@endif
|
||
{{ $invoice['billingData']['billingAddress']['postalCode'] }} {{ $invoice['billingData']['billingAddress']['city'] }}
|
||
</div>
|
||
</address>
|
||
|
||
|
||
<table id="meta">
|
||
<tbody>
|
||
<tr>
|
||
<th>Rechnungs-Nr.</th>
|
||
<td>
|
||
@if($invoice['paymentStatus'] == 'draft')
|
||
Entwurf
|
||
@else
|
||
{{ $invoice['nr'] }}
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@if($invoice['customer']['customerNr'])
|
||
<tr>
|
||
<th>Kunden-Nr.</th>
|
||
<td>
|
||
{{ $invoice['customer']['customerNr'] }}
|
||
</td>
|
||
</tr>
|
||
@endif
|
||
<tr>
|
||
<th>Datum</th>
|
||
<td>
|
||
@php
|
||
$fmt = new \IntlDateFormatter('de_DE', NULL, NULL);
|
||
$fmt->setPattern('d. MMMM yyyy');
|
||
@endphp
|
||
<date>{{ $fmt->format(strtotime($invoice['invoiceDate'])) }}</date>
|
||
</td>
|
||
</tr>
|
||
@if( !$invoice['billingData']['paymentTerms']['isFixed'] )
|
||
<tr>
|
||
<th>Fälligkeitsdatum</th>
|
||
<td>
|
||
<date>{{ $fmt->format(strtotime($invoice['dueDate'])) }}</date>
|
||
</td>
|
||
</tr>
|
||
@endif
|
||
@if(false)
|
||
<tr>
|
||
<th>Leistungsdatum</th>
|
||
<td>
|
||
<date>{{ $fmt->format(strtotime($invoice['service_date'])) }}</date>
|
||
</td>
|
||
</tr>
|
||
@else
|
||
<tr>
|
||
<th>Leistungszeitraum</th>
|
||
<td>{{ $fmt->format(strtotime($invoice['serviceStartDate'])) }} –<br />{{ $fmt->format(strtotime($invoice['serviceEndDate'])) }}</td>
|
||
</tr>
|
||
@endif
|
||
</tbody>
|
||
</table>
|
||
|
||
<h1>Rechnung</h1>
|
||
<h2>{{ $invoice['title'] }}</h2>
|
||
|
||
@if($invoice['text'])
|
||
<div class="text">
|
||
{!! nl2br(e($invoice['text'])) !!}
|
||
</div>
|
||
@endif
|
||
|
||
<table id="line-items">
|
||
<thead>
|
||
<tr>
|
||
<th>Pos.</th>
|
||
<th>Bezeichnung</th>
|
||
<th>Menge</th>
|
||
<th>Einheit</th>
|
||
<th>Einzelpreis</th>
|
||
<th>Gesamtpreis</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
|
||
@foreach ($invoice['items'] as $item)
|
||
@if($item['isSection'])
|
||
<tr class="section-title">
|
||
<td colspan="6">
|
||
<h3>{{ $item['title'] }}</h3>
|
||
@if($item['description'])
|
||
<p>{{ $item['description'] }}</p>
|
||
@endif
|
||
</td>
|
||
</tr>
|
||
@else
|
||
<tr class="line-item">
|
||
<td>{{ $item['position'] }}</td>
|
||
<td>
|
||
<strong>{{ $item['title'] }}</strong><br>
|
||
{{ $item['description'] }}
|
||
</td>
|
||
<td>@toCommaFloat($item['quantity'])</td>
|
||
<td>{{ $item['unit']['name'] }}</td>
|
||
<td>@toCurrency($item['price'])</td>
|
||
<td>@toCurrency($item['quantity'] * $item['price'])</td>
|
||
</tr>
|
||
@endif
|
||
@endforeach
|
||
|
||
</tbody>
|
||
<tfoot>
|
||
<tr>
|
||
<td colspan="5">Nettobetrag</td>
|
||
<td>@toCurrency($invoice['totalAmount'])</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="5">19 % MwSt.</td>
|
||
<td>@toCurrency(round($invoice['totalAmount'] * 0.19, 2))</td>
|
||
</tr>
|
||
<tr>
|
||
<td colspan="5">Gesamt brutto</td>
|
||
<td>@toCurrency($invoice['totalAmount'] + round($invoice['totalAmount'] * 0.19, 2))</td>
|
||
</tr>
|
||
</tfoot>
|
||
</table>
|
||
|
||
<!-- TODO: Kleingedrucktes aus settings -->
|
||
<div id="fine-print">
|
||
@if($invoice['billingData']['paymentTerms']['isFixed'])
|
||
<p>Zahlungsziel {{ $invoice['billingData']['paymentTerms']['description'] }}</p>
|
||
@else
|
||
<p>Zahlungsziel {{ $invoice['billingData']['paymentTerms']['days'] }} Tage</p>
|
||
@endif
|
||
</div>
|
||
|
||
<div id="giro-code">
|
||
<img src="data:image/svg+xml;base64,{{ $giroCode }}" />
|
||
<p>
|
||
<strong>GiroCode/EPC-QR-Code</strong><br />
|
||
Der Code enthält alle relevanten Zahlungsdaten. Mit Ihrer Banking App können Sie den Code scannen und die Zahlung als Überweisung ausführen.
|
||
</p>
|
||
</div>
|
||
|
||
<footer>
|
||
<!-- TODO: Footertext aus Settings -->
|
||
Tooloop Multimedia Daniel Stock, Rehmstraße 4, 86161 Augsburg, Tel. +49 821 65079983, www.tooloop.de<br />
|
||
Stadtsparkasse Augsburg, DE40 7205 0000 0251 5125 13, BIC AUGSDE77XXX, Ust-IdNr. DE309558315
|
||
</footer>
|
||
|
||
<pagination>
|
||
<span class="page-number number"></span> von {{ $totalPages }}
|
||
</pagination>
|
||
|
||
</body>
|
||
|
||
</html> |