@extends('layouts.staff-new') @section('content')

Loan {{$loan->reference}}

@if(Auth::guard('staff')->user()->manages('fulfil_loan')) @switch($loan->status) @case(1)
@csrf
@break @case(2)
@csrf
@break @endswitch @endif @if($loan->is_penalized) Penalised @endif @component('components.loan-status', ['loan' => $loan]) @endcomponent @component('components.loan-statement-button',['loan'=>$loan]) @endcomponent @php($staff = auth('staff')->user()) @if($staff->manages('loan_transactions')) @component('components.add_loan_transaction',['url'=>route('staff.loan.transaction.add',['reference'=>$loan->reference]),'loan'=>$loan]) @endcomponent @endif @if($staff->manages('settlements')) @if($loan->canSettle()) @endif @endif
@include('layouts.shared.error-display')

Loaned Amount

₦{{number_format($loan->amount, 0)}}

INSURANCE: ₦{{number_format($loan->insurance, 2)}}

Disbursal Amount

₦{{$loan->disbursal_amount ? number_format($loan->disbursal_amount, 2) : number_format($loan->disbursalAmount(), 2)}}

INSURANCE: ₦{{number_format($loan->insurance, 2)}}

Loan Tenure

{{$loan->due_date->diffInMonths($loan->created_at)}}

Months

Date Collected

{{$loan->created_at->toDateString()}}

 

Due Date

{{$loan->due_date}}

 
{{-- --}}

Payment hub

₦{{number_format($loan->user->masked_loan_wallet, 2)}}

Loan Wallet: ₦{{number_format($loan->user->loan_wallet, 2)}}

CUSTOMER DATA

Information about the borrower

@php($user = $loan->user)

Name: {{ $user->name }}

ID: {{ $user->reference }}

Bank Name: {{ optional($user->bank)->bank_name ?? 'N/A'}}

Account Number: {{ optional($user->bank)->account_number ?? 'N/A'}}

Pay Roll ID: {{optional($user->employments->first())->payroll_id ?? 'N/A'}}

More Details...


LOAN DOCUMENTS

User uploaded documents will show up here

@if ($loan->collection_documents) @php($documents = json_decode($loan->collection_documents)) @foreach($documents as $name => $document) {{ ucwords(str_replace("_", " ", $name)) }} @endforeach @else

No documents available

@endif @if($loan->status == 2) Loan Fulfillment Doc @endif

@if($loan->is_top_up)

View Previous loan

@endif

ADMIN ACTIONS

Actions you can perform on the loan at each stage shows up here


@component('components.staff-loan-actions', ['loan' => $loan]) @endcomponent


@if($loan->is_penalized) @component('components.penalty_schedule_others', ['loan'=> $loan]) @endcomponent @endif

Loan Repayments

@if($loan->repaymentPlans->isNotEmpty() && $loan->repaymentPlans->first()->is_new )
EMI: {{number_format($loan->repaymentPlans->last()->emi,2)}} @if ($staff->manages('repayments')) @endif @if ($staff->manages('approve_repayment')) @endif @php($i = 1) @foreach ($loan->repaymentPlans as $plan) @if ($staff->manages('repayments')) @endif @if($plan->payment_proof) @else @endif @if ($staff->manages('approve_repayment')) @endif @php(++$i) @endforeach
S/NBuffer StatusTotal Amount Collected Date Amount Paid Due Date Payment Proof Payment Method StatusAction
{{$i}}{{number_format($plan->totalAmount,2)}} {{$plan->date_paid}} @if($plan->status == 1) {{number_format($plan->paid_amount,2)}} @endif {{$plan->payday}}ViewNo proof @if($staff->manages('approve_repayment') && $plan->status == 0) @if(!$plan->collection_mode) @else {{$plan->collection_mode}} @endif @else {{$plan->collection_mode}} @endif @if($plan->status) Paid @else Not Paid @endif @if($plan->status == true) @else @endif
@else
@forelse($loan->repaymentPlans as $plan) @if($plan->payment_proof) @else @endif @empty @endforelse
# Total Amount Due Date
Back Date
Post Date
Balance Collected Date Payment Proof Payment Method Status
{{$loop->iteration}} ₦{{ number_format($plan->totalAmount, 2)}} {{$plan->payday}} {{-- --}} @if($loop->iteration === $loan->loanRequest->duration) ₦0.00 @else ₦{{ number_format($plan->balance, 2) }} @endif {{$plan->date_paid}}ViewNo proof @if($staff->manages('approve_repayment') && $plan->status == 0) @if(!$plan->collection_mode) @else {{$plan->collection_mode}} @endif @else {{$plan->collection_mode}} @endif @if($plan->status) Paid @else Not Paid @endif
Repayments not found
@endif
@foreach($loan->repaymentPlans as $plan)
{{ csrf_field() }}
@endforeach @foreach($loan->repaymentPlans as $plan)
{{ csrf_field() }}
@endforeach


@component('components.loan_note', ['notes'=> $loan->notes, 'loan'=>$loan, 'user'=> Auth::guard('staff')->user()]) @endcomponent
@forelse($loan->repaymentPlans as $plan) @empty Repayments not found @endforelse @endsection @section('page-js') @endsection