@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
@if($order->customer?->customer_code) @endif @if($order->costCenter) @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
KundenNr.: {{ $order->customer->customer_code }}
Kostenstelle: {{ $order->costCenter->number }}
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 --}} @foreach($invoice->positions as $i => $pos) @include('pms.invoices._pdf_row', ['pos' => $pos, 'depth' => 0, 'nr' => ($i + 1)]) @endforeach
Pos. Bezeichnung Menge ME E-Preis € G-Preis €
{{-- Summenblock --}}
Nettosumme {{ number_format($netto, 2, ',', '.') }}
{{ $order->vat_hinweis ?? '' }} Umsatzsteuer {{ number_format($vatRate, 0) }} %
{{ number_format($mwst, 2, ',', '.') }}
@if($invoice->type === 'schluss' && ($abschlagDeduction ?? 0) > 0) @endif
Gesamtbetrag (brutto) {{ number_format($brutto, 2, ',', '.') }}
Geleistete Abschlagszahlungen:
@foreach(($abschlagList ?? collect()) as $ab) @endforeach
Nr. Datum Netto MwSt. Brutto
{{ $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, ',', '.') }}
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, ',', '.') }}
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:
@if($bankAccount->account_holder) @endif @if($bankAccount->iban) @endif @if($bankAccount->bic) @endif
Bank {{ $bankAccount->bank_name }}
Kontoinhaber {{ $bankAccount->account_holder }}
IBAN {{ $bankAccount->iban }}
BIC {{ $bankAccount->bic }}
Verwendungszweck {{ $invoiceNr }}
@endif {{-- AGB auf neuer Seite --}} @if($invoice->terms)
Allgemeine Geschäftsbedingungen
{!! $invoice->terms->terms_text !!}
@endif