@extends('layouts.finance') @section('title', 'Bank Accounts') @section('subtitle', 'Manage and view detail on every account') @section('content') @php $usTotal = $accounts->where('currency', 'USD')->sum(fn($a) => $a->current_balance); $pkTotal = $accounts->where('currency', 'PKR')->sum(fn($a) => $a->current_balance); $auTotal = $accounts->where('currency', 'AUD')->sum(fn($a) => $a->current_balance); $countryFor = fn($currency) => $currency === 'PKR' ? 'Pakistan' : ($currency === 'AUD' ? 'Australia' : 'USA'); $pillFor = fn($currency) => $currency === 'PKR' ? 'pill-amber' : ($currency === 'AUD' ? 'pill-teal' : 'pill-blue'); @endphp
Accounts
{{ $accounts->count() }}
US Total
{{ $metrics->money($usTotal) }}
PK Total
{{ $metrics->money($pkTotal, 'PKR') }}
AU Total
{{ $metrics->money($auTotal, 'AUD') }}

All Bank Accounts

+ Add Account
@forelse($accounts as $account) @csrf @method('PUT') @empty @endforelse
Entity Bank Country Account # Balance Cur. USD Eq. Links
{{ $countryFor($account->currency) }} {{ $account->currency }} {{ $metrics->money($metrics->usd($account->current_balance, $account->currency)) }} @if($account->transactions_count > 0) In {{ $account->transactions_count }} Out 0 @else - @endif Edit
@csrf @method('DELETE')
No accounts yet - click + Add Account to create one
@endsection