mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado guardas sin impresion. arreglado error en comparador para evitar cuando se carga. Corregidos decimales en presu cliente tarjeta tiradas
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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 = $('<div>', {
|
||||
@ -31,8 +35,8 @@ class tarjetaTiradasPrecio {
|
||||
class: 'list-content'
|
||||
});
|
||||
|
||||
const formattedPrecio = precio.toString().replace('.', ',');
|
||||
const formattedPrecioUnidad = precio_unidad.toString().replace('.', ',');
|
||||
const formattedPrecio = this.formatNumber(precio, 2);
|
||||
const formattedPrecioUnidad = this.formatNumber(precio_unidad, 4);
|
||||
|
||||
$listContent.append($('<h7>', {
|
||||
id: 'ud_' + id,
|
||||
|
||||
Reference in New Issue
Block a user