@foreach ($items as $detail) @php $primary = ''; foreach ($table_primary as $p) { $primary == '' ? ($primary = $detail->{$p->field}) : ($primary = $primary . ':' . $detail->{$p->field}); } $hasChildren = $detail->has_children ?? false; $indent = $depth * 24; // px indent per level $parentAttr = isset($detail->id_parent) && $detail->id_parent ? 'data-parent="' . $detail->id_parent . '"' : ''; // compute style string: hide all children initially so they appear under their parent when toggled; mark inactive rows with background $style = ''; if ($depth > 0) { $style .= 'display:none;'; } if (isset($detail->isactive) && $detail->isactive == '0') { $style .= 'background-color:#ffc2cd;'; } $styleAttr = $style ? ' style="' . $style . '"' : ''; $tdStyle = $hasChildren ? ' style="cursor:pointer; user-select:none;"' : ''; @endphp isactive == '0' ? 'class=not style=background-color:#ffe9ed;' : '' }}>
@if ($hasChildren) @else @endif {{ $detail->id_coa }}
{{ $detail->nama }} {{ str_replace(' ', '-', ucwords(str_replace('-', ' ', $detail->jenis_laporan))) }} @if ($hasChildren) @include('master.mstcoa.partials.coa_rows', [ 'items' => $detail->children, 'depth' => $depth + 1, 'table_primary' => $table_primary, 'url_menu' => $url_menu, 'authorize' => $authorize, ]) @endif @endforeach