@php
$netto = $invoice->subtotal;
$vatRate = (float) $invoice->vat_rate;
$mwst = $invoice->vat_amount;
$brutto = $invoice->total;
$customer = $order->customer;
$custAddress = $customer?->address ?? '';
if (str_contains($custAddress, ',')) {
[$custStreet, $custCity] = array_map('trim', explode(',', $custAddress, 2));
} else {
$custStreet = $custAddress;
$custCity = '';
}
$typeLabel = $invoice->type_labal; // "Zwischenrechnung N" oder "Schlussrechnung"
$payable = $invoice->type === 'schluss'
? max(0, $brutto - ($abschlagDeduction ?? 0))
: $brutto;
@endphp
{{ $typeLabel }} {{ $invoiceNr }}
{{-- Kopfbereich --}}
|
{{ $company->name }} * {{ $company->str }} {{ $company->hn }} * {{ $company->plz }} {{ $company->ort }}
{{ $customer?->name ?? '' }}
{{ $custStreet }}
{{ $custCity }}
|
))) }})
{{ $company->str }} {{ $company->hn }}
{{ $company->plz }} {{ $company->ort }}
@if($company->tel)Tel.: {{ $company->tel }} @endif
@if($company->email)E-Mail: {{ $company->email }} @endif
| Datum: |
{{ \Carbon\Carbon::parse($invoice->invoice_date)->format('d.m.Y') }} |
| Fällig am: |
@if($invoice->due_date){{ \Carbon\Carbon::parse($invoice->due_date)->format('d.m.Y') }}@endif
|
@if($order->customer?->customer_code)
| KundenNr.: |
{{ $order->customer->customer_code }} |
@endif
@if($order->costCenter)
| Kostenstelle: |
{{ $order->costCenter->number }} |
@endif
| Auftrag: |
{{ $order->order_nr }} |
|
{{-- Titel --}}
{{ $typeLabel }} {{ $invoiceNr }}
{{-- BV --}}
BV:
@if($order->project_location){{ $order->project_location->name }} – @endif
@if($order->costCenter)Kst. {{ $order->costCenter->number }} @endif
{{ $order->title }}
@if($invoice->performance_from || $invoice->performance_to)
Leistungszeitraum:
@if($invoice->performance_from)\Carbon\Carbon::parse($invoice->performance_from)->format('d.m.Y')@endif
@if($invoice->performance_from && $invoice->performance_to) – @endif
@if($invoice->performance_to)\Carbon\Carbon::parse($invoice->performance_to)->format('d.m.Y')@endif
@endif
Sehr geehrte Damen und Herren,
wir erlauben uns folgende Leistungen gemäß Auftrag in Rechnung zu stellen:
{{-- Positionstabelle --}}
| Pos. |
Bezeichnung |
Menge |
ME |
E-Preis € |
G-Preis € |
@foreach($invoice->positions as $i => $pos)
@include('pms.invoices._pdf_row', ['pos' => $pos, 'depth' => 0, 'nr' => ($i + 1)])
@endforeach
{{-- Summenblock --}}
| Nettosumme |
{{ number_format($netto, 2, ',', '.') }}
|
|
{{ $order->vat_hinweis ?? '' }}
|
Umsatzsteuer {{ number_format($vatRate, 0) }} %
|
|
{{ number_format($mwst, 2, ',', '.') }}
|
| Gesamtbetrag (brutto) |
{{ number_format($brutto, 2, ',', '.') }}
|
@if($invoice->type === 'schluss' && ($abschlagDeduction ?? 0) > 0)
|
Geleistete Abschlagszahlungen:
| Nr. |
Datum |
Netto |
MwSt. |
Brutto |
@foreach(($abschlagList ?? collect()) as $ab)
| {{ $ab->invoice_nr }} |
{{ $ab->invoice_date ? \Carbon\Carbon::parse($ab->invoice_date)->format('d.m.Y') : '—' }} |
{{ number_format($ab->subtotal, 2, ',', '.') }} |
{{ number_format($ab->vat_amount, 2, ',', '.') }} |
{{ number_format($ab->total, 2, ',', '.') }} |
@endforeach
|
| Abzüglich Abschlagszahlungen (netto) |
– {{ number_format(($abschlagList ?? collect())->sum('subtotal'), 2, ',', '.') }}
|
| Abzüglich MwSt. auf Abschläge |
– {{ number_format(($abschlagList ?? collect())->sum('vat_amount'), 2, ',', '.') }}
|
|
|
| Verbleibender Zahlbetrag |
{{ number_format($payable, 2, ',', '.') }}
|
@endif
Wir bedanken uns für Ihren Auftrag und freuen uns auf die weitere Zusammenarbeit.
{{-- Zahlungshinweis-Box --}}
@if($bankAccount)
Bitte überweisen Sie den Betrag bis
{{ $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('d.m.Y') : '—' }}
an:
| Bank |
{{ $bankAccount->bank_name }} |
@if($bankAccount->account_holder)
| Kontoinhaber |
{{ $bankAccount->account_holder }} |
@endif
@if($bankAccount->iban)
| IBAN |
{{ $bankAccount->iban }} |
@endif
@if($bankAccount->bic)
| BIC |
{{ $bankAccount->bic }} |
@endif
| Verwendungszweck |
{{ $invoiceNr }} |
@endif
{{-- AGB auf neuer Seite --}}
@if($invoice->terms)
Allgemeine Geschäftsbedingungen
{!! $invoice->terms->terms_text !!}
@endif