@extends('savings.base') @section('action-content')

Savings Accounts

@if(session('success'))
{{ session('success') }}
@endif
@foreach($accounts as $acc) @endforeach
# Client Account Number Plan Interest Rate Balance Status Client Type Start Date Action
{{ $loop->iteration }} {{ $acc->client->surname }} {{ $acc->client->first_name }} {{ $acc->client->other_names }} {{ $acc->account_number }} {{ ucfirst($acc->plan_type) }} {{ $acc->interest_rate }}% ₵{{ number_format(optional($acc->clientAccount)->balance ?? 0, 4) }} {{ ucfirst($acc->status) }} @php $balance = optional($acc->clientAccount)->balance ?? 0; $totalDeposits = $acc->deposits_sum_amount ?? 0; @endphp @if($totalDeposits == $balance) New Client @else Old Client @endif {{ \Carbon\Carbon::parse($acc->start_date)->format('d M Y') }}
{{-- Show ONLY to Admin & Manager --}} @auth @if(in_array(auth()->user()->role, ['admin','manager'])) @csrf @method('DELETE') @endif @endauth
@include('savings.modal') @endsection @section('scripts') @endsection