arreglados bugs en totalizadores y previews

This commit is contained in:
Jaime Jiménez
2024-01-10 19:21:05 +01:00
parent 2d91f63e39
commit 05e43e68db
4 changed files with 21 additions and 7 deletions

2
.vscode/sftp.json vendored
View File

@ -5,7 +5,7 @@
"remotePath": "/",
"uploadOnSave": true,
"useTempFile": false,
"openSsh": false,
"openSsh": false,
"profiles": {
"jjo": {
"host": "sk-jjo.imnavajas.es",

View File

@ -633,8 +633,8 @@ function processRowData(row, rowId, rowClass){
'maquina_impresion_ancho': blank_line?0:isNaN(parseFloat(row.dimensiones_maquina_impresion[0])) ? "" : parseFloat(row.dimensiones_maquina_impresion[0]),
'maquina_impresion_alto': blank_line?0:isNaN(parseFloat(row.dimensiones_maquina_impresion[1])) ? "" : parseFloat(row.dimensiones_maquina_impresion[1]),
'formas': blank_line?0:isNaN(parseInt(row.num_formas.value)) ? 0 : parseInt(row.num_formas.value),
'formas_v': blank_line?0:isNaN(parseInt(row.num_formas.num_formas_horizontales)) ? 0 : parseInt(row.num_formas.num_formas_horizontales),
'formas_h': blank_line?0:isNaN(parseInt(row.num_formas.num_formas_verticales)) ? 0 : parseInt(row.num_formas.num_formas_verticales),
'formas_v': blank_line?0:isNaN(parseInt(row.num_formas.num_formas_verticales)) ? 0 : parseInt(row.num_formas.num_formas_verticales),
'formas_h': blank_line?0:isNaN(parseInt(row.num_formas.num_formas_horizontales)) ? 0 : parseInt(row.num_formas.num_formas_horizontales),
'formas_orientacion': blank_line?0:row.num_formas.posicion_formas,
'icon': icon,
@ -2736,7 +2736,6 @@ function fill_lp_rot_color(row, fromComparador=false){
}
else{
// Si viene de hacerlo a mano...
// Si viene de hacerlo a mano...
data = processRowData(row, 'lp_rot_color', 'lp-rot-color');

View File

@ -124,6 +124,12 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
$('#totalCosteImpresion').text(totalImpresion.toFixed(2) + '€')
$('#margenImpresion').text(margenImpresion.toFixed(2) + '€')
}
else{
totalPapel = parseFloat($('#totalCostePapel').text().replace('€', ''))
totalMargenes = parseFloat($('#margenPapel').text().replace('€', ''))
totalImpresion = parseFloat($('#totalCosteImpresion').text().replace('€', ''))
margenImpresion = parseFloat($('#margenImpresion').text().replace('€', ''))
}
if(updateServicios){
@ -175,6 +181,11 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
$('#totalServicios').text(totalServicios.toFixed(2) + '€')
$('#margenServicios').text(margenServicios.toFixed(2) + '€')
}
else{
totalServicios = parseFloat($('#totalServicios').text().replace('€', ''))
margenServicios = parseFloat($('#margenServicios').text().replace('€', ''))
}
if(updateEnvio){
@ -190,6 +201,10 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
$('#totalEnvios').text(totalEnvios.toFixed(2) + '€')
$('#margenEnvios').text(margenEnvios.toFixed(2) + '€')
}
else{
totalEnvios = parseFloat($('#totalEnvios').text().replace('€', ''))
margenEnvios = parseFloat($('#margenEnvios').text().replace('€', ''))
}
var totalCostes = totalPapel + totalImpresion + totalServicios + totalEnvios
var totalMargenes = margenPapel + margenImpresion + margenServicios + margenEnvios

View File

@ -99,7 +99,7 @@ function previewRotativa(lpTagName) {
// Guarda vertical
if (pvObj.nFormasV > 1) {
guardaV = 3;
}
}
// Guarda horizontal
if (pvObj.nFormasH > 1) {
guardaH = 3;
@ -401,8 +401,8 @@ function getObjetoLP(lpName) {
lomoLibro: getLomoLibro(),
anchoSolapa: parseFloat($('#solapas_ancho').val()),
nFormas: parseInt(rowData.formas),
nFormasH: parseInt(rowData.formas_v),
nFormasV: parseInt(rowData.formas_h),
nFormasH: parseInt(rowData.formas_h),
nFormasV: parseInt(rowData.formas_v),
orientacionFormas: rowData.formas_orientacion,
altoMaquina: parseFloat(rowData.maquina_alto),
anchoMaquina: parseFloat(rowData.maquina_ancho),