@extends('layouts.app') @section('title', 'Gestión Logística') @section('content')

Rutas de Entrega

Asignación y monitoreo de flota en tiempo real

Ruta Domiciliario Progreso de Entrega Control Financiero Estado Acciones @forelse($rutas as $ruta)
{{ $ruta->nombre_ruta }} @if($ruta->numero_salida > 0) Salida #{{ $ruta->numero_salida }} @endif
{{ $ruta->fecha_programada->format('d M, Y') }}
{{ substr($ruta->domiciliario->nombre ?? '?', 0, 2) }}
{{ $ruta->domiciliario->nombre ?? 'Sin asignar' }} {{ $ruta->domiciliario->placa ?? 'Sin placa' }}
@php $total = $ruta->pedidos->count(); $entregados = $ruta->pedidos->where('pivot.estado_entrega', 'entregado')->count(); $porcentaje = $total > 0 ? ($entregados / $total) * 100 : 0; @endphp
{{ $entregados }} / {{ $total }}
${{ number_format($ruta->total_recaudado, 0) }} Recibido
@if($ruta->total_recaudado < $ruta->total_esperado)
-${{ number_format($ruta->total_esperado - $ruta->total_recaudado, 0) }} Faltante
@else Cuadre Completo @endif
@php $colors = [ 'planificacion' => 'bg-amber-50 text-amber-700 border-amber-200', 'en_curso' => 'bg-blue-50 text-blue-700 border-blue-200', 'finalizada' => 'bg-emerald-50 text-emerald-700 border-emerald-200' ]; @endphp {{ str_replace('_', ' ', $ruta->estado) }}
@empty

No hay rutas programadas activas.

@endforelse
{{ $rutas->links() }}
@endsection