@extends('backend.template.layouts.template-base') @section('title', 'Reports - Customer Report') @php $avg = $summary['buyers'] > 0 ? $summary['revenue'] / $summary['buyers'] : 0; $tiles = [ ['label' => 'New Customers', 'value' => number_format($summary['customers']), 'sub' => 'registered in period', 'accent' => '#0aa437', 'icon' => 'bx-user-plus', 'highlight' => true], ['label' => 'Buyers', 'value' => number_format($summary['buyers']), 'sub' => number_format($summary['repeat_buyers']) . ' repeat buyers', 'accent' => '#12b76a', 'icon' => 'bx-cart'], ['label' => 'Lifetime Orders', 'value' => number_format($summary['orders']), 'sub' => 'by these customers', 'accent' => '#465fff', 'icon' => 'bx-receipt'], ['label' => 'Lifetime Spend', 'value' => '₹' . number_format($summary['revenue'], 0), 'sub' => 'avg ₹' . number_format($avg, 0) . ' per buyer', 'accent' => '#f79009', 'icon' => 'bx-rupee'], ['label' => 'App / Web / Manual', 'value' => number_format($summary['from_app']) . ' / ' . number_format($summary['from_web']) . ' / ' . number_format($summary['from_manual']), 'sub' => 'acquisition source', 'accent' => '#0dcaf0', 'icon' => 'bx-devices'], ]; @endphp @section('styles') @include('backend.template.reports.partials.styles') @endsection @section('content')
@include('backend.template.reports.partials.header', ['title' => 'Customer Report', 'subtitle' => 'Customers registered in the period, with lifetime value']) @include('backend.template.reports.partials.tiles', ['tiles' => $tiles])
@include('backend.template.reports.partials.filter-head')
@include('backend.template.reports.partials.daterange') @include('backend.template.reports.partials.filter-actions', ['resetRoute' => 'backend.template.reports.CustomerReport', 'filterKeys' => ['search', 'date_from', 'date_to', 'source', 'has_orders']])
@include('backend.template.reports.partials.table-head', ['paginator' => $customers, 'title' => 'Customers', 'noun' => 'customers'])
@forelse($customers as $customer) @empty @endforelse
# Customer Details Email Source Grocery Vital Kitchen Total Orders Lifetime Spend Last Order Joined On Status
{{ $customer->id }}
{{ $customer->name }} @include('backend.template.reports.partials.phone') {{ $customer->mobile ?? '—' }}
{{ $customer->email ?? '—' }} {{ $sources[$customer->source] ?? ucfirst((string) $customer->source) }} {{ number_format((int)$customer->grocery_orders) }} {{ number_format((int)$customer->vk_orders) }} {{ number_format((int)$customer->orders_count) }} ₹{{ number_format((float)$customer->orders_total, 2) }} {{ $customer->last_order_at ? \Carbon\Carbon::parse($customer->last_order_at)->format('d/m/Y') : '—' }} {{ $customer->created_at?->format('d/m/Y - h:i A') ?? '—' }} {{ $customer->status ? 'Active' : 'Inactive' }}
No customers registered in the selected period / filters.
@include('backend.template.reports.partials.table-foot', ['paginator' => $customers])
@endsection @section('scripts') @include('backend.template.reports.partials.scripts') @endsection