@foreach ($items as $row)
@php
$indent = $depth * 24; // px indent per level
$parentAttr = $row->id_parent ? 'data-parent="' . $row->id_parent . '"' : '';
$style = '';
if ($depth > 0) {
$style .= 'display:none;';
}
$styleAttr = $style ? ' style="' . $style . '"' : '';
$firstColStyle = 'border: 1px solid #a7d6d6ff; padding: 6px 8px; position: sticky; left: 0; z-index: 5; background-color: #fff; font-size: clamp(10px, 1.2vw, 12px);';
if ($row->has_children) {
$firstColStyle .= ' cursor: pointer; user-select: none;';
}
@endphp
|
@if ($row->has_children)
@else
@endif
{{ $row->no_coa }}
|
{{ $row->coa_name }}
|
{{-- Saldo Awal --}}
{{ number_format($row->saldo_awal_debet, 2, ',', '.') }}
|
{{ number_format($row->saldo_awal_kredit, 2, ',', '.') }}
|
{{-- Mutasi --}}
{{ number_format($row->mutasi_debet, 2, ',', '.') }}
|
{{ number_format($row->mutasi_kredit, 2, ',', '.') }}
|
{{-- AJE SMC --}}
{{ number_format($row->aje_debet, 2, ',', '.') }}
|
{{ number_format($row->aje_kredit, 2, ',', '.') }}
|
{{-- Saldo sesudah Penyesuaian --}}
{{ number_format($row->saldo_akhir_debet, 2, ',', '.') }}
|
{{ number_format($row->saldo_akhir_kredit, 2, ',', '.') }}
|
@if ($row->has_children)
@include('report.rptlpr.partials.neraca_lajur_rows', [
'items' => $row->children,
'depth' => $depth + 1,
])
{{-- Add Total Row after COA 3's children --}}
@if ($depth === 0 && substr($row->id_coa, 0, 1) === '3')
@php
$totalDebet = $total_neraca_debet;
$totalKredit = $total_neraca_kredit;
@endphp
|
-
|
Total Neraca
|
{{-- Saldo Awal (empty) --}}
- |
- |
{{-- Mutasi (empty) --}}
- |
- |
{{-- AJE (empty) --}}
- |
- |
{{-- Saldo sesudah Penyesuaian --}}
{{ number_format($totalDebet, 2, ',', '.') }}
|
{{ number_format($totalKredit, 2, ',', '.') }}
|
@endif
{{-- Add Total Row after COA 8's children --}}
@if ($depth === 0 && substr($row->id_coa, 0, 1) === '8')
@php
$totalDebet = $total_laba_rugi_debet;
$totalKredit = $total_laba_rugi_kredit;
@endphp
|
-
|
Total Laba Rugi
|
{{-- Saldo Awal (empty) --}}
- |
- |
{{-- Mutasi (empty) --}}
- |
- |
{{-- AJE (empty) --}}
- |
- |
{{-- Saldo sesudah Penyesuaian --}}
{{ number_format($totalDebet, 2, ',', '.') }}
|
{{ number_format($totalKredit, 2, ',', '.') }}
|
@endif
@endif
@endforeach