up
This commit is contained in:
@@ -29,12 +29,8 @@ class EditTintoreria extends EditRecord
|
|||||||
->maxValue(fn () => $this->getRecord()->faltantes ?? 0)
|
->maxValue(fn () => $this->getRecord()->faltantes ?? 0)
|
||||||
->helperText(fn () => 'Máximo: ' . ($this->getRecord()->faltantes ?? 0))
|
->helperText(fn () => 'Máximo: ' . ($this->getRecord()->faltantes ?? 0))
|
||||||
->default(fn () => $this->getRecord()->faltantes ?? 0),
|
->default(fn () => $this->getRecord()->faltantes ?? 0),
|
||||||
Forms\Components\TextInput::make('prendas_defectuosas')
|
Forms\Components\Textarea::make('notas')
|
||||||
->numeric()
|
->helperText('Si hay prendas defectuosas, regístralas en la pestaña Reprocesos'),
|
||||||
->minValue(0)
|
|
||||||
->maxValue(fn ($get) => (int) ($get('cantidad') ?? 0))
|
|
||||||
->helperText('Opcional. Se restará del total recibido.'),
|
|
||||||
Forms\Components\Textarea::make('notas'),
|
|
||||||
])
|
])
|
||||||
->action(function (array $data): void {
|
->action(function (array $data): void {
|
||||||
$record = $this->getRecord();
|
$record = $this->getRecord();
|
||||||
@@ -44,7 +40,7 @@ class EditTintoreria extends EditRecord
|
|||||||
'referencia_type' => \App\Models\Tintoreria::class,
|
'referencia_type' => \App\Models\Tintoreria::class,
|
||||||
'referencia_id' => $record->id,
|
'referencia_id' => $record->id,
|
||||||
'cantidad' => (int) $data['cantidad'],
|
'cantidad' => (int) $data['cantidad'],
|
||||||
'prendas_defectuosas' => (int) ($data['prendas_defectuosas'] ?? 0),
|
'prendas_defectuosas' => 0,
|
||||||
'fecha_recepcion' => $data['fecha_recepcion'],
|
'fecha_recepcion' => $data['fecha_recepcion'],
|
||||||
'notas' => $data['notas'] ?? null,
|
'notas' => $data['notas'] ?? null,
|
||||||
]);
|
]);
|
||||||
|
|||||||
+2
-9
@@ -30,14 +30,8 @@ class RecepcionesRelationManager extends RelationManager
|
|||||||
->maxValue(fn () => $this->getOwnerRecord()?->faltantes ?? 0)
|
->maxValue(fn () => $this->getOwnerRecord()?->faltantes ?? 0)
|
||||||
->helperText(fn () => 'Máximo: ' . ($this->getOwnerRecord()?->faltantes ?? 0)),
|
->helperText(fn () => 'Máximo: ' . ($this->getOwnerRecord()?->faltantes ?? 0)),
|
||||||
|
|
||||||
TextInput::make('prendas_defectuosas')
|
Textarea::make('notas')
|
||||||
->label('Faltantes')
|
->helperText('Si hay prendas defectuosas, regístralas en la pestaña Reprocesos'),
|
||||||
->numeric()
|
|
||||||
->minValue(0)
|
|
||||||
->maxValue(fn ($get) => (int) ($get('cantidad') ?? 0))
|
|
||||||
->helperText('Opcional. Se restará del total recibido.'),
|
|
||||||
|
|
||||||
Textarea::make('notas'),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +42,6 @@ class RecepcionesRelationManager extends RelationManager
|
|||||||
TextColumn::make('id')->label('#'),
|
TextColumn::make('id')->label('#'),
|
||||||
TextColumn::make('fecha_recepcion')->dateTime()->label('Fecha'),
|
TextColumn::make('fecha_recepcion')->dateTime()->label('Fecha'),
|
||||||
TextColumn::make('cantidad')->label('Cantidad'),
|
TextColumn::make('cantidad')->label('Cantidad'),
|
||||||
TextColumn::make('prendas_defectuosas')->label('Faltantes'),
|
|
||||||
TextColumn::make('usuario.name')->label('Usuario'),
|
TextColumn::make('usuario.name')->label('Usuario'),
|
||||||
TextColumn::make('notas')->limit(50)->wrap(),
|
TextColumn::make('notas')->limit(50)->wrap(),
|
||||||
TextColumn::make('created_at')->dateTime()->label('Creado'),
|
TextColumn::make('created_at')->dateTime()->label('Creado'),
|
||||||
|
|||||||
Reference in New Issue
Block a user