@php
            $parent2_index = 1;
        @endphp
        @foreach ($account_types as $account_type)
            @php
                $parent1_index = $parent2_index;
            @endphp
            
                | {{ ucfirst($account_type) }} |  |  |  | 
            @php
                $parent2_index++;
                $chart_of_account_type = $data->where('account_type', $account_type);
            @endphp
            @foreach ($chart_of_account_type as $chart_of_account)
                
                    | {{ $chart_of_account->name }} | {{ $chart_of_account->gl_code }} | {{ number_format($chart_of_account->debit, 2) }} | {{ number_format($chart_of_account->credit, 2) }} | 
                @php
                    $parent2_index++;
                @endphp
            @endforeach
            
                | {{ trans('accounting::lang.total_for') }} {{ $account_type }} |  | {{ number_format($chart_of_account_type->sum('debit'), 2) }} | {{ number_format($chart_of_account_type->sum('credit'), 2) }} | 
        @endforeach
        
            | {{ trans_choice('accounting::lang.total', 1) }} |  | {{ number_format($data->sum('debit'), 2) }} | {{ number_format($data->sum('credit'), 2) }} |