u
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user