@php $columnSpan = 1 + (empty($columnPeriods) ? 1 : count($columnPeriods) + 1); @endphp {{ strtoupper($group['label']) }} @if(!empty($group['tree'])) @include('reports.profit-loss._pdf-account-tree', ['nodes' => $group['tree'], 'level' => 0]) @else No accounts @if(!empty($columnPeriods)) @foreach($columnPeriods as $period) — @endforeach — @else — @endif @endif Total {{ $group['label'] }} @include('reports.profit-loss._pdf-period-amount-cells', [ 'amounts' => !empty($columnPeriods) ? ($group['period_totals'] ?? []) : $group['total'], 'total' => $group['total'], ])