This commit is contained in:
lizandrogd
2026-01-20 00:18:49 -05:00
parent c532a686f5
commit afaea4063c
8 changed files with 77 additions and 7 deletions
@@ -140,7 +140,8 @@ class OrdenProduccionResource extends Resource
->label('Tela')
->toggleable(),
BadgeColumn::make('estado')
BadgeColumn::make('estado_display')
->label('Estado')
->colors([
'warning' => 'en_corte',
'info' => 'en_confeccion',
@@ -159,11 +160,37 @@ class OrdenProduccionResource extends Resource
TextColumn::make('fecha_entrega_estimada')
->date(),
])
->defaultSort('created_at', 'desc')
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\Action::make('finalizar')
->label('Finalizar')
->icon('heroicon-o-check')
->color('success')
->requiresConfirmation()
->visible(fn($record) => $record->estado !== 'finalizada')
->action(function ($record) {
try {
// Forzar finalización
$record->manualFinalize();
\Filament\Notifications\Notification::make()
->success()
->title('Orden finalizada')
->body('La orden se marcó como finalizada manualmente.')
->send();
} catch (\Throwable $e) {
\Filament\Notifications\Notification::make()
->danger()
->title('Error')
->body($e->getMessage())
->send();
}
}),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([