@endif
{{-- ── Seller Mini Dashboard ─────────────────────────── --}}
@if(!empty($isSeller))
{{-- Date Range Picker --}}
{{-- Row 1: KPI Cards --}}
{{-- Row 2: Category Sales Cards --}}
{{-- Filled dynamically via JS --}}
@endif
{{-- ── / Seller Mini Dashboard ───────────────────────── --}}
@if(!empty($isSeller))
@include('clients.orders.partials.orders-tab-panel', [
'tabKey' => 'orders-today',
'pageParam' => 'today_page',
'showFilters' => false,
'showOrigin' => true,
'orders' => $dailyOrders,
'statuses' => $statuses,
'sellerDashToday' => $sellerDashToday,
'filters' => $todayFilters,
'queryKeys' => [
'q' => 'today_q',
'order_id' => 'today_order_id',
'from_date' => 'today_from_date',
'to_date' => 'today_to_date',
'status_id' => 'today_status_id',
],
'emptyMessage' => 'No tienes pedidos para el rango seleccionado.',
])
@if(empty($isSupervisor))
@include('clients.orders.partials.my-route-panel', ['myRoute' => $myRoute])
@endif
@endif
@if(!empty($isSupervisor))
@include('clients.orders.partials.my-routes-panel', [
'myRoutes' => $myRoutes,
'statuses' => $statuses,
'sellerDashToday' => $sellerDashToday,
])
@endif
@include('clients.orders.partials.orders-tab-panel', [
'tabKey' => 'orders',
'pageParam' => 'page',
'showOrigin' => !empty($isSeller),
'orders' => $orders,
'statuses' => $statuses,
'sellerDashToday' => $sellerDashToday,
'filters' => $recentFilters,
'queryKeys' => [
'q' => 'q',
'order_id' => 'order_id',
'from_date' => 'from_date',
'to_date' => 'to_date',
'status_id' => 'status_id',
],
'emptyMessage' => 'No tienes pedidos recientes.',
])
@php
$accountUser = $accountUser ?? auth()->user();
$fullName = trim((string) $accountUser->name);
$nameParts = preg_split('/\s+/', $fullName, 2);
$firstName = $nameParts[0] ?? $fullName;
$lastName = $nameParts[1] ?? '';
@endphp
@if($accountUser->zones && $accountUser->zones->count())
@foreach($accountUser->zones as $zone)
{{ $zone->address ?? 'Dirección' }}
@if($zone->id === $accountUser->zones->first()->id)
Predeterminada
@endif
{{ $accountUser->name }}
{{ $zone->address ?? '-' }}
{{ $accountUser->city?->name ?? '-' }}
{{ $accountUser->phone ?? $accountUser->mobile_phone ?? '-' }}
Zona
{{ $zone->zone ?? '-' }}
Ruta
{{ $zone->route ?? '-' }}
Rutero
{{ $zone->code ?? '-' }}
ZIP
{{ $zone->zip_code ?? '-' }}
48H
{{ $zone->fulfillment_provider_48h ?? 'coordinadora' }}
@endforeach
@else
No hay direcciones registradas.
@endif