@extends('layout.main') @section('content')

Partially Approved Loans

Loans awaiting final approval steps

@if (Auth::user()->can('loans-create')) Add New Loan @endif

Attention Required

These loans require additional approval steps before full activation.
Pending Loans
{{ $loans->count() }}
Total Value
{{ formatAmount($loans->sum('loan_amount')) }}
Potential Interest
{{ formatAmount($loans->sum('interest_amount')) }}
Unique Clients
{{ $loans->where('loan_category_id', \App\Constants\LoanConstants::INDIVIDUAL_LOAN)->count() + $loans->where('loan_category_id', '!=', \App\Constants\LoanConstants::INDIVIDUAL_LOAN)->flatMap->groupClients->unique('client_id')->count() }}

Loans Awaiting Final Approval

Partial Approval
Loan Code Client(s) Type Product Principal ({{ getCurrencyCode() }}) Interest Rate Interest ({{ getCurrencyCode() }}) Total Amount ({{ getCurrencyCode() }}) Status Actions @forelse ($loans as $loan)
{{ $loan?->loan_code }}
@if ($loan?->loan_category_id == \App\Constants\LoanConstants::INDIVIDUAL_LOAN)
{{ substr(optional($loan?->individualClient)?->client?->fullname, 0, 1) }}
{{ optional($loan?->individualClient)?->client?->fullname }}
Individual Client
@else
@foreach ($loan?->groupClients as $index => $groupClient) @if ($index < 2)
{{ $groupClient?->client?->fullname }}
@elseif ($index == 2)
+{{ $loan?->groupClients->count() - 2 }} more members
@break @endif @endforeach
@endif
{{ \App\Constants\LoanConstants::getLoanTypeName($loan?->loan_category_id) }}
{{ $loan?->loanType?->product_name }}
{{ formatAmount($loan?->principal_amount) }}
{{ $loan?->interest_rate }}%
{{ formatAmount($loan?->interest_amount) }}
{{ formatAmount($loan?->loan_amount) }}
{{ \App\Constants\LoanConstants::getStatusName($loan?->level_status_id) }} @if (Auth::user()->can('loans-show'))
@if (Auth::user()->can('loans-approve')) @endif
@endif
@empty

No partially approved loans found

Loans requiring additional approval will appear here.

@endforelse
@endsection