@foreach ($items as $index => $row) @php $indent = ($depth * 24) + 10; // px indent per level $parentId = isset($parent_id) ? $parent_id : null; $parentAttr = $parentId ? 'data-parent="' . $parentId . '"' : ''; $style = $depth > 0 ? 'display:none;' : ''; $styleAttr = $style ? ' style="' . $style . '"' : ''; @endphp {{ $row->id_coa }}
@if ($row->has_children) @else @endif {{ $row->coa_name }}
@php $firstChar = substr((string)$row->id_coa, 0, 1); $rowIsBeban = in_array($firstChar, ['5', '6', '8']); $total_row_year = 0.0; @endphp @foreach ($months as $m) @php $val = $row->saldos_monthly[$m] ?? 0.0; $display_val = $rowIsBeban ? -$val : $val; $total_row_year += $display_val; @endphp {{ $display_val < 0 ? '(' . number_format(abs($display_val), 2, ',', '.') . ')' : number_format($display_val, 2, ',', '.') }} @endforeach {{ $total_row_year < 0 ? '(' . number_format(abs($total_row_year), 2, ',', '.') . ')' : number_format($total_row_year, 2, ',', '.') }} @if ($row->has_children) @include('report.rptlpr.partials.laba_rugi_rows_yearly', [ 'items' => $row->children, 'depth' => $depth + 1, 'parent_id' => 'lr-' . $row->id_coa, 'months' => $months, ]) @endif @endforeach