@extends('layout.main') @section('content')

Chart of Accounts

Account Number Account Name Account Type Balance ({{getCurrencyCode()}}) Description @forelse ($accounts as $account) {{ $account->account_code }} {{ $account->account_name }} @php $typeColors = [ 'asset' => 'bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100', 'liability' => 'bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100', 'equity' => 'bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100', 'revenue' => 'bg-purple-100 text-purple-800 dark:bg-purple-800 dark:text-purple-100', 'income' => 'bg-purple-100 text-purple-800 dark:bg-purple-800 dark:text-purple-100', 'expense' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100', ]; @endphp {{ ucfirst($account->type) }} {{ $account->balance < 0 ? '-' : '' }}{{ formatAmount(abs($account->balance)) }} @if($account->description) {{ Str::limit($account->description, 50) }} @else No description @endif @empty

No active accounts found

There are currently no active accounts in the system.

@endforelse
@if($accounts->count() > 0)
@php $totalAssets = $accounts->where('type', 'asset')->sum('balance'); $totalLiabilities = $accounts->where('type', 'liability')->sum('balance'); $totalEquity = $accounts->where('type', 'equity')->sum('balance'); $totalRevenue = $accounts->whereIn('type', ['revenue', 'income'])->sum('balance'); @endphp

Total Assets

{{ formatCurrencyDecimals($totalAssets) }}

Total Liabilities

{{ formatCurrencyDecimals($totalLiabilities) }}

Total Equity

{{ formatCurrencyDecimals($totalEquity) }}

Total Revenue

{{ formatCurrencyDecimals($totalRevenue) }}

@endif
@endsection