From ab385649cafe26500c8529936b1ca98b13d87de2 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:34:01 -0500 Subject: [PATCH] up --- app/Filament/Widgets/PipelineOrdersWidget.php | 3 ++- .../widgets/pipeline-orders-widget.blade.php | 22 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/Filament/Widgets/PipelineOrdersWidget.php b/app/Filament/Widgets/PipelineOrdersWidget.php index 242cd5b..edd3826 100644 --- a/app/Filament/Widgets/PipelineOrdersWidget.php +++ b/app/Filament/Widgets/PipelineOrdersWidget.php @@ -28,7 +28,8 @@ class PipelineOrdersWidget extends Widget { $this->ordersByState = []; foreach (array_keys($this->states) as $s) { - $this->ordersByState[$s] = OrdenProduccion::where('estado', $s) + $this->ordersByState[$s] = OrdenProduccion::with(['tela', 'confeccions', 'tintorerias', 'procesosAcabado']) + ->where('estado', $s) ->orderBy('fecha_entrega_estimada') ->limit(12) ->get(); diff --git a/resources/views/filament/widgets/pipeline-orders-widget.blade.php b/resources/views/filament/widgets/pipeline-orders-widget.blade.php index 6213bb3..8c0a30a 100644 --- a/resources/views/filament/widgets/pipeline-orders-widget.blade.php +++ b/resources/views/filament/widgets/pipeline-orders-widget.blade.php @@ -9,8 +9,26 @@
#{{ $op->numero_orden }} — {{ $op->prenda_modelo }}
-
- Cant: {{ $op->cantidad_total }} · Realizado: {{ $op->realizado }} · Faltan: {{ $op->faltantes }}
+ {{-- Barra de progreso --}} +
+ @php + $pct = $op->cantidad_total ? round(($op->realizado / $op->cantidad_total) * 100) : 0; + $pct = max(0, min(100, $pct)); + @endphp +
+
+ +
+ Cant: {{ $op->cantidad_total }} · Realizado: {{ $op->realizado }} ({{ $pct }}%) · Faltan: {{ $op->faltantes }}
+ + {{-- Desglose por etapas --}} + @php + $confRec = $op->confeccions->whereNotNull('fecha_recepcion')->sum('cantidad_recibida'); + $tintRec = $op->tintorerias->whereNotNull('fecha_recepcion')->sum('cantidad_recibida'); + $acabRec = $op->procesosAcabado->whereNotNull('fecha_recepcion')->sum('cantidad_recibida'); + @endphp + Confección: {{ $confRec }} · Tintorería: {{ $tintRec }} · Acabados: {{ $acabRec }}
+ Tela: {{ $op->tela?->codigo ?? '—' }} · Estado: {{ \Illuminate\Support\Str::title(str_replace('_', ' ', $op->estado)) }} · Entrega: {{ $op->fecha_entrega_estimada }}