mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/guardas_presupuesto_admin' into 'main'
arreglado problema con las guardas y solicitudes comparador See merge request jjimenez/safekat!526
This commit is contained in:
@ -115,7 +115,19 @@ class Presupuestomanipulados extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
if (count($datos_tarifas) > 0) {
|
if (count($datos_tarifas) > 0) {
|
||||||
foreach ($datos_tarifas as $tarifa) {
|
foreach ($datos_tarifas as $tarifa) {
|
||||||
$tarifa_id = is_array($tarifa) ? $tarifa['tarifa_manipulado_id'] : $tarifa;
|
$tarifa_id = 0;
|
||||||
|
if(is_array($tarifa)){
|
||||||
|
//check if $tarifa['tarifa_manipulado_id'] exists
|
||||||
|
if(array_key_exists('tarifa_manipulado_id', $tarifa)){
|
||||||
|
$tarifa_id = $tarifa['tarifa_manipulado_id'];
|
||||||
|
}
|
||||||
|
else if(array_key_exists('tarifa_id', $tarifa)){
|
||||||
|
$tarifa_id = $tarifa['tarifa_id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$tarifa_id = $tarifa;
|
||||||
|
}
|
||||||
$values = $model->getPrecioTarifa($tarifa_id, $tirada, $POD);
|
$values = $model->getPrecioTarifa($tarifa_id, $tirada, $POD);
|
||||||
$values[0]->cubierta = $tarifa['cubierta'] ?? 0;
|
$values[0]->cubierta = $tarifa['cubierta'] ?? 0;
|
||||||
$values[0]->sobrecubierta = $tarifa['sobrecubierta'] ?? 0;
|
$values[0]->sobrecubierta = $tarifa['sobrecubierta'] ?? 0;
|
||||||
|
|||||||
@ -270,6 +270,9 @@ class Comparador {
|
|||||||
this.btnInsertarFaja = $('#insertarFajaBtn');
|
this.btnInsertarFaja = $('#insertarFajaBtn');
|
||||||
|
|
||||||
this.comparadorPlanaRunning = false;
|
this.comparadorPlanaRunning = false;
|
||||||
|
this.comparadorExterioresRunning = false;
|
||||||
|
this.comparadorGuardasRunning = false;
|
||||||
|
this.comparadorFajaRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@ -541,7 +544,7 @@ class Comparador {
|
|||||||
this.gramajeSobrecubierta.setOption(datos.json_data.sobrecubierta.gramaje, datos.json_data.sobrecubierta.gramaje);
|
this.gramajeSobrecubierta.setOption(datos.json_data.sobrecubierta.gramaje, datos.json_data.sobrecubierta.gramaje);
|
||||||
}
|
}
|
||||||
if (datos.json_data.guardas) {
|
if (datos.json_data.guardas) {
|
||||||
this.carasGuardas.val(datos.json_data.guardas.paginas).trigger('change');
|
this.carasGuardas.val(datos.json_data.guardas.paginas_impresion).trigger('change');
|
||||||
this.papelGuardas.setOption(datos.json_data.guardas.papel_id, datos.json_data.guardas.papel_nombre);
|
this.papelGuardas.setOption(datos.json_data.guardas.papel_id, datos.json_data.guardas.papel_nombre);
|
||||||
this.gramajeGuardas.setOption(datos.json_data.guardas.gramaje, datos.json_data.guardas.gramaje);
|
this.gramajeGuardas.setOption(datos.json_data.guardas.gramaje, datos.json_data.guardas.gramaje);
|
||||||
}
|
}
|
||||||
@ -1180,6 +1183,7 @@ class Comparador {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (uso == 'guardas') {
|
else if (uso == 'guardas') {
|
||||||
|
|
||||||
if ((this.papelGuardas.getVal() == 0 || this.papelGuardas.getVal() == null) && !this.cargando) {
|
if ((this.papelGuardas.getVal() == 0 || this.papelGuardas.getVal() == null) && !this.cargando) {
|
||||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||||
return { error: true, data: {} };
|
return { error: true, data: {} };
|
||||||
@ -1426,7 +1430,7 @@ class Comparador {
|
|||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (this.cargando) {
|
if (this.cargando && this.comparadorExterioresRunning) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1457,6 +1461,7 @@ class Comparador {
|
|||||||
if (Object.keys(datosComp.sobrecubierta).length > 0) {
|
if (Object.keys(datosComp.sobrecubierta).length > 0) {
|
||||||
datosComp.sobrecubierta.data[this.csrf_token] = this.csrf_hash;
|
datosComp.sobrecubierta.data[this.csrf_token] = this.csrf_hash;
|
||||||
}
|
}
|
||||||
|
this.comparadorExterioresRunning = true;
|
||||||
new Ajax('/presupuestoadmin/comparadorexteriores',
|
new Ajax('/presupuestoadmin/comparadorexteriores',
|
||||||
{
|
{
|
||||||
cubierta: datosComp.cubierta.data,
|
cubierta: datosComp.cubierta.data,
|
||||||
@ -1499,14 +1504,17 @@ class Comparador {
|
|||||||
$('#title_cubierta').html(window.language.Presupuestos.compCubiertaSobrecubierta);
|
$('#title_cubierta').html(window.language.Presupuestos.compCubiertaSobrecubierta);
|
||||||
self.btnInsertarCubierta.addClass('d-none');
|
self.btnInsertarCubierta.addClass('d-none');
|
||||||
}
|
}
|
||||||
|
self.comparadorExterioresRunning = false;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
self.comparadorExterioresRunning = false;
|
||||||
}
|
}
|
||||||
).post();
|
).post();
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
|
self.comparadorExterioresRunning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1517,7 +1525,7 @@ class Comparador {
|
|||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (this.cargando) {
|
if (this.cargando && this.comparadorFajaRunning) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1533,7 +1541,7 @@ class Comparador {
|
|||||||
datosComp.sobrecubierta.data['faja'] = 1; // se indica que es faja para el calculo de formas
|
datosComp.sobrecubierta.data['faja'] = 1; // se indica que es faja para el calculo de formas
|
||||||
|
|
||||||
datosComp.sobrecubierta.data[this.csrf_token] = this.csrf_hash;
|
datosComp.sobrecubierta.data[this.csrf_token] = this.csrf_hash;
|
||||||
|
this.comparadorFajaRunning = true;
|
||||||
new Ajax('/presupuestoadmin/comparadorexteriores',
|
new Ajax('/presupuestoadmin/comparadorexteriores',
|
||||||
{
|
{
|
||||||
sobrecubierta: datosComp.sobrecubierta.data
|
sobrecubierta: datosComp.sobrecubierta.data
|
||||||
@ -1563,15 +1571,18 @@ class Comparador {
|
|||||||
$('#title_faja').html(window.language.Presupuestos.faja);
|
$('#title_faja').html(window.language.Presupuestos.faja);
|
||||||
self.btnInsertarFaja.addClass('d-none');
|
self.btnInsertarFaja.addClass('d-none');
|
||||||
}
|
}
|
||||||
|
self.comparadorFajaRunning = false;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
self.comparadorFajaRunning = false;
|
||||||
}
|
}
|
||||||
).post();
|
).post();
|
||||||
|
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
|
self.comparadorFajaRunning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1581,7 +1592,7 @@ class Comparador {
|
|||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (this.cargando) {
|
if (this.cargando && this.comparadorGuardasRunning) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1596,7 +1607,7 @@ class Comparador {
|
|||||||
}
|
}
|
||||||
|
|
||||||
datosComp.data[this.csrf_token] = this.csrf_hash;
|
datosComp.data[this.csrf_token] = this.csrf_hash;
|
||||||
|
this.comparadorGuardasRunning = true;
|
||||||
new Ajax('/presupuestoadmin/comparadorguardas',
|
new Ajax('/presupuestoadmin/comparadorguardas',
|
||||||
datosComp.data,
|
datosComp.data,
|
||||||
{},
|
{},
|
||||||
@ -1624,14 +1635,17 @@ class Comparador {
|
|||||||
$('#title_guardas').html(window.language.Presupuestos.Guardas);
|
$('#title_guardas').html(window.language.Presupuestos.Guardas);
|
||||||
self.btnInsertarGuardas.addClass('d-none');
|
self.btnInsertarGuardas.addClass('d-none');
|
||||||
}
|
}
|
||||||
|
self.comparadorGuardasRunning = false;
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
self.comparadorGuardasRunning = false;
|
||||||
}
|
}
|
||||||
).post();
|
).post();
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
|
self.comparadorGuardasRunning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user