@extends('layouts.app') @php($canManage = auth()->user()->hasPermission('accounting.manage')) @section('title', 'Chart of Accounts') @section('subtitle', 'Ledger accounts and balances') @section('content') Ledgers Journals @if ($canManage) New account @endif
@foreach ($types as $type => $label) @php($rows = $grouped->get($type, collect()))

{{ $label }}

{{ $rows->count() }} account{{ $rows->count() === 1 ? '' : 's' }}
@forelse ($rows as $row) @php($account = $row['account']) @php($balance = $account->isDebitNormal() ? $row['signed'] : -$row['signed']) @empty @endforelse
Code Account Balance
{{ $account->code }} {{ $account->name }} @unless ($account->is_active) Inactive @endunless
{{ ucfirst($account->normal_balance) }} normal
{{ money(abs($balance)) }}{{ $balance < 0 ? ' Cr' : '' }} @if ($canManage)
@csrf
@endif
@endforeach
@endsection