This commit is contained in:
lizandrogd
2026-01-19 19:51:09 -05:00
parent 36a252b824
commit 6dc472b8b7
5 changed files with 67 additions and 12 deletions
+13 -1
View File
@@ -104,7 +104,19 @@ class ConfeccionResource extends Resource
->schema([
Forms\Components\Placeholder::make('recepcion_summary')
->label('Resumen')
->content(fn ($get) => "Total recibido: " . ($get('cantidad_recibida') ?? 0) . " — Faltan: " . ($get('faltantes') ?? 0)),
->content(function ($get) {
$id = $get('id');
if (! $id) return 'Sin recepciones registradas';
$total = \App\Models\Recepcion::where('referencia_type', \App\Models\Confeccion::class)
->where('referencia_id', $id)
->sum('cantidad');
$enviada = (int) ($get('cantidad_enviada') ?? 0);
$faltan = max(0, $enviada - $total);
return "Total recibido: {$total} — Faltan: {$faltan}";
}),
Forms\Components\Placeholder::make('instrucciones')
->label('Acciones')