@extends('adminlte::page') @section('title', 'Savings Account Details') @section('content')

Savings Account

Account #{{ $saving->id }}

KSh {{ number_format($saving->current_balance, 0) }}

{{ $saving->status_label }}
@if($saving->user->membership && $saving->user->membership->passport_photo) Member Photo @else
@endif
{{ $saving->user->full_name ?? 'N/A' }}
ID: {{ $saving->user->id_number ?? 'N/A' }}
Account Type
{{ $saving->type_label }}
{{ $saving->status_label }}
{{ $saving->transactions->where('type', 'deposit')->count() }} txns
KSh {{ number_format($saving->transactions->where('type', 'deposit')->sum('amount'), 0) }}
Total Deposits
{{ $saving->transactions->where('type', 'withdrawal')->count() }} txns
KSh {{ number_format($saving->transactions->where('type', 'withdrawal')->sum('amount'), 0) }}
Total Withdrawals
Since {{ $saving->created_at->format('M Y') }}
{{ $saving->created_at->diffInDays(now()) }} Days
Account Age
Personal Information
Member details
Full Name {{ $saving->user->full_name ?? 'N/A' }}
ID Number {{ $saving->user->id_number ?? 'N/A' }}
Phone {{ $saving->user->phone_number ?? 'N/A' }}
Email {{ $saving->user->email ?? 'N/A' }}
Membership Details
Branch & membership info
Membership # {{ $saving->user->membership->membership_number ?? 'N/A' }}
Branch {{ $saving->user->branch->name ?? 'N/A' }}
Member Since {{ $saving->user->membership->created_at->format('M Y') ?? 'N/A' }}
Total Accounts {{ $saving->user->savings->count() }}
Quick Actions
Add Savings @if($saving->current_balance > 0) Withdraw @endif Download Edit Back
@if($saving->notes)
Account Notes
{{ $saving->notes }}
@endif

Transaction History

{{ $saving->transactions->count() }} transactions
@if($saving->transactions->count() > 0) @foreach($saving->transactions as $transaction) @endforeach
Date Transaction # Type Amount Balance After Processed By Actions
{{ $transaction->transaction_date->format('d M Y H:i') }} {{ $transaction->transaction_number }} {{ $transaction->type_label }} {{ $transaction->formatted_amount }} KSh {{ number_format($transaction->balance_after, 0) }} {{ $transaction->processor->name ?? 'System' }}
@else
No Transactions Yet

Start by making a deposit or withdrawal to see transaction history.

@endif

Account Timeline

{{ $saving->created_at->format('d M Y') }}
{{ $saving->created_at->format('H:i') }}

Savings Account Created

Initial deposit of KSh {{ number_format($saving->amount, 2) }} for {{ $saving->type_label }}
@if($saving->status === 'withdrawn')
{{ now()->format('d M Y') }}
{{ now()->format('H:i') }}

Account Withdrawn

Savings account has been withdrawn
@elseif($saving->status === 'matured')
{{ now()->format('d M Y') }}
{{ now()->format('H:i') }}

Account Matured

Fixed deposit account has matured and is ready for withdrawal
@endif
@stop @push('js') @if(session('success')) Swal.fire({ icon: 'success', title: 'Success!', text: '{{ session("success") }}', timer: 3000, showConfirmButton: false }); @endif @if(session('error')) Swal.fire({ icon: 'error', title: 'Error!', text: '{{ session("error") }}', timer: 3000, showConfirmButton: false }); @endif @endpush