mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
hay que corregir el checkeo de lineas con las paginas
This commit is contained in:
@ -443,7 +443,7 @@
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<div class="row guardas">
|
||||
<div id="divGuardas" class="row guardas">
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="impresionGuardas" class="form-label">Impresión de guardas</label>
|
||||
<select id="impresionGuardas" name="impresionGuardas" class="form-control select2bs2 comp_guardas_items calcular-presupuesto" style="width: 100%;">
|
||||
|
||||
@ -2,7 +2,8 @@ function initDirecciones() {
|
||||
data = {
|
||||
id: $('#clienteId').val()
|
||||
},
|
||||
data = Object.assign(data, window.token_ajax)
|
||||
data = Object.assign(data, window.token_ajax);
|
||||
$('#errorDirecciones').hide();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_direcciones.direcciones,
|
||||
|
||||
@ -266,12 +266,16 @@ $('#papelInterior').on('change', function () {
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeInterior').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeInterior').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
if(response.menu){
|
||||
|
||||
if (valInterior != undefined)
|
||||
$('#gramajeInterior').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeInterior').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (valInterior != undefined && valInterior != '')
|
||||
$('#gramajeInterior option[value=' + valInterior + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
@ -310,7 +314,7 @@ $('#papelCubierta').on('change', function () {
|
||||
$('#gramajeCubierta').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valCubierta != undefined)
|
||||
if (valCubierta != undefined && valCubierta != '')
|
||||
$('#gramajeCubierta option[value=' + valCubierta + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeCubierta').val('').trigger('change');
|
||||
@ -647,7 +651,7 @@ async function calcularPresupuesto() {
|
||||
}
|
||||
|
||||
// Si hay sobrecubierta
|
||||
if ($('.enable-sobrecubierta').is(':visible')) {
|
||||
if ($('#enableSobrecubierta').is(':checked')) {
|
||||
if($('#papelSobrecubierta option:selected').val()>0 && $('#gramajeSobrecubierta option:selected').val()>0){
|
||||
|
||||
datos.sobrecubierta = {
|
||||
@ -661,7 +665,7 @@ async function calcularPresupuesto() {
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.guardas').is(':visible')) {
|
||||
if ($('#divGuardas').is(':visible')) {
|
||||
datos.guardas = {
|
||||
papel: $('#papelGuardas option:selected').val(),
|
||||
papel_nombre: $('#papelGuardas option:selected').text().trim(),
|
||||
@ -681,6 +685,7 @@ async function calcularPresupuesto() {
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
error = false;
|
||||
$('#errorGeneral').hide();
|
||||
try{
|
||||
|
||||
|
||||
@ -727,32 +732,35 @@ async function calcularPresupuesto() {
|
||||
|
||||
$('#divTiradasPrecio').empty();
|
||||
|
||||
$('#lomo_cubierta').val(response.lomo_cubierta);
|
||||
if(!error){
|
||||
|
||||
$('#precios').show();
|
||||
$('#lomo_cubierta').val(response.lomo_cubierta);
|
||||
|
||||
if(response.tiradas){
|
||||
for (i = 0; i < response.tiradas.length; i++) {
|
||||
const total = (parseFloat(response.precio_u[i]) * parseInt(response.tiradas[i])).toFixed(2) ;
|
||||
const label = "tiradaPrecio" + parseInt(i+1);
|
||||
$('#precios').show();
|
||||
|
||||
let html = '';
|
||||
if(response.tiradas){
|
||||
for (i = 0; i < response.tiradas.length; i++) {
|
||||
const total = (parseFloat(response.precio_u[i]) * parseInt(response.tiradas[i])).toFixed(2) ;
|
||||
const label = "tiradaPrecio" + parseInt(i+1);
|
||||
|
||||
html += '<div id="' + label + '" peso="' +response.peso[i]+ '" class="list-group" >';
|
||||
html += '<a href="javascript:void(0);" class="list-group-item list-group-item-action">';
|
||||
html += '<div class="li-wrapper d-flex justify-content-start align-items-center" >';
|
||||
html += '<div class="list-content">';
|
||||
html += '<h7 id="ud_' + label + '" class="mb-1">' + (response.tiradas[i] + ' ud.') + '</h7>';
|
||||
html += '<h6 id="tot_' + label + '" class="mb-1">' + ('Total: ' + total + '€') + '</h6>';
|
||||
html += '<h7 id="pu_' + label + '" class="mb-1">' + (response.precio_u[i] + '€/ud') + '</h7>';
|
||||
html += '</div>';
|
||||
html += '</div>'
|
||||
html += '</a>';
|
||||
html += '</div>';
|
||||
let html = '';
|
||||
|
||||
$('#divTiradasPrecio').append(html);
|
||||
}
|
||||
}
|
||||
html += '<div id="' + label + '" peso="' +response.peso[i]+ '" class="list-group" >';
|
||||
html += '<a href="javascript:void(0);" class="list-group-item list-group-item-action">';
|
||||
html += '<div class="li-wrapper d-flex justify-content-start align-items-center" >';
|
||||
html += '<div class="list-content">';
|
||||
html += '<h7 id="ud_' + label + '" class="mb-1">' + (response.tiradas[i] + ' ud.') + '</h7>';
|
||||
html += '<h6 id="tot_' + label + '" class="mb-1">' + ('Total: ' + total + '€') + '</h6>';
|
||||
html += '<h7 id="pu_' + label + '" class="mb-1">' + (response.precio_u[i] + '€/ud') + '</h7>';
|
||||
html += '</div>';
|
||||
html += '</div>'
|
||||
html += '</a>';
|
||||
html += '</div>';
|
||||
|
||||
$('#divTiradasPrecio').append(html);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
$('#loader').hide();
|
||||
|
||||
@ -272,7 +272,7 @@
|
||||
// clientePresupuestoWizardForm.submit()
|
||||
// or send the form data to server via an Ajax request
|
||||
// To make the demo simple, I just placed an alert
|
||||
alert('Submitted..!!');
|
||||
//alert('Submitted..!!');
|
||||
});
|
||||
|
||||
clientePresupuestoWizardNext.forEach(item => {
|
||||
|
||||
@ -171,7 +171,7 @@ function finalizarPresupuesto(confirmar){
|
||||
}
|
||||
|
||||
// Si hay sobrecubierta
|
||||
if ($('.enable-sobrecubierta').is(':visible')) {
|
||||
if ($('#enableSobrecubierta').is(':checked')) {
|
||||
if($('#papelSobrecubierta option:selected').val()>0 && $('#gramajeSobrecubierta option:selected').val()>0){
|
||||
|
||||
datos_libro.sobrecubierta = {
|
||||
@ -181,11 +181,11 @@ function finalizarPresupuesto(confirmar){
|
||||
acabado: $('#acabadosSobrecubierta').val()
|
||||
}
|
||||
|
||||
datos.sobrecubierta.solapas = $('#anchoSolapasSobrecubierta').val()
|
||||
datos_libro.sobrecubierta.solapas = $('#anchoSolapasSobrecubierta').val()
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.guardas').is(':visible')) {
|
||||
if ($('#divGuardas').is(':visible')) {
|
||||
datos_libro.guardas = {
|
||||
papel: $('#papelGuardas option:selected').val(),
|
||||
papel_nombre: $('#papelGuardas option:selected').text().trim(),
|
||||
@ -236,7 +236,7 @@ function finalizarPresupuesto(confirmar){
|
||||
|
||||
if(Object.keys(response).length > 0) {
|
||||
if(response.status > 0){
|
||||
window.location.href = response.url;
|
||||
//window.location.href = response.url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user