@extends('layouts.app') @section('title', 'Chart of Accounts') @push('styles') @endpush @php $typeMeta = [ 'Asset' => ['Assets', 'bi-safe', '#eef2ff', '#4f46e5'], 'Liability' => ['Liabilities', 'bi-credit-card-2-back', '#fee2e2', '#b91c1c'], 'Equity' => ['Equity', 'bi-bank', '#f1f5f9', '#475569'], 'Revenue' => ['Revenue', 'bi-graph-up-arrow', '#dcfce7', '#15803d'], 'Expense' => ['Expenses', 'bi-receipt', '#fef3c7', '#b45309'], ]; $reopen = old('_form'); @endphp @section('content') @if ($missing->isNotEmpty())
{{ $missing->count() }} {{ Str::plural('account', $missing->count()) }} that automatic posting uses {{ $missing->count() === 1 ? "isn't" : "aren't" }} in your chart yet: {{ $missing->map(fn ($m, $code) => "{$code} {$m[0]}")->implode(', ') }}. They're created automatically the first time they're needed, or you can add them all now.
@if ($can['create'])
@csrf
@endif
@endif
@foreach ($typeMeta as $type => [$label, $icon, $bg, $fg]) @php $group = $byType->get($type, collect()); @endphp
₦{{ number_format($group->sum('balance'), 2) }} {{ $label }} · {{ $group->count() }} {{ Str::plural('account', $group->count()) }}
@endforeach
@php $filtering = $filters['q'] !== '' || $filters['type'] || $filters['active']; @endphp {{-- Server-side: the filters reach every page of the chart, not just the one on screen. --}}
@php $pageByType = $page->getCollection()->groupBy('account_type'); @endphp @foreach ($typeMeta as $type => [$label]) @continue(!$pageByType->has($type)) @foreach ($pageByType[$type] as $a) account_code} {$a->account_name}") }}" data-lines="{{ $a->line_count }}"> @endforeach @endforeach @if ($accounts->isEmpty()) @elseif ($page->isEmpty()) @endif
Code Account USALI schedule Postings Balance Actions
{{ $label }}
{{ $a->account_code }} {{ $a->account_name }} @if ($a->isSystemAccount())@endif {{ $a->usali_schedule ? str_replace('.', ' › ', $a->usali_schedule) : '—' }} {{ $a->line_count ?: '—' }} {{ $a->line_count ? '₦' . number_format($a->balance, 2) : '—' }} @if ($can['edit']) @endif @if ($can['delete'] && !$a->line_count && !$a->isSystemAccount())
@csrf @method('DELETE')
@endif
No accounts yet.
{{ $page->total() ? 'No accounts on this page.' : 'No accounts match.' }}
@include('partials.list-pager', ['page' => $page, 'noun' => 'account'])
Balances are shown on each account's natural side — debits for assets and expenses, credits for liabilities, equity and revenue — so a negative figure means the account is running against its normal direction. marks accounts automatic posting looks up by number; they can be renamed but not renumbered or deleted.
@endsection @push('scripts') @endpush