@php
$sum = (float) $section->sum(fn($g)=> (float)$g->total);
@endphp
| # |
Group / Account |
Amount |
@forelse($section as $g)
@php
// ✅ safe unique key for toggle (works even if $g->key contains dots)
$uid = md5(($sectionTitle ?? '').'|'.($g->key ?? ''));
@endphp
|
|
{{ $name($g) }}
({{ $g->children->count() }} lines)
|
{{ number_format((float)$g->total, 2) }}
|
@foreach($g->children as $c)
@php $amt = (float)($c->amount ?? 0); @endphp
|
{{ $c->key ?? '' }}
{{ $name($c) }}
|
{{ number_format($amt, 2) }}
|
@endforeach
@empty
| No data |
@endforelse
| Total |
{{ number_format($sum, 2) }} |