up
This commit is contained in:
@@ -68,7 +68,7 @@ class EditTintoreria extends EditRecord
|
||||
$this->redirect(route('filament.admin.resources.tintorerias.edit', ['record' => $record->id]));
|
||||
}),
|
||||
|
||||
// Reprocesos: registrar reproceso como ajuste
|
||||
// Reprocesos: registrar reproceso como ajuste (igual que arreglos en confecciones)
|
||||
Actions\Action::make('reprocesos')
|
||||
->label('Reprocesos')
|
||||
->modalHeading('Registrar Reproceso')
|
||||
@@ -78,8 +78,7 @@ class EditTintoreria extends EditRecord
|
||||
->numeric()
|
||||
->required()
|
||||
->minValue(1)
|
||||
->maxValue(fn () => $this->getRecord()->recibido_total ?? 0)
|
||||
->helperText(fn () => 'Máximo: ' . ($this->getRecord()->recibido_total ?? 0)),
|
||||
->helperText('Prendas que llegaron defectuosas y necesitan reparación'),
|
||||
Forms\Components\Textarea::make('notas'),
|
||||
])
|
||||
->action(function (array $data): void {
|
||||
@@ -90,7 +89,7 @@ class EditTintoreria extends EditRecord
|
||||
try {
|
||||
$record->registerReproceso($cantidad, $data['notas'] ?? null, auth()->id() ?? null);
|
||||
|
||||
\Filament\Notifications\Notification::make()->success()->title('Reproceso registrado')->body('Se registró el reproceso correctamente.')->send();
|
||||
\Filament\Notifications\Notification::make()->success()->title('Reproceso registrado')->body('Se registró el reproceso correctamente. Estas prendas podrán re-recibirse cuando regresen reparadas.')->send();
|
||||
} catch (\Illuminate\Validation\ValidationException $e) {
|
||||
\Filament\Notifications\Notification::make()->danger()->title('Error')->body($e->validator->errors()->first() ?? 'Error al registrar reproceso.')->send();
|
||||
} catch (\Throwable $e) {
|
||||
@@ -100,7 +99,7 @@ class EditTintoreria extends EditRecord
|
||||
$this->redirect(route('filament.admin.resources.tintorerias.edit', ['record' => $record->id]));
|
||||
}),
|
||||
|
||||
// Cobros: descontar inventario y registrar cobro
|
||||
// Cobros: registrar prendas que no llegaron
|
||||
Actions\Action::make('cobros')
|
||||
->label('Cobros')
|
||||
->modalHeading('Registrar Cobro')
|
||||
@@ -109,7 +108,8 @@ class EditTintoreria extends EditRecord
|
||||
->label('Cantidad')
|
||||
->numeric()
|
||||
->required()
|
||||
->minValue(1),
|
||||
->minValue(1)
|
||||
->helperText('Prendas que NO llegaron y se cobran a la tintorería'),
|
||||
Forms\Components\TextInput::make('valor')
|
||||
->label('Valor a descontar')
|
||||
->numeric()
|
||||
@@ -126,7 +126,7 @@ class EditTintoreria extends EditRecord
|
||||
try {
|
||||
$record->registerCobro($cantidad, $valor, $data['notas'] ?? null, auth()->id() ?? null);
|
||||
|
||||
\Filament\Notifications\Notification::make()->success()->title('Cobro registrado')->body('Se descontó del inventario y se registró el cobro.')->send();
|
||||
\Filament\Notifications\Notification::make()->success()->title('Cobro registrado')->body('Se registró el cobro correctamente.')->send();
|
||||
} catch (\Illuminate\Validation\ValidationException $e) {
|
||||
\Filament\Notifications\Notification::make()->danger()->title('Error')->body($e->validator->errors()->first() ?? 'Error al registrar cobro.')->send();
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user