@foreach($rows as $row) @php $indent = (($depth + 1) * 24) + 10; $isParent = !empty($row->children); $parentAttr = $row->id_parent ? 'data-neraca-parent="' . $row->id_parent . '"' : ''; $sectionAttr = isset($section_id) ? 'data-neraca-section="' . $section_id . '"' : ''; $rowAmounts = []; foreach ($period_amount_maps as $resultIndex => $map) { $rowAmounts[$resultIndex] = (float) ($map[(string) $row->kode] ?? 0); } $rowTotal = array_sum($rowAmounts); $formatAmount = function ($amount) { $amount = (float) $amount; return $amount < 0 ? '(' . number_format(abs($amount), 2, ',', '.') . ')' : number_format($amount, 2, ',', '.'); }; @endphp 0) style="display:none;" @endif> {{ $row->kode ?? '' }}
@if($isParent) @else @endif {{ $row->nama }}
@foreach($rowAmounts as $amount) {{ $formatAmount($amount) }} @endforeach {{ $formatAmount($rowTotal) }} @if($isParent) @include('report.rptlpr.partials.neraca_rows', [ 'rows' => $row->children, 'depth' => $depth + 1, 'period_amount_maps' => $period_amount_maps, 'section_id' => $section_id ?? null, 'default_hidden' => $default_hidden ?? false ]) @endif @endforeach