@extends('layouts.app') @section('content')

Employee Loans

Manage loans issued to employees.

@if(auth()->user()->hasPermission($currentBusiness->id, 'can_edit_finance')) @endif
Staff Amount Date Due Date Purpose Status Repaid Balance Payments @forelse($loans ?? [] as $index => $loan) {{ $loan->staff->name ?? $loan->staff_name }} {{ $currentBusiness->currency_symbol }}{{ number_format($loan->amount, 2) }} {{ $loan->date->format('d M Y') }} {{ $loan->due_date ? $loan->due_date->format('d M Y') : '-' }} {{ $loan->purpose }} {{ ucfirst($loan->status) }} {{ $currentBusiness->currency_symbol }}{{ number_format($loan->repaid, 2) }} {{ $currentBusiness->currency_symbol }}{{ number_format($loan->amount - $loan->repaid, 2) }}

Payments

@if(auth()->user()->hasPermission($currentBusiness->id, 'can_edit_finance') && $loan->status !== 'repaid')
@csrf
@endif
@if($loan->payments && count($loan->payments) > 0) @foreach($loan->payments as $payment) @endforeach
Date Amount Note
{{ $payment->date->format('d M Y') }} {{ $currentBusiness->currency_symbol }}{{ number_format($payment->amount, 2) }} {{ $payment->note }}
@else

No payments recorded yet.

@endif @empty No employee loans found. @endforelse
@if(isset($loans) && $loans instanceof \Illuminate\Pagination\LengthAwarePaginator)
{{ $loans->links() }}
@endif
@endsection