@php $isGroup = $depth === 0; $hasChildren = $pos->children->isNotEmpty(); $titleIndent = $depth * 14; @endphp @if($isGroup)
@endif {{-- Anzeigezeile --}}
{{-- ↑ ↓ Pfeile übereinander (nur Hauptpositionen) --}}
@if($isGroup) @endif
{{-- Pos-Nr Badge --}}
@if($isGroup) {{ $nr }} @else {{ $nr }} @endif
{{-- Titel + Beschreibung --}}
{{ $pos->title }} @if($pos->is_optional) optional @endif
@if($pos->description)
{{ $pos->description }}
@endif
{{-- Menge · ME · E-Preis (nur bei Blatt-Positionen) --}} @if(!$hasChildren)
Menge
{{ $pos->quantity ? number_format($pos->quantity, 2, ',', '.') : '—' }}
ME
{{ $pos->unit->name ?? '—' }}
E-Preis €
{{ $pos->unit_price ? number_format($pos->unit_price, 2, ',', '.') : '—' }}
{{-- G-Preis (nur bei Blatt-Positionen) --}} @php $gprice = (float) $pos->calculated_total; @endphp
G-Preis €
@if($pos->is_optional)—@else{{ $gprice > 0 ? number_format($gprice, 2, ',', '.') : '—' }}@endif
@else {{-- Platzhalter damit Buttons rechtsbündig bleiben --}}
@endif {{-- 3 Icon-Buttons rechts --}}
@if($depth < 4) @endif
{{-- Bearbeitungszeile --}} @foreach($pos->children as $ci => $child) @include('pms.invoices._position_row', [ 'pos' => $child, 'depth' => $depth + 1, 'nr' => $nr . '.' . ($ci + 1), 'units' => $units, ]) @endforeach @if($isGroup)
@endif