@extends('layouts.app') @section('title', 'Savings Account Details') @section('content')

{{ $savingsAccount->account_number }}

{{ $savingsAccount->product_name }}

@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@endif

USD {{ number_format($savingsAccount->current_balance, 2) }}

Current Balance


Available
USD {{ number_format($stats['available_balance'], 2) }}
Minimum
USD {{ number_format($savingsAccount->minimum_balance, 2) }}
Statistics
Total Deposits USD {{ number_format($stats['total_deposits'], 2) }}
Total Withdrawals USD {{ number_format($stats['total_withdrawals'], 2) }}
Interest Earned USD {{ number_format($stats['interest_earned'], 2) }}
Account Information
@if($savingsAccount->maturity_date) @endif
Account Number: {{ $savingsAccount->account_number }}
Product: {{ $savingsAccount->product_name }}
Type: {{ ucfirst($savingsAccount->type) }}
Status: @if($savingsAccount->status == 'active') Active @elseif($savingsAccount->status == 'dormant') Dormant @elseif($savingsAccount->status == 'closed') Closed @else Frozen @endif
Opening Date: {{ $savingsAccount->opening_date->format('M d, Y') }}
Maturity Date: {{ $savingsAccount->maturity_date->format('M d, Y') }}
Financial Details
Opening Balance: USD {{ number_format($savingsAccount->opening_balance, 2) }}
Current Balance: USD {{ number_format($savingsAccount->current_balance, 2) }}
Minimum Balance: USD {{ number_format($savingsAccount->minimum_balance, 2) }}
Interest Rate: {{ $savingsAccount->interest_rate }}%
Interest Calculation: {{ ucfirst($savingsAccount->interest_calculation) }}
Created By: {{ $savingsAccount->creator->name }}
@if($savingsAccount->notes)
Notes
{{ $savingsAccount->notes }}
@endif
@if($savingsAccount->transactions->count() > 0)
@foreach($savingsAccount->transactions as $transaction) @endforeach
Date Transaction # Type Amount Balance Description
{{ $transaction->transaction_date->format('M d, Y') }} {{ $transaction->transaction_number }} @if($transaction->type == 'deposit') Deposit @elseif($transaction->type == 'withdrawal') Withdrawal @elseif($transaction->type == 'interest') Interest @else {{ ucfirst($transaction->type) }} @endif {{ $transaction->type == 'deposit' || $transaction->type == 'interest' ? '+' : '-' }} USD {{ number_format($transaction->amount, 2) }} USD {{ number_format($transaction->balance_after, 2) }} {{ $transaction->description }}
@else

No transactions yet.

@endif
@if ($savingsAccount->client)
Client Details
Client Name: {{ $savingsAccount->client->full_name ?? 'N/A' }}
Client Number: {{ $savingsAccount->client->client_number ?? 'N/A' }}
Phone: {{ $savingsAccount->client->phone ?? 'N/A' }}
Email: {{ $savingsAccount->client->email ?? 'N/A' }}
ID Number: {{ $savingsAccount->client->id_number ?? 'N/A' }}
@else
Client not found: This savings account is missing an associated client record.
@endif
@endsection