@php $pageConfigs = ['navbarType' => 'hidden', 'contentLayout' => 'wide']; $configData = Helper::appClasses(); $daysCollection = $days ?? collect(); $totalLast90 = (int) $daysCollection->sum('total'); $todayKey = now()->toDateString(); $todayEntry = $daysCollection->firstWhere('day', $todayKey); $todayCount = (int) data_get($todayEntry, 'total', 0); $weekStart = now()->startOfWeek(); $weekCount = (int) $daysCollection ->filter(fn ($item) => \Carbon\Carbon::parse($item->day)->greaterThanOrEqualTo($weekStart)) ->sum('total'); $activeDaysCount = (int) $daysCollection->count(); $selectedDayLabel = $selectedDay ? \Carbon\Carbon::parse($selectedDay)->format('d/m/Y') : null; @endphp @extends('layouts/layoutMaster') @section('title', 'Registros') @section('content')
Historial

Pedidos completados

Revisa tus entregas cerradas y consulta el detalle por dia.

Ver mapa
Hoy {{ $todayCount }}
Semana {{ $weekCount }}
Ultimos 90 dias {{ $totalLast90 }}
Dias activos {{ $activeDaysCount }}

Filtrar por dia

@if ($selectedDay) Quitar filtro @endif
Todos {{ $totalLast90 }} @forelse ($daysCollection as $day) @php $dayValue = $day->day; $isActive = ($selectedDay ?? '') === $dayValue; @endphp {{ \Carbon\Carbon::parse($dayValue)->format('d/m') }} {{ $day->total }} @empty
No hay registros todavia.
@endforelse
@if ($selectedDay)

Pedidos del {{ $selectedDayLabel }}

{{ $deliveries->total() }} resultado(s)

@forelse ($deliveries as $delivery) @php $createdAt = $delivery->completed_at ?? $delivery->created_at; $paymentLabel = match ($delivery->payment_method) { 'cash' => 'Efectivo', 'wallet' => 'Wallet', default => ucfirst((string) ($delivery->payment_method ?? 'No definido')), }; $searchText = '#' . $delivery->id . ' ' . ($delivery->customer_name ?? '') . ' ' . ($delivery->customer_phone ?? '') . ' ' . ($delivery->delivery_address ?? ''); @endphp
#{{ $delivery->id }} {{ optional($createdAt)->format('H:i') }}
@if ($delivery->is_urgent) Urgente @endif Entregado
Cliente
{{ $delivery->customer_name ?: 'Por definir' }}
{{ $delivery->customer_phone ?: 'Sin telefono' }}
Tarifa €{{ number_format((float) ($delivery->delivery_fee ?? 0), 2) }}
Pago {{ $paymentLabel }}
Fecha {{ optional($createdAt)->format('d/m/Y') }}
Recogida {{ $delivery->restaurant?->address ?? 'Restaurante' }}
Entrega {{ $delivery->delivery_address ?: 'Por definir' }}
@if ($delivery->delivery_address_extra)
{{ $delivery->delivery_address_extra }}
@endif
@empty
No hay pedidos ese dia

Prueba otro filtro de fecha para ver mas resultados.

@endforelse
No hay coincidencias

Ajusta la busqueda para encontrar un pedido.

{{ $deliveries->links() }}
@else
Selecciona un dia para empezar

Elige uno de los dias superiores y veras el detalle de pedidos entregados.

@endif
@endsection @section('page-style') @endsection @section('page-script') @endsection