@php $customer = $order->customer; $custAddress = $customer?->address ?? ''; if (str_contains($custAddress, ',')) { [$custStreet, $custCity] = array_map('trim', explode(',', $custAddress, 2)); } else { $custStreet = $custAddress; $custCity = ''; } $netto = $invoice->subtotal; $vatRate = (float) $invoice->vat_rate; $mwst = $invoice->vat_amount; $brutto = $invoice->total; @endphp Stornorechnung {{ $stornoNr }} (zu Rechnung {{ $origNr ?? $invoice->invoice_nr }})
{{-- 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::now()->format('d.m.Y') }}
KundenNr.: {{ $order->customer->customer_code }}
Kostenstelle: {{ $order->costCenter->number }}
Rechnungs-Nr.: {{ $stornoNr }}
{{-- Titel --}}
Stornorechnung {{ $stornoNr }}
(zu Rechnung {{ $origNr ?? $invoice->invoice_nr }} @if($origInvoiceDate ?? null) vom {{ \Carbon\Carbon::parse($origInvoiceDate)->format('d.m.Y') }}@endif)
{{-- BV --}}
BV:  @if($order->project_location){{ $order->project_location->name }} – @endif @if($order->costCenter)Kst. {{ $order->costCenter->number }} @endif {{ $order->title }}

Sehr geehrte Damen und Herren,

hiermit stornieren wir die o.g. Rechnung vollständig. Die nachfolgenden Beträge werden gutgeschrieben:

@if(!empty($stornoReason))

Stornogrund: {{ $stornoReason }}

@endif {{-- Positionstabelle --}} @foreach($invoice->positions as $i => $pos) @include('pms.invoices._storno_pdf_row', ['pos' => $pos, 'depth' => 0, 'nr' => ($i + 1)]) @endforeach
Pos. Bezeichnung Menge ME E-Preis € G-Preis €
{{-- Summenblock – gleiche Spaltenstruktur wie Positionstabelle --}}
Nettogutschrift – {{ number_format($netto, 2, ',', '.') }}
{{ $order->vat_hinweis ?? '' }} Umsatzsteuer {{ number_format($vatRate, 0) }} %
– {{ number_format($mwst, 2, ',', '.') }}
Gesamtgutschrift – {{ number_format($brutto, 2, ',', '.') }}
Der gutgeschriebene Betrag wird mit der nächsten Rechnung verrechnet oder auf Wunsch erstattet.