@foreach($nodes as $node)
@php
$hasChildren = !empty($node->children_tree);
$indent = 12 + ($level * 20);
$accountLabel = trim(($node->code ? $node->code . ' ' : '') . $node->name);
@endphp
@if($hasChildren)
@else
@endif
@if($node->is_group)
{{ $accountLabel }}
@else
{{ $accountLabel }}
@endif
|
@include('reports.profit-loss._period-amount-cells', [
'amounts' => !empty($columnPeriods) ? ($node->report_period_amounts ?? []) : $node->report_amount,
'total' => $node->report_amount,
'cellClass' => $hasChildren ? 'fw-semibold' : '',
])
@if($hasChildren)
@include('reports.profit-loss._account-tree', ['nodes' => $node->children_tree, 'level' => $level + 1])
@endif
@endforeach