@foreach ($chartAccounts as $type => $accounts)
@php
$xyz = 0;
@endphp
@foreach ($accounts as $account)
{{ $account['subType'] }}
{{ __('Account') }}
{{ __('Amount') }}
@php
$totalCredit = 0;
$totalDebit = 0;
@endphp
@foreach ($account['account'] as $record)
@php
$totalCredit += $record['totalCredit'];
$totalDebit += $record['totalDebit'];
@endphp
{{ $record['account_name'] }}
@if ($record['netAmount'] < 0)
{{ __('Dr') . '. ' . number_format(abs($record['netAmount'])) }}
@elseif($record['netAmount'] > 0)
{{ __('Cr') . '. ' . number_format($record['netAmount']) }}
@else
{{ number_format(0) }}
@endif
@endforeach
{{ __('Total') . ' ' . $account['subType'] }}
@php $total= $totalCredit-$totalDebit; @endphp
@if ($total < 0)
{{ __('Dr') . '. ' . number_format(abs($total)) }}
@elseif($total > 0)
{{ __('Cr') . '. ' . number_format($total) }}
@else
{{ number_format(0) }}
@endif
@endforeach
@endforeach