corregidos errores en logica

This commit is contained in:
2024-10-08 14:07:29 +02:00
parent 4045771c2d
commit dfd915e47f
4 changed files with 34 additions and 15 deletions

View File

@ -360,6 +360,7 @@ return [
'tipo_cubierta' => 'Seleccione tipo de cubierta', 'tipo_cubierta' => 'Seleccione tipo de cubierta',
'opcion_solapas' => 'Seleccione la opción para las solapas', 'opcion_solapas' => 'Seleccione la opción para las solapas',
'paginas_cosido' => 'El número de páginas para <b>cosido</b> debe ser múltiplo de 4', 'paginas_cosido' => 'El número de páginas para <b>cosido</b> debe ser múltiplo de 4',
'paginas_pares' => 'El número de páginas debe ser par',
], ],
'errores' => [ 'errores' => [

View File

@ -191,7 +191,17 @@ class DatosGenerales {
callback: function (input) { callback: function (input) {
// Get the selected options // Get the selected options
const value = $("#paginasColor").val(); const value = $("#paginasColor").val();
return value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0; if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
if (parseInt(value) % 2 != 0) {
return {
valid: false,
message: window.translations["validation"].paginas_pares
};
}
return true;
}
return false;
}, },
} }
} }
@ -203,7 +213,17 @@ class DatosGenerales {
callback: function (input) { callback: function (input) {
// Get the selected options // Get the selected options
const value = $("#paginasNegro").val(); const value = $("#paginasNegro").val();
return value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0; if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
if (parseInt(value) % 2 != 0) {
return {
valid: false,
message: window.translations["validation"].paginas_pares
};
}
return true;
}
return false;
}, },
} }
} }

View File

@ -353,11 +353,9 @@ class DisenioInterior {
if ($('#fresado').hasClass('selected')) { if ($('#fresado').hasClass('selected')) {
if (this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) { if (this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) {
$('#tapaDuraLomoRedondo').addClass('d-none'); $('#tapaDuraLomoRedondo').addClass('d-none');
$('#tapaDura').removeClass('d-none');
} }
else { else {
$('#tapaDuraLomoRedondo').removeClass('d-none'); $('#tapaDuraLomoRedondo').removeClass('d-none');
$('#tapaDura').addClass('d-none');
} }
} }
} }

View File

@ -40,7 +40,7 @@ class PresupuestoCliente {
this.disenioInterior.init(); this.disenioInterior.init();
this.disenioCubierta.init(); this.disenioCubierta.init();
//this.RELLENAR_PRESUPUESTO(); this.RELLENAR_PRESUPUESTO();
} }
@ -51,7 +51,7 @@ class PresupuestoCliente {
$("#titulo").trigger('change'); $("#titulo").trigger('change');
const clienteId = $("#clienteId"); const clienteId = $("#clienteId");
const newOption = new Option("Cliente 1", "1", true, true); const newOption = new Option("Cliente Potencial", "1", true, true);
clienteId.append(newOption).trigger('change'); clienteId.append(newOption).trigger('change');
const papelFormatoId = $("#papelFormatoId"); const papelFormatoId = $("#papelFormatoId");