@foreach($items as $account) @php $hasChildren = count($account->children_tree) > 0; $indent = $level * 18; $typeData = ['asset'=>['#d1e7dd','#0a3622'],'liability'=>['#f8d7da','#842029'],'equity'=>['#cfe2ff','#084298'],'income'=>['#d1e7dd','#155724'],'expense'=>['#fff3cd','#664d03']]; [$tbg,$tfg] = $typeData[$account->type] ?? ['#e9ecef','#495057']; @endphp
@if($hasChildren) @else @endif
{{ $account->name }} @if($account->is_bank) B @endif @if($account->is_cash) C @endif @if($account->is_system) SYS @endif
{{-- Show code on mobile since code column is hidden --}} @if($account->code)
{{ $account->code }}
@endif
{{ $account->code ?? '—' }} {{ ucfirst($account->type) }} {{ $account->sub_type ? ucwords(str_replace('_',' ',$account->sub_type)) : '—' }} @if($account->is_active) Active @else Inactive @endif
@if(!$account->is_system && auth()->user()->hasPermission('accounts','edit')) @endif @if(auth()->user()->hasPermission('accounts','create')) @endif @if(!$account->is_system && !$hasChildren && auth()->user()->hasPermission('accounts','delete'))
@csrf @method('DELETE')
@endif
@if($hasChildren) @include('accounting.coa._tree', ['items' => $account->children_tree, 'level' => $level + 1]) @endif @endforeach