mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
finalizado nuevo presupuesto cliente a falta de confirmar
This commit is contained in:
@ -111,7 +111,37 @@ class DatosGenerales {
|
||||
message: window.translations["validation"].integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
const value2 = $("#tirada2").val();
|
||||
const value3 = $("#tirada3").val();
|
||||
const value4 = $("#tirada4").val();
|
||||
let tiradas = [value];
|
||||
|
||||
if(!(value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0)){
|
||||
return {
|
||||
valid: false,
|
||||
message: window.translations["validation"].integer_greatherThan_0,
|
||||
};
|
||||
}
|
||||
if(value2.length > 0 && Number.isInteger(parseInt(value2)) && parseInt(value2) > 0){
|
||||
tiradas.push(value2);
|
||||
}
|
||||
if(value3.length > 0 && Number.isInteger(parseInt(value3)) && parseInt(value3) > 0){
|
||||
tiradas.push(value3);
|
||||
}
|
||||
if(value4.length > 0 && Number.isInteger(parseInt(value4)) && parseInt(value4) > 0){
|
||||
tiradas.push(value4);
|
||||
}
|
||||
// comprobar si hay valores > 30
|
||||
const noPOD = (tiradas.some(tirada => parseInt(tirada) > 30));
|
||||
const siPOD = (tiradas.some(tirada => parseInt(tirada) <= 30));
|
||||
if(noPOD && siPOD){
|
||||
return {
|
||||
valid: false,
|
||||
message: "No se pueden mezclar tiradas <30 con >30",
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user