mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido checkeo de lomo en presupuesto admin
This commit is contained in:
@ -354,7 +354,7 @@ class PresupuestoAdminEdit {
|
||||
// Ejecutar los pasos de forma secuencial si están habilitados
|
||||
if (update_lineas) {
|
||||
$(document).trigger('update-lineas-presupuesto');
|
||||
await waitForEvent('update-lineas-presupuesto-completed');
|
||||
await waitForEvent('update-lineas-presupuesto-completed');
|
||||
}
|
||||
|
||||
if (update_servicios) {
|
||||
@ -698,30 +698,30 @@ class PresupuestoAdminEdit {
|
||||
buttonsStyling: false
|
||||
}).then((result) => {
|
||||
if (result.isDenied || result.isConfirmed) {
|
||||
new Ajax('/presupuestoadmin/reprint',
|
||||
{ id: id, duplicateFiles: result.isConfirmed ? 1 : 0 }, {},
|
||||
function (response) {
|
||||
if (response.success === true) {
|
||||
Swal.fire({
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Ok',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
window.open('/presupuestoadmin/edit/' + response.id, '_blank');
|
||||
} else {
|
||||
popErrorAlert(response.mensaje);
|
||||
new Ajax('/presupuestoadmin/reprint',
|
||||
{ id: id, duplicateFiles: result.isConfirmed ? 1 : 0 }, {},
|
||||
function (response) {
|
||||
if (response.success === true) {
|
||||
Swal.fire({
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Ok',
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary me-1',
|
||||
},
|
||||
buttonsStyling: false
|
||||
})
|
||||
window.open('/presupuestoadmin/edit/' + response.id, '_blank');
|
||||
} else {
|
||||
popErrorAlert(response.mensaje);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
popErrorAlert(error);
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
popErrorAlert(error);
|
||||
}
|
||||
).post();
|
||||
}
|
||||
).post();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -577,6 +577,8 @@ class DatosLibro {
|
||||
update_tiradas_alternativas: true
|
||||
});
|
||||
|
||||
this.actualizarLimitesPaginas();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -775,7 +777,7 @@ class DatosLibro {
|
||||
case 6:
|
||||
case 7: // Wire-O
|
||||
case 8:
|
||||
min = 1;
|
||||
min = 20;
|
||||
max = null; // Sin límite superior
|
||||
break;
|
||||
case 21: // Grapado
|
||||
|
||||
@ -485,7 +485,9 @@ class LineasPresupuesto {
|
||||
if (lp.tipo == 'lp_guardas')
|
||||
lp['paginas_impresion'] = lp.paginas_impresion;
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
this.checkLomo();
|
||||
}
|
||||
|
||||
async guardarLineasPresupuesto() {
|
||||
@ -1723,6 +1725,39 @@ class LineasPresupuesto {
|
||||
|
||||
this.table.columns.adjust();
|
||||
|
||||
this.checkLomo();
|
||||
|
||||
}
|
||||
|
||||
checkLomo() {
|
||||
|
||||
let lomo = 0.0;
|
||||
|
||||
for (let i = 0; i < this.table.rows().count(); i++) {
|
||||
|
||||
var rowData = this.table.row(i).data();
|
||||
if (rowData.row_id !== 'lp_cubierta' && rowData.row_id !== 'lp_sobrecubierta' && rowData.row_id !== 'lp_guardas' && rowData.row_id !== 'lp_faja') {
|
||||
if (rowData.lomo && rowData.lomo !== null && rowData.lomo !== '') {
|
||||
lomo += parseFloat(rowData.lomo);
|
||||
}
|
||||
}
|
||||
}
|
||||
new Ajax('/presupuestoadmin/checklomointerior',
|
||||
{ tipo_impresion_id: $("#tipo_impresion_id").val(), lomo: lomo}, {},
|
||||
function (response) {
|
||||
if (response.status !== true) {
|
||||
popErrorAlert(response.message, 'sk-alert-lomo', false);
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
else{
|
||||
popAlert2Hide('sk-alert-lomo');
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
popErrorAlert(error.statusText? error.statusText : error);
|
||||
}
|
||||
).get();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user