Skip to content

Commit cae523c

Browse files
committed
Merge branch 'desarrollo' into produccion
2 parents 9ca6170 + fca0f67 commit cae523c

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

Frontend/resources/views/pedidosviews/PedidosClientes/create.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</div>
4242
<div class="col-md-6">
4343
<label for="FECHA_ENTREGA" class="form-label fw-bold">Fecha de Entrega</label>
44-
<input type="date" class="form-control" id="FECHA_ENTREGA" name="FECHA_ENTREGA" value="{{ old('FECHA_ENTREGA') }}">
44+
<input type="date" class="form-control" id="FECHA_ENTREGA" name="FECHA_ENTREGA" value="{{ old('FECHA_ENTREGA') }}" min="">
4545
</div>
4646
<div class="col-md-6">
4747
<label for="TOTAL_PRODUCTO" class="form-label fw-bold">Total General ($)</label>
@@ -103,6 +103,10 @@
103103
}
104104
105105
document.addEventListener('DOMContentLoaded', async () => {
106+
// Bloquear fechas pasadas
107+
const hoy = new Date();
108+
hoy.setMinutes(hoy.getMinutes() - hoy.getTimezoneOffset());
109+
document.getElementById('FECHA_ENTREGA').setAttribute('min', hoy.toISOString().slice(0, 10));
106110
await cargarProductos();
107111
const detallesBody = document.getElementById('detalles-pedido-body');
108112

Frontend/resources/views/pedidosviews/PedidosClientes/edit.blade.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161

6262
<div class="mb-3">
6363
<label class="form-label fw-bold">Fecha de Entrega</label>
64-
<input type="date" class="form-control" name="FECHA_ENTREGA"
65-
value="{{ isset($pedido['fecha_ENTREGA']) ? substr($pedido['fecha_ENTREGA'], 0, 10) : '' }}">
64+
<input type="date" class="form-control" id="FECHA_ENTREGA" name="FECHA_ENTREGA"
65+
value="{{ isset($pedido['fecha_ENTREGA']) ? substr($pedido['fecha_ENTREGA'], 0, 10) : '' }}" min="">
6666
</div>
6767

6868
<div class="mt-4 p-3 bg-light rounded text-center border">
@@ -142,6 +142,13 @@
142142
}));
143143
144144
console.log("Inventario normalizado (Check ID y Nombre):", listaProductosGlobal);
145+
146+
const inputFecha = document.getElementById('FECHA_ENTREGA');
147+
if (inputFecha) {
148+
const hoy = new Date();
149+
hoy.setMinutes(hoy.getMinutes() - hoy.getTimezoneOffset());
150+
inputFecha.setAttribute('min', hoy.toISOString().slice(0, 10));
151+
}
145152
146153
// Solo después de normalizar, intentamos renderizar el pedido
147154
renderizarDetallesExistentes();
@@ -260,5 +267,15 @@ function actualizarCalculos() {
260267
actualizarCalculos();
261268
}
262269
});
270+
271+
// Bloquear fechas pasadas en edición
272+
document.addEventListener('DOMContentLoaded', () => {
273+
const inputFecha = document.getElementById('FECHA_ENTREGA');
274+
if (inputFecha) {
275+
const hoy = new Date();
276+
hoy.setMinutes(hoy.getMinutes() - hoy.getTimezoneOffset());
277+
inputFecha.setAttribute('min', hoy.toISOString().slice(0, 10));
278+
}
279+
});
263280
</script>
264281
@endpush

0 commit comments

Comments
 (0)