@extends('layouts.app') @section('title', 'Partner Dashboard') @section('content')

Welcome back {{ auth()->user()->name }}! 🎉

Here's what's happening with your loans today

₹{{ number_format($financials['total_disbursed'], 0) }}

Total Disbursed Amount

Create New Loan
🎁

₹{{ number_format($financials['total_collected']) }}

Total Collected

Total Customers
{{ number_format($stats['total_customers']) }}
+{{ abs($loanGrowth) }}%
Total Loans
{{ number_format($stats['total_loans']) }}
+{{ abs($amountGrowth) }}%
Active Loans
{{ number_format($stats['active_loans']) }}
Active
Total Savings
{{ number_format($stats['total_savings']) }}
+8%
Loan Status
@php $total = $loanStatusData->sum('count'); $statusColors = [ 'active' => ['color' => '#28c76f', 'label' => 'Active'], 'completed' => ['color' => '#7367f0', 'label' => 'Completed'], 'pending' => ['color' => '#ff9f43', 'label' => 'Pending'], ]; @endphp @foreach($loanStatusData as $status) @php $percentage = $total > 0 ? round(($status->count / $total) * 100) : 0; $statusInfo = $statusColors[$status->status] ?? ['color' => '#82868b', 'label' => ucfirst($status->status)]; @endphp
{{ $statusInfo['label'] }}
{{ $percentage }}%
@endforeach
Loan & Collection Trends
Loans
Amount (K)
Financial Overview
This Month {{ $loanGrowth >= 0 ? '+' : '' }}{{ $loanGrowth }}%
@php $prevMonthStart = \Carbon\Carbon::now()->subMonth()->startOfMonth(); $prevMonthEnd = \Carbon\Carbon::now()->subMonth()->endOfMonth(); $currentMonthStart = \Carbon\Carbon::now()->startOfMonth(); $currentMonthAmount = \App\Models\Loan::where('partner_id', auth()->user()->partner_id) ->whereBetween('disbursement_date', [$currentMonthStart, \Carbon\Carbon::now()]) ->sum('principal_amount'); @endphp

₹{{ number_format($currentMonthAmount / 1000, 1) }}K

Disbursed this month


Total Disbursed ₹{{ number_format($financials['total_disbursed']) }}
Total Collected ₹{{ number_format($financials['total_collected']) }}
To Collect ₹{{ number_format($financials['total_to_collect']) }}
Savings Balance ₹{{ number_format($financials['total_savings_balance']) }}
Recent Loans
View All
@forelse($recentLoans as $loan) @empty @endforelse
Loan # Customer Scheme Amount Status Date
{{ $loan->loan_number }}
{{ substr($loan->customer->name, 0, 1) }}
{{ $loan->customer->name }}
{{ $loan->loanScheme?->name ?? $loan->scheme?->name ?? 'N/A' }} ₹{{ number_format($loan->principal_amount) }} {{ ucfirst($loan->status) }} {{ $loan->disbursement_date->format('d M Y') }}

No loans yet

Create First Loan
@endsection @section('scripts') @endsection