ip
This commit is contained in:
@@ -90,7 +90,8 @@ class InventarioPrendaResource extends Resource
|
||||
->dehydrated(false),
|
||||
|
||||
DatePicker::make('fecha_ingreso')
|
||||
->required(),
|
||||
->required()
|
||||
->default(now()),
|
||||
|
||||
Select::make('estado')
|
||||
->options([
|
||||
|
||||
@@ -50,6 +50,11 @@ class InventarioPrenda extends Model
|
||||
}
|
||||
}
|
||||
|
||||
// Fecha de ingreso por defecto a hoy si no se proporcionó
|
||||
if (! isset($inventario->fecha_ingreso) || ! $inventario->fecha_ingreso) {
|
||||
$inventario->fecha_ingreso = now()->toDateString();
|
||||
}
|
||||
|
||||
// Al ingresar al inventario, todo está disponible
|
||||
$inventario->cantidad_disponible = $inventario->cantidad_terminada;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user