@php $netto = $order->positions->sum('calculated_total'); $vatRate = (float)($order->vat_rate ?? 19); $vatFactor = $vatRate / 100; $mwst = $netto * $vatFactor; $brutto = $netto + $mwst; // Kundenadresse splitten $custAddress = $order->customer?->address ?? ''; if (str_contains($custAddress, ',')) { [$custStreet, $custCity] = array_map('trim', explode(',', $custAddress, 2)); } else { $custStreet = $custAddress; $custCity = ''; } @endphp Rechnung {{ $reNr }} {{-- Footer (jede Seite) --}}
{{-- Kopfbereich: Empfänger links, Logo + Info rechts --}}
{{-- Absenderzeile --}}
{{ $company->name }} * {{ $company->str }} {{ $company->hn }} * {{ $company->plz }} {{ $company->ort }}
{{-- Empfänger --}}
{{ $order->customer?->name ?? '' }}
{{ $custStreet }}
{{ $custCity }}


{{ $company->str }} {{ $company->hn }}
{{ $company->plz }} {{ $company->ort }}

@if($company->tel)Tel.: {{ $company->tel }}
@endif @if($company->fax)Fax: {{ $company->fax }}
@endif @if($company->email)E-Mail: {{ $company->email }}
@endif
Datum: {{ \Carbon\Carbon::now()->format('d.m.Y') }}
Projektnr.: {{ $order->project_location?->name ?? '' }}
{{-- Rechnungstitel --}}
Rechnung {{ $reNr }}
{{-- BV --}} @if($order->project_location || $order->title)
BV:  {{ $order->project_location ? $order->project_location->name . ' – ' : '' }}{{ $order->title }}
@endif {{-- Anschreiben --}}

Sehr geehrte Damen und Herren,

wir erlauben uns folgende Leistungen gemäß Auftrag in Rechnung zu stellen:

{{-- Positionstabelle --}} @foreach($order->positions as $i => $pos) @include('pms.orders._rechnung_pdf_row', ['pos' => $pos, 'depth' => 0, 'nr' => ($i + 1)]) @endforeach
Pos. Bezeichnung Menge ME E-Preis € G-Preis €
{{-- Summenblock --}}
Nettosumme {{ number_format($netto, 2, ',', '.') }}
@if($order->vat_hinweis){{ $order->vat_hinweis }} · @endif Umsatzsteuer {{ number_format($vatRate, 0) }} % {{ number_format($mwst, 2, ',', '.') }}
Gesamtsumme {{ number_format($brutto, 2, ',', '.') }}
{{-- Beschreibung / Zahlungstext / §13b-Hinweis --}} @if($order->description)
{{ $order->description }}
@endif {{-- Abschluss --}}
Wir bedanken uns für Ihren Auftrag und freuen uns auf die weitere Zusammenarbeit.