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

List of Deposits

@if(in_array(auth()->user()->role, ['teller', 'manager', 'admin'])) @endif
@foreach($deposits as $deposit) {{-- ================= STATUS COLUMN ================= --}} {{-- ================= ACTIONS ================= --}} @endforeach
# Client Account Balance Amount Method Reference Date Status Action
{{ $loop->iteration }} {{ $deposit->client->surname ?? '' }} {{ $deposit->client->first_name ?? '' }} {{ str_replace('_',' ', $deposit->clientAccount->account_type ?? 'N/A') }} ₵{{ number_format($deposit->clientAccount->balance ?? 0,2) }} ₵{{ number_format($deposit->amount,2) }} {{ ucfirst($deposit->payment_method) }} {{ $deposit->reference_no }} {{ $deposit->created_at->format('d M Y') }} @if($deposit->status === 'pending') Pending @elseif($deposit->status === 'approved') @if($deposit->clientAccount->account_type === 'Fixed_Deposits_Account') @if($deposit->fixedDeposit) @if($deposit->fixedDeposit->status === 'paid_out') Paid Out @elseif($deposit->fixedDeposit->status === 'matured') Matured @elseif($deposit->fixedDeposit->status === 'active') Active @else {{ ucfirst($deposit->fixedDeposit->status) }} @endif @else FD Record @endif @else Approved @endif @elseif($deposit->status === 'reversed') Reversed @else {{ ucfirst($deposit->status) }} @endif {{-- EDIT BUTTON --}} @if( (auth()->user()->role === 'teller' && $deposit->status === 'pending') || (in_array(auth()->user()->role, ['manager', 'admin']) && $deposit->status === 'pending') ) @endif {{-- APPROVE --}} @if(in_array(auth()->user()->role, ['admin', 'manager']) && $deposit->status === 'pending') @endif {{-- REVERSE --}} @if( in_array(auth()->user()->role, ['admin', 'manager']) && $deposit->isApproved() && !$deposit->isReversed() ) @endif {{-- PRINT RECEIPT --}}
{{-- ================= ADD / EDIT DEPOSIT MODAL ================= --}} {{-- ================= REVERSE MODAL ================= --}} @endsection @section('scripts') @endsection