@extends('layouts.master') @section('page_title', 'Chart of Accounts') @section('content')

Chart of Accounts

Print PDF
Chart of Accounts
@if(isset($groupedAccountTypes) && $groupedAccountTypes->count() > 0) @foreach($groupedAccountTypes as $category => $accountTypesInCategory)

{{ ucfirst($category) }} Accounts

@foreach($accountTypesInCategory as $accountType) @if($accountType->accounts && $accountType->accounts->count() > 0) @endif @endforeach
@endforeach
Account Summary
@php $totalAccounts = $accountTypes->sum(function($type) { return $type->accounts->count(); }); $activeAccounts = $accountTypes->sum(function($type) { return $type->accounts->where('is_active', true)->count(); }); $assetAccounts = $accountTypes->where('category', 'asset')->sum(function($type) { return $type->accounts->count(); }); $liabilityAccounts = $accountTypes->where('category', 'liability')->sum(function($type) { return $type->accounts->count(); }); $equityAccounts = $accountTypes->where('category', 'equity')->sum(function($type) { return $type->accounts->count(); }); $revenueAccounts = $accountTypes->where('category', 'revenue')->sum(function($type) { return $type->accounts->count(); }); $expenseAccounts = $accountTypes->where('category', 'expense')->sum(function($type) { return $type->accounts->count(); }); @endphp

{{ $totalAccounts }}

Total Accounts

{{ $activeAccounts }}

Active

{{ $assetAccounts }}

Assets

{{ $liabilityAccounts }}

Liabilities

{{ $equityAccounts }}

Equity

{{ $revenueAccounts + $expenseAccounts }}

P&L Accounts

@else
No Accounts Found
No accounts match the current filter criteria.
@endif
@endsection