up
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user