@php $acc = $accounts[$id]; $kids = $children[$id] ?? []; $type = $rootTypes[$id] ?? (int) $acc->account_type; $bal = $balances[$id] ?? 0; $shown = in_array($type, [1, 4], true) ? $bal : -$bal; // الرصيد حسب طبيعة الحساب @endphp
  • @if ($kids) @else @endif {{ $acc->account_number }} {{ $acc->name }} ({{ $typeLabels[$type] ?? '-' }})
    @if (abs($bal) >= 0.005) {{ number_format(abs($shown), 2) }} {{ $shown >= 0 ? ($type == 1 || $type == 4 ? 'مدين' : 'دائن') : ($type == 1 || $type == 4 ? 'دائن' : 'مدين') }} @else 0.00 @endif
    @if ($kids) @endif