@extends('backEnd.layouts.master') @section('title', match($pipeline) { 'reminder' => 'CRM Reminder Follow-up', 'cancelled_queue' => 'CRM Courier Cancelled', 'all' => 'CRM — All Customers', default => 'CRM Active Customers', }) @push('styles') @include('backEnd.crm.partials.crm-theme-colors') @endpush @section('content')

@switch($pipeline) @case('reminder') Reminder Follow-up @break @case('cancelled_queue') Courier Cancelled @break @case('all') All CRM Customers @break @default Active CRM @endswitch

Confirmed order থেকে auto entry · ৩০ দিন পর Reminder · Courier cancel queue

@php $tabRoutes = [ 'active' => route('admin.crm.active'), 'reminder' => route('admin.crm.reminder'), 'cancelled_queue' => route('admin.crm.cancelled'), ]; @endphp @foreach([ ['active', 'Active CRM', 'btn-success'], ['reminder', 'Reminder (30+ days)', 'btn-crm-reminder-tab'], ['cancelled_queue', 'Courier Cancelled', 'btn-danger'], ] as [$key, $label, $btnClass]) {{ $label }} {{ $counts[$key] ?? 0 }} @endforeach
@if($pipeline === 'cancelled_queue' && $customers->count())
@endif
@if($pipeline === 'cancelled_queue') @endif @forelse($customers as $c) @php $followDate = $c->follow_up_date; $lastOrder = $c->lastOrder; $firstItem = $lastOrder?->items->first(); @endphp @if($pipeline === 'cancelled_queue') @endif @empty @endforelse
Customer Orders Entered / Reminder Next Contact Note Status Action
{{ $c->customer_name ?: '—' }}
{{ $c->customer_phone }}
{{ Str::limit($c->customer_address, 60) }}
@if($c->pipeline === 'cancelled_queue' && $c->lastCancelledOrder)
Cancelled: #{{ $c->lastCancelledOrder->invoice_id }}
@endif @if(!empty($churnFlags[$c->customer_phone])) {{ $winBackSettings['label'] ?? 'Win-Back' }} {{ $churnFlags[$c->customer_phone]['days_idle'] }}d @endif
{{ $c->order_count }} order(s) @if($firstItem)
Last: {{ Str::limit($firstItem->product_name ?? $firstItem->product?->name, 28) }}
@endif
@if($c->entered_at)
Entered: {{ $c->entered_at->format('d M Y') }}
@endif @if($c->reminder_at)
Auto reminder: {{ $c->reminder_at->format('d M Y') }}
@endif
@if($pipeline === 'reminder' || $c->pipeline === 'reminder')
{{ $c->follow_up_label }}
@if($followDate)
{{ $followDate->format('d M Y, h:i A') }}
@endif @else @endif
@if($c->note)
{{ Str::limit($c->note, 120) }}
@else @endif
{{ $c->contact_status_label }}
@if($pipeline === 'cancelled_queue')
@csrf @method('DELETE')
@endif
No CRM records found.
@if($customers->hasPages())
{{ $customers->links() }}
@endif
@endsection @push('scripts') @endpush