@extends('layouts.app') @php $hour = now()->hour; $greeting = $hour < 12 ? 'Good morning' : ($hour < 17 ? 'Good afternoon' : 'Good evening'); $inr = fn ($v) => '₹'.number_format((float) $v, 2); $done = collect($checklist)->where(1, true)->count(); @endphp @section('title', $greeting.', '.Str::before(auth()->user()->name, ' ')) @section('subtitle', 'Here is what is happening with your payments today.') @section('actions') View orders Payment link @endsection @section('content') @if ($stats['review_count'])
{{ $stats['review_count'] }} {{ Str::plural('payment', $stats['review_count']) }} waiting for your review
Customers submitted UTRs. Match them with your bank/UPI app to approve.
@endif {{-- Stats --}}
@foreach ([ ['Collected today', $inr($stats['today_amount']), $stats['today_count'].' '.Str::plural('payment', $stats['today_count']), 'banknotes', 'bg-emerald-50 text-emerald-600'], ['Total collected', $inr($stats['total_amount']), $stats['paid_count'].' successful '.Str::plural('payment', $stats['paid_count']), 'chart', 'bg-brand-50 text-brand-600'], ['Pending orders', $stats['pending_count'], 'Waiting for customer payment', 'clock', 'bg-amber-50 text-amber-600'], ['Success rate', $stats['success_rate'] === null ? '—' : $stats['success_rate'].'%', 'Paid vs expired orders', 'check-circle', 'bg-sky-50 text-sky-600'], ] as [$label, $value, $hint, $icon, $tone])
{{ $label }}
{{ $value }}
{{ $hint }}
@endforeach
{{-- 7-day chart --}}
Collections · last 7 days
{{ $inr($weekTotal) }}
@php $max = max($chart->max('amount'), 1); @endphp
@foreach ($chart as $day) @php $h = $day['amount'] > 0 ? max(4, $day['amount'] / $max * 100) : 0; @endphp
{{ $day['date'] }} · {{ $inr($day['amount']) }} · {{ $day['count'] }} paid
@endforeach
@foreach ($chart as $day)
{{ $loop->last ? 'Today' : $day['label'] }}
@endforeach
{{-- Setup checklist --}}
Getting started
{{ $done }}/{{ count($checklist) }} done
{{-- Recent orders --}}
Recent orders
View all
@include('orders._table', ['orders' => $recentOrders])
@endsection