@php $myRoute = $myRoute ?? []; $sellerZone = $myRoute['sellerZone'] ?? ''; $routeOptions = $myRoute['routeOptions'] ?? collect(); $selectedRoute = $myRoute['selectedRoute'] ?? ''; $searchTerm = $myRoute['searchTerm'] ?? ''; $routeClients = $myRoute['clients'] ?? null; $todayLabel = $myRoute['todayLabel'] ?? ''; @endphp
@if($sellerZone === '')
No tienes una zona asignada. Contacta al administrador para configurar tu zona.
@elseif($routeOptions->isEmpty())
No encontramos rutas para tu zona {{ $sellerZone }}.
@else

Hoy: {{ $todayLabel }}

@if($selectedRoute !== '')
@if($searchTerm !== '') Limpiar @endif
@endif
@if($selectedRoute === '')
Selecciona una ruta para ver los clientes con visita programada para hoy.
@elseif($routeClients === null || $routeClients->isEmpty())
@if($searchTerm !== '') No encontramos clientes en la ruta {{ $selectedRoute }} que coincidan con "{{ $searchTerm }}". @else No hay clientes en la ruta {{ $selectedRoute }} con visita programada para hoy. @endif
@else

Clientes de la ruta {{ $selectedRoute }}

{{ $routeClients->count() }} {{ $routeClients->count() === 1 ? 'cliente' : 'clientes' }}
@foreach($routeClients as $clientZone) @php $client = $clientZone->user; $displayEmail = $client->email; if (is_string($displayEmail) && str_ends_with(strtolower($displayEmail), '@tuti.com')) { $displayEmail = null; } $fullAddress = collect([$clientZone->address, $client->city?->name]) ->filter(fn ($part) => filled($part)) ->implode(', '); @endphp

{{ $client->business_name ?: $client->name }}

@if($client->business_name && $client->business_name !== $client->name)

{{ $client->name }}

@endif
{{ \App\Models\Zone::weekdayLabelFromDay($clientZone->day) ?? $clientZone->day }}

Cédula o NIT

{{ $client->document ?: '-' }}

Razón social

{{ $client->business_name ?: $client->name ?: '-' }}

Dirección

{{ $fullAddress ?: '-' }}

Teléfono

{{ $client->phone ?: '-' }}

Celular

{{ $client->mobile_phone ?: '-' }}

WhatsApp

{{ $client->whatsapp ?: '-' }}

Correo

{{ $displayEmail ?: '-' }}

@if($client->document) @endif
@endforeach
@endif @endif