diff --git a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php index b11bfd10..cc24084d 100644 --- a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php +++ b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php @@ -733,7 +733,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController $datosPedido['isCosido'] = false; } - $datosPedido['paginas_impresion'] = $datosPedido['paginas']; + $datosPedido['paginas_impresion'] = $this->request->getPost('paginas_impresion') ?? 0; $data = array( 'cliente_id' => $cliente_id, diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index d2b6e316..08191bd6 100755 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -555,7 +555,7 @@ class PapelGenericoModel extends \App\Models\BaseModel $data = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject(); else $data = $builder->orderBy("t1.nombre", "asc")->get()->getResultObject(); - //$query = $this->db->getLastQuery(); + $query = $this->db->getLastQuery(); return $data; } } diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js index c319499e..7c249f61 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js @@ -1430,7 +1430,7 @@ class Comparador { const self = this; - if (this.cargando && this.comparadorExterioresRunning) { + if (this.cargando || this.comparadorExterioresRunning) { return } @@ -1525,7 +1525,7 @@ class Comparador { const self = this; - if (this.cargando && this.comparadorFajaRunning) { + if (this.cargando || this.comparadorFajaRunning) { return } @@ -1592,7 +1592,7 @@ class Comparador { const self = this; - if (this.cargando && this.comparadorGuardasRunning) { + if (this.cargando || this.comparadorGuardasRunning) { return } @@ -1613,11 +1613,11 @@ class Comparador { {}, (response) => { if (response.data && Object.keys(response.data).length > 0) { - let sorted = Object.values(response.data).sort( + let sorted = Object.values(response.data.guardas).sort( (p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? -1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0); - sorted[0].forEach(function (linea) { + sorted.forEach(function (linea) { if (typeof linea.error == "undefined") self.tableCompGuardas.row .add(self.getRowFromLinea('guardas', linea)) diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js index a4838b7a..47425ccb 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js @@ -1466,7 +1466,7 @@ class LineasPresupuesto { } else if (linea == 'lp_guardas') { input_data.paginas = (parseInt($('#tipo_impresion_id').val()) == 1 || parseInt($('#tipo_impresion_id').val()) == 3) ? 8 : 4; - input_data.paginas_impresion = parseInt($('#compCarasGuardas').select2('data')[0].id); + input_data.paginas_impresion = parseInt($('#lp_guardas_paginas').val()); } else { input_data.paginas = parseInt($('#' + linea + '_paginas').val()); diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js index c085e377..d303deca 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/presupuestoCliente.js @@ -613,11 +613,15 @@ class PresupuestoCliente { if (i == 0) { $('#eb').val(response.eb[i]); } + + let precio = parseFloat((response.precio_u[i]) * parseInt(response.tiradas[i])); + + new tarjetaTiradasPrecio( this.divTiradasPrecios, ('precio-tiradas-' + response.tiradas[i]), response.tiradas[i], - (parseFloat(response.precio_u[i]) * parseInt(response.tiradas[i])).toFixed(2), + precio, response.precio_u[i] ); @@ -628,7 +632,7 @@ class PresupuestoCliente { } } - } + } this.lc.val(parseFloat(response.info.lomo_cubierta).toFixed(2)); this.lsc.val(parseFloat(response.info.lomo_sobrecubierta).toFixed(2)); @@ -674,7 +678,7 @@ class PresupuestoCliente { #prevtStep() { if (this.validationStepper._currentIndex >= 1 && this.validationStepper._currentIndex <= 4) { - if(this.validationStepper._currentIndex == 2){ + if (this.validationStepper._currentIndex == 2) { if (this.disenioCubierta.acabadoCubierta.getVal() == 0) { alertWarningMessage(window.translations.cubiertaSinAcabado, window.translations.cubiertaSinAcabadoText); } diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/tarjetaTiradasPrecio.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/tarjetaTiradasPrecio.js index 12d1f1e4..25e11ef5 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/tarjetaTiradasPrecio.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/tarjetaTiradasPrecio.js @@ -1,5 +1,5 @@ class tarjetaTiradasPrecio { - + constructor(domItem, id, tirada, precio, precio_unidad) { this.domItem = domItem; this.id = id; @@ -11,6 +11,10 @@ class tarjetaTiradasPrecio { this.domItem.append(this.card); } + formatNumber(value, digits) { + return value.toLocaleString("de-DE", { minimumFractionDigits: digits, maximumFractionDigits: digits }); + } + #generateHTML(id, tirada, precio, precio_unidad) { let $html = $('