@extends('layouts.app') @section('page-title', 'All Accounts') @section('content')
@if($allAccounts->isEmpty())
No accounts yet

Start by adding your first Cash, Bank, or Digital account.

@else
@foreach($allAccounts as $account)
@if($account->type === 'cash') @elseif($account->type === 'bank') @else @endif
{{ $account->provider }}
{{ $account->account_name }}
{{ $account->is_active ? 'Active' : 'Inactive' }}
@if($account->account_number)

Number: {{ $account->account_number }}

@endif @if($account->branch)

Branch: {{ $account->branch }}

@endif
Balance {{ number_format($account->balance, 2) }}
Transactions {{ $account->transaction_count }}
@endforeach
Cash Balance {{ number_format($allAccounts->where('type', 'cash')->sum('balance'), 2) }}
Bank Balance {{ number_format($allAccounts->where('type', 'bank')->sum('balance'), 2) }}
Digital Balance {{ number_format($allAccounts->where('type', 'digital')->sum('balance'), 2) }}
@endif
@endsection