calcular y guardar presupuestos adaptados a los nuevos acabados. Migracion en la bbdd

This commit is contained in:
2024-12-14 13:23:16 +01:00
parent b4de7978cc
commit 271ec8c807
6 changed files with 87 additions and 102 deletions

View File

@ -71,6 +71,7 @@ class PresupuestoCliente {
this.disenioInterior.init();
this.disenioCubierta.init();
this.direcciones.init();
if (window.location.href.includes("edit")) {
this.resumen.init(window.location.href.split("/").pop());
}
@ -588,17 +589,11 @@ class PresupuestoCliente {
if (datos_to_check.posPaginasColor == "" || datos_to_check.posPaginasColor == null) {
delete datos_to_check.posPaginasColor;
}
if (datos_to_check.cubierta.acabados.barniz == undefined) {
delete datos_to_check.cubierta.acabados.barniz;
if (datos_to_check.cubierta.acabado == 0) {
delete datos_to_check.cubierta.acabado;
}
if (datos_to_check.cubierta.acabados.plastificado == undefined) {
delete datos_to_check.cubierta.acabados.plastificado;
}
if (datos_to_check.cubierta.acabados.estampado == undefined) {
delete datos_to_check.cubierta.acabados.estampado;
}
if (datos_to_check.sobrecubierta.plastificado == undefined) {
delete datos_to_check.sobrecubierta.plastificado;
if (datos_to_check.sobrecubierta.acabado == 0) {
delete datos_to_check.sobrecubierta.acabado;
}
return datos_to_check;
@ -650,7 +645,7 @@ class PresupuestoCliente {
papelCubierta: this.disenioCubierta.getPapel(),
gramajeCubierta: this.disenioCubierta.getGramaje(),
cabezada: this.disenioCubierta.getCabezada(),
acabados: this.disenioCubierta.getAcabados(),
acabado: this.disenioCubierta.getAcabados(),
carasImpresion: this.disenioCubierta.carasCubierta.val(),
};