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

Collector Dashboard

Welcome back, {{ $collector->name ?? 'Collector' }}! Here's your collection performance overview.

{{ now()->format('F d, Y') }}
Collection This Month

৳{{ number_format($stats['collected_this_month'], 2) }}

{{ $stats['paid_this_month'] }} bills collected
Collection Rate

{{ $stats['collection_rate'] }}%

Out of {{ $stats['total_bills'] }} total bills
Pending Bills

{{ $stats['pending_bills'] }}

{{ $stats['overdue_bills'] }} overdue
Expenses This Month

৳{{ number_format($stats['expenses_this_month'], 2) }}

{{ $stats['pending_expenses'] }} pending approval
Collection & Deposits to Manager

৳{{ number_format($stats['approved_deposits_this_month'], 2) }}

Approved deposits this month @if(($stats['pending_deposits_count'] ?? 0) > 0)
{{ $stats['pending_deposits_count'] }} pending · ৳{{ number_format($stats['pending_deposits_amount'], 2) }}
@else No pending deposits @endif
@if(isset($recentDeposits) && $recentDeposits->count() > 0)
@foreach($recentDeposits as $deposit) @endforeach
Date Amount Received By Status
{{ optional($deposit->deposit_date)->format('d M Y') }} ৳{{ number_format($deposit->amount, 2) }} {{ $deposit->receiver ? $deposit->receiver->name : 'N/A' }} @if($deposit->is_approved) Approved @if($deposit->approver)
by {{ $deposit->approver->name }} @endif @else Pending @endif
@endif
Collection Performance
Recent Activities
@if(count($recentActivities) > 0)
@foreach($recentActivities as $activity)
{{ $activity['title'] }}

{{ $activity['description'] }}

{{ \Carbon\Carbon::parse($activity['date'])->diffForHumans() }}
@if(isset($activity['amount']))
৳{{ number_format($activity['amount'], 2) }}
@endif
@endforeach
@else

No recent activities

@endif
Pending Bills
View All
@if(count($pendingBills) > 0)
@foreach($pendingBills as $bill) @endforeach
Client Amount Due Date Status
{{ $bill->client->name ?? 'N/A' }}
{{ $bill->client->phone ?? '' }}
৳{{ number_format($bill->total_amount, 2) }} {{ $bill->due_date->format('M d, Y') }} {{ ucfirst($bill->status) }}
@else

No pending bills

@endif
Recent Expenses
View All
@if(count($recentExpenses) > 0)
@foreach($recentExpenses as $expense) @endforeach
Type Amount Date Status
{{ ucfirst($expense->expense_type) }} @if($expense->description)
{{ Str::limit($expense->description, 30) }} @endif
৳{{ number_format($expense->amount, 2) }} {{ $expense->expense_date->format('M d, Y') }} {{ $expense->is_approved ? 'Approved' : 'Pending' }}
@else

No recent expenses

@endif
Monthly Collection Summary
@foreach($monthlyCollection as $month) @endforeach
Month Total Bills Paid Bills Collection Rate Amount Collected
{{ $month['month'] }} {{ $month['bills'] }} {{ $month['paid'] }}
{{ $month['rate'] }}%
৳{{ number_format($month['collected'], 2) }}
Collection Performance by Branch
Performance comparison between current and last month
@if(count($collectionPerformanceByBranch) > 0)
@foreach($collectionPerformanceByBranch as $performance) @endforeach
Branch Current Month Last Month Growth Collection Rate Rate Change
{{ $performance['branch_name'] }} @if($performance['branch_code'])
Code: {{ $performance['branch_code'] }} @endif
৳{{ number_format($performance['current_month']['collected_amount'], 2) }}
{{ $performance['current_month']['paid_bills'] }}/{{ $performance['current_month']['total_bills'] }} bills
৳{{ number_format($performance['last_month']['collected_amount'], 2) }}
{{ $performance['last_month']['paid_bills'] }}/{{ $performance['last_month']['total_bills'] }} bills
@if($performance['growth']['collection_growth'] > 0) +{{ $performance['growth']['collection_growth'] }}% @elseif($performance['growth']['collection_growth'] < 0) {{ $performance['growth']['collection_growth'] }}% @else 0% @endif
{{ $performance['current_month']['collection_rate'] }}%
@if($performance['growth']['rate_growth'] > 0) +{{ $performance['growth']['rate_growth'] }}% @elseif($performance['growth']['rate_growth'] < 0) {{ $performance['growth']['rate_growth'] }}% @else 0% @endif
@else

No branch performance data available

@endif
@endsection