mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into fix/permisos-mensajeria-sidebar
This commit is contained in:
@ -68,7 +68,7 @@ class Chat {
|
||||
}
|
||||
|
||||
if (this.chatHistoryBody[0]) {
|
||||
console.log("History body");
|
||||
//console.log("History body");
|
||||
this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], {
|
||||
wheelPropagation: false,
|
||||
suppressScrollX: true,
|
||||
|
||||
@ -82,7 +82,7 @@ class PresupuestoAdminEdit {
|
||||
|
||||
// Autonumeric
|
||||
AutoNumeric.multiple('.autonumeric-currency', { decimalPlaces: 2, currencySymbol: '€', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
||||
|
||||
|
||||
const impresion_id = $('#tipo_impresion_id').val();
|
||||
let tipoLibro = '';
|
||||
if (impresion_id == 1 || impresion_id == 2) {
|
||||
@ -120,6 +120,30 @@ class PresupuestoAdminEdit {
|
||||
this.tiradasAlternativas.init();
|
||||
this.resumen.init();
|
||||
|
||||
$('#btn_ajustar_revisado').on('click', function () {
|
||||
|
||||
this.resumen.updateTotales({ updateLP: true, updateServicios: true, updateEnvio: true }, true);
|
||||
}.bind(this));
|
||||
|
||||
$('#total_aceptado_revisado').on('change', function () {
|
||||
let totalCostes = AutoNumeric.getAutoNumericElement($('#totalCostes')[0]);
|
||||
let envio_base = AutoNumeric.getAutoNumericElement($('#precioEnvios')[0]);
|
||||
let autoTotalAceptado = AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]);
|
||||
let total_aceptado_revisado = autoTotalAceptado.getNumber();
|
||||
|
||||
if (total_aceptado_revisado && total_aceptado_revisado != 0) {
|
||||
const nuevoTotal = totalCostes.getNumber() + envio_base.getNumber();
|
||||
|
||||
if (total_aceptado_revisado < nuevoTotal) {
|
||||
// Solo usá .set(), no .val() ni .html()
|
||||
autoTotalAceptado.set(nuevoTotal);
|
||||
total_aceptado_revisado = nuevoTotal;
|
||||
}
|
||||
|
||||
totalMargenes = total_aceptado_revisado - nuevoTotal;
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
if (window.location.href.includes("edit")) {
|
||||
|
||||
setTimeout(() => {
|
||||
@ -142,7 +166,7 @@ class PresupuestoAdminEdit {
|
||||
target.removeClass('d-none');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).on('update-presupuesto', this.updatePresupuesto.bind(this));
|
||||
|
||||
@ -375,6 +399,10 @@ class PresupuestoAdminEdit {
|
||||
self.tipo_impresion.val(response.data.tipo_impresion);
|
||||
self.POD.val(response.data.POD);
|
||||
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(response.data.total_aceptado_revisado);
|
||||
|
||||
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
||||
|
||||
$('#created_by').html(response.data.created_by);
|
||||
$('#updated_by').html(response.data.updated_by);
|
||||
$('#created_at').html(response.data.created_at);
|
||||
@ -620,7 +648,7 @@ class PresupuestoAdminEdit {
|
||||
const svgData = serializer.serializeToString(shapeSvgEl);
|
||||
const svgBlob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
|
||||
const svgUrl = URL.createObjectURL(svgBlob);
|
||||
const img = new Image(shapeSvgEl.getBoundingClientRect().width,shapeSvgEl.getBoundingClientRect().height);
|
||||
const img = new Image(shapeSvgEl.getBoundingClientRect().width, shapeSvgEl.getBoundingClientRect().height);
|
||||
img.onload = () => {
|
||||
const scaleFactor = 3; // Increase resolution (e.g., 2x, 3x)
|
||||
const canvas = document.createElement('canvas');
|
||||
@ -631,7 +659,7 @@ class PresupuestoAdminEdit {
|
||||
canvas.height = height * scaleFactor;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.scale(scaleFactor, scaleFactor);
|
||||
ctx.drawImage(img, 0,0,width,height);
|
||||
ctx.drawImage(img, 0, 0, width, height);
|
||||
const pngUrl = canvas.toDataURL('image/png');
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.href = pngUrl;
|
||||
|
||||
@ -548,10 +548,10 @@ class DatosLibro {
|
||||
|
||||
this.updateComparador();
|
||||
|
||||
const url2 = window.location.href;
|
||||
const url_parts2 = url2.split('/');
|
||||
const url = window.location.href;
|
||||
|
||||
|
||||
if (url_parts2[url_parts2.length - 2] == 'edit') {
|
||||
if (url.includes('edit')) {
|
||||
$(document).trigger('update-presupuesto', {
|
||||
update_lineas: true,
|
||||
update_servicios: true,
|
||||
|
||||
@ -41,14 +41,13 @@ class Envios {
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
order: [[0, "asc"]],
|
||||
pageLength: 20,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
paging: false,
|
||||
info: false,
|
||||
scrollX: true,
|
||||
|
||||
ordering: false,
|
||||
columns: [
|
||||
{ 'data': 'tarifa_id' },
|
||||
{ 'data': 'cantidad' },
|
||||
@ -87,10 +86,10 @@ class Envios {
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [$('#tableOfDireccionesEnvio').find("tr:first th").length - 1]
|
||||
// all columns
|
||||
targets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
|
||||
//targets: [$('#tableOfDireccionesEnvio').find("tr:first th").length - 1]
|
||||
},
|
||||
{ "orderData": [0], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
|
||||
@ -235,7 +235,7 @@ class LineasPresupuesto {
|
||||
|
||||
let tipo = 'negro';
|
||||
switch (row.row_id) {
|
||||
case 'lp_negrohq':
|
||||
case 'lp_bnhq':
|
||||
tipo = 'negrohq';
|
||||
break;
|
||||
case 'lp_rot_color':
|
||||
@ -1727,7 +1727,7 @@ class LineasPresupuesto {
|
||||
let tipo = 'negro';
|
||||
let uso = 'interior';
|
||||
switch (tipoLinea) {
|
||||
case 'lp_negrohq':
|
||||
case 'lp_bnhq':
|
||||
tipo = 'negrohq';
|
||||
break;
|
||||
case 'lp_rot_color':
|
||||
|
||||
@ -11,7 +11,7 @@ class Resumen {
|
||||
const self = this;
|
||||
this.toastPresupuestoTotal = null
|
||||
$(".update-totales").on("change", function () {
|
||||
self.updateTotales(true, true, true)
|
||||
self.updateTotales(null, { updateLP: true, updateServicios: true, updateEnvio: true });
|
||||
});
|
||||
|
||||
$(document).on('update-totales', async function () {
|
||||
@ -26,22 +26,22 @@ class Resumen {
|
||||
// Mapear los valores a los elementos HTML por ID
|
||||
$("#totalCostePapel").val(resumen.total_coste_papel || 0);
|
||||
$("#totalCostePapel").html(resumen.total_coste_papel || 0);
|
||||
$("#porcentajeMargenPapel").val(resumen.total_margenPercent_papel ? resumen.total_margenPercent_papel: 0);
|
||||
$("#porcentajeMargenPapel").html(resumen.total_margenPercent_papel ? resumen.total_margenPercent_papel: 0);
|
||||
$("#porcentajeMargenPapel").val(resumen.total_margenPercent_papel ? resumen.total_margenPercent_papel : 0);
|
||||
$("#porcentajeMargenPapel").html(resumen.total_margenPercent_papel ? resumen.total_margenPercent_papel : 0);
|
||||
$("#margenPapel").val(resumen.total_margen_papel || 0);
|
||||
$("#margenPapel").html(resumen.total_margen_papel || 0);
|
||||
|
||||
$("#totalCosteImpresion").val(resumen.total_coste_impresion || 0);
|
||||
$("#totalCosteImpresion").html(resumen.total_coste_impresion || 0);
|
||||
$("#porcentajeMargenImpresion").val(resumen.total_margenPercent_impresion ? resumen.total_margenPercent_impresion: 0);
|
||||
$("#porcentajeMargenImpresion").html(resumen.total_margenPercent_impresion ? resumen.total_margenPercent_impresion: 0);
|
||||
$("#porcentajeMargenImpresion").val(resumen.total_margenPercent_impresion ? resumen.total_margenPercent_impresion : 0);
|
||||
$("#porcentajeMargenImpresion").html(resumen.total_margenPercent_impresion ? resumen.total_margenPercent_impresion : 0);
|
||||
$("#margenImpresion").val(resumen.total_margen_impresion || 0);
|
||||
$("#margenImpresion").html(resumen.total_margen_impresion || 0);
|
||||
|
||||
$("#totalServicios").html(resumen.total_coste_servicios || 0);
|
||||
$("#totalServicios").val(resumen.total_coste_servicios || 0);
|
||||
$("#porcentajeMargenServicios").val(resumen.total_margenPercent_servicios ? resumen.total_margenPercent_servicios: 0);
|
||||
$("#porcentajeMargenServicios").html(resumen.total_margenPercent_servicios ? resumen.total_margenPercent_servicios: 0);
|
||||
$("#porcentajeMargenServicios").val(resumen.total_margenPercent_servicios ? resumen.total_margenPercent_servicios : 0);
|
||||
$("#porcentajeMargenServicios").html(resumen.total_margenPercent_servicios ? resumen.total_margenPercent_servicios : 0);
|
||||
$("#margenServicios").val(resumen.total_margen_servicios || 0);
|
||||
$("#margenServicios").html(resumen.total_margen_servicios || 0);
|
||||
|
||||
@ -52,11 +52,11 @@ class Resumen {
|
||||
$("#margenEnvios").html(resumen.total_margen_envios || 0);
|
||||
$("#margenEnvios").val(resumen.total_margen_envios || 0);
|
||||
|
||||
$("#totalCostes").html(resumen.total_costes || 0);
|
||||
$("#porcentajeMargen").html(resumen.porcentajeMargen ? resumen.porcentajeMargen: 0);
|
||||
$("#totalCostes").html(resumen.total_costes || 0).val();
|
||||
$("#porcentajeMargen").html(resumen.porcentajeMargen ? resumen.porcentajeMargen : 0);
|
||||
$("#totalMargenes").html(resumen.total_margenes || 0);
|
||||
$("#totalCostes").val(resumen.total_costes || 0);
|
||||
$("#porcentajeMargen").val(resumen.porcentajeMargen ? resumen.porcentajeMargen: 0);
|
||||
$("#porcentajeMargen").val(resumen.porcentajeMargen ? resumen.porcentajeMargen : 0);
|
||||
$("#totalMargenes").val(resumen.total_margenes || 0);
|
||||
|
||||
$("#totalAntesDescuento").html(resumen.total_antes_descuento || 0);
|
||||
@ -64,14 +64,14 @@ class Resumen {
|
||||
$("#descuentoTotal").html(resumen.total_descuento || 0);
|
||||
$("#totalDespuesDecuento").html(resumen.total_presupuesto || 0).trigger("change")
|
||||
$("#precioUnidadPresupuesto").html(resumen.total_precio_unidad || 0);
|
||||
$("#factor").html(resumen.total_factor|| 0);
|
||||
$("#factor_ponderado").html(resumen.total_factor_ponderado|| 0);
|
||||
$("#factor").html(resumen.total_factor || 0);
|
||||
$("#factor_ponderado").html(resumen.total_factor_ponderado || 0);
|
||||
$("#totalAntesDescuento").val(resumen.total_antes_descuento || 0);
|
||||
$("#descuentoTotal").val(resumen.total_descuento || 0);
|
||||
$("#totalDespuesDecuento").val(resumen.total_presupuesto || 0).trigger("change")
|
||||
$("#precioUnidadPresupuesto").val(resumen.total_precio_unidad || 0);
|
||||
$("#factor").val(resumen.total_factor|| 0);
|
||||
$("#factor_ponderado").val(resumen.total_factor_ponderado|| 0);
|
||||
$("#factor").val(resumen.total_factor || 0);
|
||||
$("#factor_ponderado").val(resumen.total_factor_ponderado || 0);
|
||||
|
||||
if (resumen.total_aceptado !== undefined) {
|
||||
$("#totalAceptado").html(resumen.total_aceptado || 0);
|
||||
@ -94,7 +94,7 @@ class Resumen {
|
||||
|
||||
|
||||
|
||||
async updateTotales(event, data = {}) {
|
||||
async updateTotales(data = {}, ajustar = false) {
|
||||
|
||||
const self = this;
|
||||
|
||||
@ -181,7 +181,7 @@ class Resumen {
|
||||
$('#porcentajeMargenImpresion').html(porcentajeMargenImpresion).val(porcentajeMargenImpresion.toFixed(2))
|
||||
$('#totalCosteImpresion').html(totalImpresion).val(totalImpresion.toFixed(2))
|
||||
$('#margenImpresion').html(margenImpresion).val(margenImpresion.toFixed(2))
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
@ -297,9 +297,48 @@ class Resumen {
|
||||
margenEnvios = parseFloat($('#margenEnvios').attr('val'))
|
||||
}
|
||||
|
||||
let totalCostes = parseFloat(totalPapel.toFixed(2)) + parseFloat(totalImpresion.toFixed(2)) + parseFloat(totalServicios.toFixed(2)) + parseFloat(totalEnvios.toFixed(2))
|
||||
let totalCostes = parseFloat(totalPapel.toFixed(2)) + parseFloat(totalImpresion.toFixed(2))
|
||||
+ parseFloat(totalServicios.toFixed(2)) + parseFloat(totalEnvios.toFixed(2))
|
||||
|
||||
let totalMargenes = parseFloat(margenPapel.toFixed(2)) + parseFloat(margenImpresion.toFixed(2)) + parseFloat(margenServicios.toFixed(2)) + parseFloat(margenEnvios.toFixed(2))
|
||||
let porcentajeMargen = totalCostes + totalMargenes > 0 ? (100 * totalMargenes / (totalCostes + totalMargenes)).toFixed(0) : 0
|
||||
|
||||
let autoTotalAceptado = AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]);
|
||||
let total_aceptado_revisado = autoTotalAceptado.getNumber();
|
||||
|
||||
if (ajustar) {
|
||||
if (total_aceptado_revisado && total_aceptado_revisado != 0) {
|
||||
const nuevoTotal = totalCostes + totalEnvios_base;
|
||||
|
||||
|
||||
if (total_aceptado_revisado < nuevoTotal) {
|
||||
|
||||
if($('#total_aceptado')){
|
||||
$('#div_ajustar_error').removeClass('d-none');
|
||||
$('#error_recalcular_margen').hide().empty().
|
||||
html('El presupuesto está confirmado y el total coste + precio de envio es menor que el total aceptado y revisado').
|
||||
fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#div_ajustar_error').addClass('d-none');
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
autoTotalAceptado.set(nuevoTotal);
|
||||
total_aceptado_revisado = nuevoTotal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(!($('#total_aceptado') && total_aceptado_revisado < nuevoTotal)){
|
||||
totalMargenes = total_aceptado_revisado - nuevoTotal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let porcentajeMargen = totalCostes + totalMargenes > 0 ? (100 * totalMargenes / (totalCostes)).toFixed(0) : 0
|
||||
$('#totalCostes').html(totalCostes).val(totalCostes.toFixed(2))
|
||||
$('#totalMargenes').html(totalMargenes).val(totalMargenes.toFixed(2))
|
||||
$('#porcentajeMargen').html(porcentajeMargen).val(porcentajeMargen)
|
||||
@ -307,11 +346,10 @@ class Resumen {
|
||||
if ($('#total_descuentoPercent').val() < 0) {
|
||||
$('#total_descuentoPercent').val(0)
|
||||
}
|
||||
let totalAntesDescuento = totalCostes + totalMargenes - parseFloat(totalEnvios.toFixed(2)) + totalEnvios_base;
|
||||
let totalAntesDescuento = totalCostes + totalMargenes + totalEnvios_base;
|
||||
let totalDescuento = totalAntesDescuento * parseInt($('#total_descuentoPercent').val() || 0) / 100
|
||||
let totalPresupuesto = totalAntesDescuento - totalDescuento; // para el calculo del precio_u solo se tiene en cuenta el base
|
||||
let precioUnidad = totalPresupuesto / parseInt($('#tirada').val())
|
||||
totalPresupuesto += totalEnvios;
|
||||
|
||||
$('#totalAntesDescuento').html(totalAntesDescuento).val(totalAntesDescuento.toFixed(2))
|
||||
$('#descuentoTotal').html(totalDescuento).val(totalDescuento.toFixed(2))
|
||||
@ -369,9 +407,18 @@ class Resumen {
|
||||
data.total_aceptado = $('#totalDespuesDecuento').val();
|
||||
}
|
||||
|
||||
let autoTotalAceptado = AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]);
|
||||
let total_aceptado_revisado = autoTotalAceptado.getNumber();
|
||||
if (total_aceptado_revisado && total_aceptado_revisado != 0) {
|
||||
data.total_aceptado_revisado = total_aceptado_revisado;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
updateFromTotalAceptadoRevisado() {
|
||||
}
|
||||
|
||||
roundToTwoDecimals(num) {
|
||||
return parseFloat(num.toFixed(2));
|
||||
}
|
||||
|
||||
@ -116,13 +116,13 @@ class Servicios {
|
||||
}
|
||||
else if (servicio == 'ferro') {
|
||||
const id = $('#ferro').attr('service-id');
|
||||
if(!this.checkServiceInTable(this.serviciosExtra.table, id))
|
||||
this.serviciosExtra.getPresupuestoExtra(id);
|
||||
if (!this.checkServiceInTable(this.serviciosExtra.table, id))
|
||||
this.serviciosExtra.getPresupuestoExtra(id);
|
||||
}
|
||||
else if (servicio == 'ferroDigital') {
|
||||
const id = $('#ferroDigital').attr('service-id');
|
||||
if(!this.checkServiceInTable(this.serviciosExtra.table, id))
|
||||
this.serviciosExtra.getPresupuestoExtra(id);
|
||||
if (!this.checkServiceInTable(this.serviciosExtra.table, id))
|
||||
this.serviciosExtra.getPresupuestoExtra(id);
|
||||
}
|
||||
else if (servicio == 'prototipo') {
|
||||
const id = $('#prototipo').attr('service-id');
|
||||
@ -137,7 +137,7 @@ class Servicios {
|
||||
else if (servicio == 'retractilado5') {
|
||||
const id = $('#retractilado5').attr('service-id');
|
||||
if (!this.checkServiceInTable(this.serviciosAcabado.table, id))
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id, null, null,true);
|
||||
this.serviciosAcabado.getPresupuestoAcabado(id, null, null, true);
|
||||
}
|
||||
else if (servicio == 'solapas_cubierta') {
|
||||
const id = $('#serv_solapas_cubierta').attr('service-id');
|
||||
@ -227,7 +227,7 @@ class Servicios {
|
||||
}
|
||||
else if (servicio == 'retractilado') {
|
||||
const id = $('#retractilado').attr('service-id');
|
||||
for(let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
for (let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
let data = this.serviciosAcabado.table.row(i).data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.serviciosAcabado.table.row(i).remove();
|
||||
@ -238,7 +238,7 @@ class Servicios {
|
||||
}
|
||||
else if (servicio == 'retractilado5') {
|
||||
const id = $('#retractilado5').attr('service-id');
|
||||
for(let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
for (let i = this.serviciosAcabado.table.rows().count(); i >= 0; i--) {
|
||||
let data = this.serviciosAcabado.table.row(i).data();
|
||||
if (data && data.tarifa_id == id) {
|
||||
this.serviciosAcabado.table.row(i).remove();
|
||||
@ -461,6 +461,10 @@ class ServiciosAcabado {
|
||||
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
var tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var tirada = 0
|
||||
@ -532,6 +536,10 @@ class ServiciosAcabado {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
if (tarifa_ids.length > 0 && tirada > 0) {
|
||||
const data = {
|
||||
@ -578,6 +586,10 @@ class ServiciosAcabado {
|
||||
let tirada = 0
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
let datos = {
|
||||
tirada: tirada,
|
||||
@ -596,7 +608,7 @@ class ServiciosAcabado {
|
||||
new Ajax('/serviciosacabados/getvalues', datos, {},
|
||||
function (response) {
|
||||
if (response.values) {
|
||||
if(uso=='cubierta'){
|
||||
if (uso == 'cubierta') {
|
||||
for (let i = self.table.rows().count() - 1; i >= 0; i--) {
|
||||
let data = self.table.row(i).data();
|
||||
if (data && (data.cubierta == 1)) {
|
||||
@ -604,7 +616,7 @@ class ServiciosAcabado {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(uso=='sobrecubierta'){
|
||||
else if (uso == 'sobrecubierta') {
|
||||
for (let i = self.table.rows().count() - 1; i >= 0; i--) {
|
||||
let data = self.table.row(i).data();
|
||||
if (data && (data.sobrecubierta == 1)) {
|
||||
@ -612,7 +624,7 @@ class ServiciosAcabado {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(uso=='faja'){
|
||||
else if (uso == 'faja') {
|
||||
for (let i = self.table.rows().count() - 1; i >= 0; i--) {
|
||||
let data = self.table.row(i).data();
|
||||
if (data && (data.faja == 1)) {
|
||||
@ -645,7 +657,7 @@ class ServiciosAcabado {
|
||||
else {
|
||||
self.table.rows.add(response.values).draw(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
function (error) {
|
||||
@ -1059,7 +1071,11 @@ class ServiciosEncuadernacion {
|
||||
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
tirada = parseInt($('#tirada').val());
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
|
||||
let paginas = 0;
|
||||
@ -1160,6 +1176,10 @@ class ServiciosEncuadernacion {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
let paginas = 0;
|
||||
if (parseInt($('#paginas').val()) > 0) {
|
||||
@ -1201,6 +1221,10 @@ class ServiciosEncuadernacion {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
let paginas = 0;
|
||||
if (parseInt($('#paginas').val()) > 0) {
|
||||
@ -1243,6 +1267,10 @@ class ServiciosEncuadernacion {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
let paginas = 0;
|
||||
if (parseInt($('#paginas').val()) > 0) {
|
||||
@ -1531,6 +1559,10 @@ class ServiciosManipulado {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
|
||||
let datos = {
|
||||
@ -1568,6 +1600,10 @@ class ServiciosManipulado {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
|
||||
if (tarifa_ids.length > 0) {
|
||||
@ -1597,6 +1633,10 @@ class ServiciosManipulado {
|
||||
let tirada = 0;
|
||||
if (parseInt($('#tirada').val()) > 0) {
|
||||
tirada = parseInt($('#tirada').val())
|
||||
var merma = parseInt($('#merma').val())
|
||||
if (merma && merma > 0) {
|
||||
tirada = tirada + merma;
|
||||
}
|
||||
}
|
||||
|
||||
let datos = {
|
||||
|
||||
@ -324,6 +324,7 @@ class DisenioCubierta {
|
||||
this.papelCubierta = datosCubierta.papel.id;
|
||||
this.gramaje = datosCubierta.gramaje;
|
||||
|
||||
|
||||
if (datosCubierta.lomoRedondo) {
|
||||
this.tapaDuraLomoRedondo.trigger('click');
|
||||
}
|
||||
@ -336,23 +337,25 @@ class DisenioCubierta {
|
||||
}
|
||||
}
|
||||
|
||||
if (datosCubierta.tapa == "dura") {
|
||||
this.papelGuardas.setOption(datosGuardas.papel_id, datosGuardas.papel);
|
||||
this.gramajeGuardas.setOption(datosGuardas.gramaje, datosGuardas.gramaje);
|
||||
this.guardasImpresas.val(datosGuardas.paginas).trigger('change');
|
||||
this.cabezada.val(datosCubierta.cabezada).trigger('change');
|
||||
}
|
||||
else {
|
||||
this.carasCubierta.val(datosCubierta.paginas).trigger('change');
|
||||
if (datosCubierta.solapas) {
|
||||
this.conSolapas.trigger('click');
|
||||
this.tamanioSolapasCubierta.val(datosCubierta.solapas_ancho);
|
||||
|
||||
setTimeout(() => {
|
||||
if (datosCubierta.tapa == "dura") {
|
||||
this.papelGuardas.setOption(datosGuardas.papel_id, datosGuardas.papel);
|
||||
this.gramajeGuardas.setOption(datosGuardas.gramaje, datosGuardas.gramaje);
|
||||
this.guardasImpresas.val(datosGuardas.paginas).trigger('change');
|
||||
this.cabezada.val(datosCubierta.cabezada).trigger('change');
|
||||
}
|
||||
else {
|
||||
this.sinSolapas.trigger('click');
|
||||
this.carasCubierta.val(datosCubierta.paginas).trigger('change');
|
||||
if (datosCubierta.solapas) {
|
||||
this.conSolapas.trigger('click');
|
||||
this.tamanioSolapasCubierta.val(datosCubierta.solapas_ancho);
|
||||
|
||||
}
|
||||
else {
|
||||
this.sinSolapas.trigger('click');
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
|
||||
this.divPapelCubierta.find(`[cod="${datosCubierta.papel.code}"]`).addClass('selected');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user