|
|
|
|
@ -24,40 +24,67 @@ class Resumen {
|
|
|
|
|
cargar(resumen) {
|
|
|
|
|
|
|
|
|
|
// Mapear los valores a los elementos HTML por ID
|
|
|
|
|
$("#totalCostePapel").text(resumen.total_coste_papel.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#porcentajeMargenPapel").text(resumen.total_margenPercent_papel ? resumen.total_margenPercent_papel.toString().replace('.', ',') + "%" : "0%");
|
|
|
|
|
$("#margenPapel").text(resumen.total_margen_papel.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#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);
|
|
|
|
|
$("#margenPapel").val(resumen.total_margen_papel || 0);
|
|
|
|
|
$("#margenPapel").html(resumen.total_margen_papel || 0);
|
|
|
|
|
|
|
|
|
|
$("#totalCosteImpresion").text(resumen.total_coste_impresion.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#porcentajeMargenImpresion").text(resumen.total_margenPercent_impresion ? resumen.total_margenPercent_impresion.toString().replace('.', ',') + "%" : "0%");
|
|
|
|
|
$("#margenImpresion").text(resumen.total_margen_impresion.toString().replace('.', ',') + "€" || "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);
|
|
|
|
|
$("#margenImpresion").val(resumen.total_margen_impresion || 0);
|
|
|
|
|
$("#margenImpresion").html(resumen.total_margen_impresion || 0);
|
|
|
|
|
|
|
|
|
|
$("#totalServicios").text(resumen.total_coste_servicios.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#porcentajeMargenServicios").text(resumen.total_margenPercent_servicios ? resumen.total_margenPercent_servicios.toString().replace('.', ',') + "%" : "0%");
|
|
|
|
|
$("#margenServicios").text(resumen.total_margen_servicios + "€" || "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);
|
|
|
|
|
$("#margenServicios").val(resumen.total_margen_servicios || 0);
|
|
|
|
|
$("#margenServicios").html(resumen.total_margen_servicios || 0);
|
|
|
|
|
|
|
|
|
|
//$("#costeEnvios").text(resumen.total_coste_envios + "€" || "0€");
|
|
|
|
|
$("#totalEnvios").text(resumen.total_coste_envios.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#margenEnvios").text(resumen.total_margen_envios.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#costeEnvios").html(resumen.total_coste_envios || 0);
|
|
|
|
|
$("#costeEnvios").val(resumen.total_coste_envios || 0);
|
|
|
|
|
$("#totalEnvios").html(resumen.total_coste_envios || 0);
|
|
|
|
|
$("#totalEnvios").val(resumen.total_coste_envios || 0);
|
|
|
|
|
$("#margenEnvios").html(resumen.total_margen_envios || 0);
|
|
|
|
|
$("#margenEnvios").val(resumen.total_margen_envios || 0);
|
|
|
|
|
|
|
|
|
|
$("#totalCostes").text(resumen.total_costes.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#porcentajeMargen").text(resumen.porcentajeMargen ? resumen.porcentajeMargen.toString().replace('.', ',') + "%" : "0%");
|
|
|
|
|
$("#totalMargenes").text(resumen.total_margenes.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#totalCostes").html(resumen.total_costes || 0);
|
|
|
|
|
$("#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);
|
|
|
|
|
$("#totalMargenes").val(resumen.total_margenes || 0);
|
|
|
|
|
|
|
|
|
|
$("#totalAntesDescuento").text(resumen.total_antes_descuento.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#total_descuentoPercent").val(resumen.total_descuentoPercent.toString().replace('.', ',') || "0");
|
|
|
|
|
$("#descuentoTotal").text(resumen.total_descuento.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#totalDespuesDecuento").text(resumen.total_presupuesto.toString().replace('.', ',') + "€" || "0€").trigger("change")
|
|
|
|
|
$("#precioUnidadPresupuesto").text(resumen.total_precio_unidad.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#factor").text(resumen.total_factor.toString().replace('.', ',') || "0");
|
|
|
|
|
$("#factor_ponderado").text(resumen.total_factor_ponderado.toString().replace('.', ',') || "0");
|
|
|
|
|
$("#totalAntesDescuento").html(resumen.total_antes_descuento || 0);
|
|
|
|
|
$("#total_descuentoPercent").val(resumen.total_descuentoPercent || 0);
|
|
|
|
|
$("#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);
|
|
|
|
|
$("#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);
|
|
|
|
|
|
|
|
|
|
if (resumen.total_aceptado !== undefined) {
|
|
|
|
|
$("#totalAceptado").val(resumen.total_aceptado.toString().replace('.', ',') + "€" || "0€");
|
|
|
|
|
$("#totalAceptado").html(resumen.total_aceptado || 0);
|
|
|
|
|
$("#totalAceptado").val(resumen.total_aceptado || 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#ivaReducido').val(resumen.iva_reducido ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-currency', { decimalPlaces: 2, currencySymbol: '€', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-currency-4', { decimalPlaces: 4, currencySymbol: '€', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-percent', { decimalPlaces: 0, currencySymbol: '%', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-2', { decimalPlaces: 2, digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update() {
|
|
|
|
|
@ -65,21 +92,6 @@ class Resumen {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Formatear agregando separadores de miles
|
|
|
|
|
addSeparatorsNF(nStr, inD, outD, sep) {
|
|
|
|
|
nStr += '';
|
|
|
|
|
let dpos = nStr.indexOf(inD);
|
|
|
|
|
let nStrEnd = '';
|
|
|
|
|
if (dpos != -1) {
|
|
|
|
|
nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);
|
|
|
|
|
nStr = nStr.substring(0, dpos);
|
|
|
|
|
}
|
|
|
|
|
let rgx = /(\d+)(\d{3})/;
|
|
|
|
|
while (rgx.test(nStr)) {
|
|
|
|
|
nStr = nStr.replace(rgx, '$1' + sep + '$2');
|
|
|
|
|
}
|
|
|
|
|
return nStr + nStrEnd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async updateTotales(event, data = {}) {
|
|
|
|
|
@ -158,18 +170,17 @@ class Resumen {
|
|
|
|
|
sumForFactor += totalPapel;
|
|
|
|
|
|
|
|
|
|
let porcentajeMargenPapel = isNaN(margenPapel / (totalPapel) * 100.0) ? 0 : margenPapel / (totalPapel) * 100.0
|
|
|
|
|
$('#porcentajeMargenPapel').text(porcentajeMargenPapel.toFixed(0) + '%')
|
|
|
|
|
$('#totalCostePapel').text((this.addSeparatorsNF(totalPapel.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#margenPapel').text((this.addSeparatorsNF(margenPapel.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalCostePapel').attr('val', totalPapel.toFixed(2))
|
|
|
|
|
$('#margenPapel').attr('val', margenPapel.toFixed(2))
|
|
|
|
|
$('#porcentajeMargenPapel').html(porcentajeMargenPapel)
|
|
|
|
|
$('#totalCostePapel').val(totalPapel.toFixed(2))
|
|
|
|
|
$('#totalCostePapel').html(totalPapel)
|
|
|
|
|
$('#margenPapel').val(margenPapel.toFixed(2))
|
|
|
|
|
$('#margenPapel').html(margenPapel)
|
|
|
|
|
|
|
|
|
|
let porcentajeMargenImpresion = isNaN(margenImpresion / (totalImpresion) * 100.0) ? 0 : margenImpresion / (totalImpresion) * 100.0
|
|
|
|
|
$('#porcentajeMargenImpresion').text(porcentajeMargenImpresion.toFixed(0) + '%')
|
|
|
|
|
$('#totalCosteImpresion').text((this.addSeparatorsNF(totalImpresion.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#margenImpresion').text((this.addSeparatorsNF(margenImpresion.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalCosteImpresion').attr('val', totalImpresion.toFixed(2))
|
|
|
|
|
$('#margenImpresion').attr('val', margenImpresion.toFixed(2))
|
|
|
|
|
$('#porcentajeMargenImpresion').html(porcentajeMargenImpresion).val(porcentajeMargenImpresion.toFixed(2))
|
|
|
|
|
$('#totalCosteImpresion').html(totalImpresion).val(totalImpresion.toFixed(2))
|
|
|
|
|
$('#margenImpresion').html(margenImpresion).val(margenImpresion.toFixed(2))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
@ -246,11 +257,9 @@ class Resumen {
|
|
|
|
|
sumForFactorPonderado += totalServicios;
|
|
|
|
|
|
|
|
|
|
let porcentajeMargenServicios = margenServicios / (totalServicios) * 100
|
|
|
|
|
$('#porcentajeMargenServicios').text(isNaN(porcentajeMargenServicios.toFixed(0)) ? 0 : porcentajeMargenServicios.toFixed(0) + '%')
|
|
|
|
|
$('#totalServicios').text((this.addSeparatorsNF(totalServicios.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#margenServicios').text((this.addSeparatorsNF(margenServicios.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalServicios').attr('val', totalServicios.toFixed(2) + '€')
|
|
|
|
|
$('#margenServicios').attr('val', margenServicios.toFixed(2) + '€')
|
|
|
|
|
$('#porcentajeMargenServicios').html(isNaN(porcentajeMargenServicios) ? 0 : porcentajeMargenServicios)
|
|
|
|
|
$('#totalServicios').html(totalServicios).val(totalServicios.toFixed(2))
|
|
|
|
|
$('#margenServicios').html(margenServicios).val(margenServicios.toFixed(2))
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
@ -277,10 +286,9 @@ class Resumen {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
totalEnvios -= margenEnvios
|
|
|
|
|
$('#totalEnvios').text((this.addSeparatorsNF(totalEnvios.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#margenEnvios').text((this.addSeparatorsNF(margenEnvios.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalEnvios').attr('val', totalEnvios.toFixed(2) + '€')
|
|
|
|
|
$('#margenEnvios').attr('val', margenEnvios.toFixed(2) + '€')
|
|
|
|
|
$('#totalEnvios').html(totalEnvios_base).val(totalEnvios_base.toFixed(2))
|
|
|
|
|
$('#costeEnvios').html(totalEnvios).val(totalEnvios.toFixed(2))
|
|
|
|
|
$('#margenEnvios').html(margenEnvios).val(margenEnvios.toFixed(2))
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
totalEnvios = parseFloat($('#totalEnvios').attr('val'))
|
|
|
|
|
@ -290,12 +298,9 @@ class Resumen {
|
|
|
|
|
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
|
|
|
|
|
$('#totalCostes').text((this.addSeparatorsNF(totalCostes.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalMargenes').text((this.addSeparatorsNF(totalMargenes.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalCostes').attr('val', (totalCostes).toFixed(2) + '€')
|
|
|
|
|
$('#totalMargenes').attr('val', (totalMargenes).toFixed(2) + '€')
|
|
|
|
|
$('#porcentajeMargen').text(porcentajeMargen + '%')
|
|
|
|
|
$('#porcentajeMargen').attr('val', porcentajeMargen)
|
|
|
|
|
$('#totalCostes').html(totalCostes).val(totalCostes.toFixed(2))
|
|
|
|
|
$('#totalMargenes').html(totalMargenes).val(totalMargenes.toFixed(2))
|
|
|
|
|
$('#porcentajeMargen').html(porcentajeMargen).val(porcentajeMargen)
|
|
|
|
|
|
|
|
|
|
if ($('#total_descuentoPercent').val() < 0) {
|
|
|
|
|
$('#total_descuentoPercent').val(0)
|
|
|
|
|
@ -306,60 +311,60 @@ class Resumen {
|
|
|
|
|
let precioUnidad = totalPresupuesto / parseInt($('#tirada').val())
|
|
|
|
|
totalPresupuesto += totalEnvios;
|
|
|
|
|
|
|
|
|
|
$('#totalAntesDescuento').text((this.addSeparatorsNF(totalAntesDescuento.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#descuentoTotal').text((this.addSeparatorsNF(totalDescuento.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalDespuesDecuento').text((this.addSeparatorsNF(totalPresupuesto.toFixed(2), ".", ",", ".")) + "€")
|
|
|
|
|
$('#precioUnidadPresupuesto').text((this.addSeparatorsNF(precioUnidad.toFixed(4), ".", ",", ".")) + "€")
|
|
|
|
|
$('#totalAntesDescuento').attr('val', (totalAntesDescuento).toFixed(2))
|
|
|
|
|
$('#descuentoTotal').attr('val', (totalDescuento).toFixed(2))
|
|
|
|
|
$('#totalDespuesDecuento').attr('val', (totalPresupuesto).toFixed(2))
|
|
|
|
|
$('#precioUnidadPresupuesto').attr('val', (precioUnidad).toFixed(4))
|
|
|
|
|
$('#totalAntesDescuento').html(totalAntesDescuento).val(totalAntesDescuento.toFixed(2))
|
|
|
|
|
$('#descuentoTotal').html(totalDescuento).val(totalDescuento.toFixed(2))
|
|
|
|
|
$('#totalDespuesDecuento').html(totalPresupuesto).val(totalPresupuesto.toFixed(2))
|
|
|
|
|
$('#precioUnidadPresupuesto').html(precioUnidad).val(precioUnidad.toFixed(4))
|
|
|
|
|
$('#totalDespuesDecuento').trigger("change")
|
|
|
|
|
|
|
|
|
|
$('#factor').text(this.addSeparatorsNF(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactor).toFixed(2), ".", ",", "."))
|
|
|
|
|
$('#factor').attr('val', ((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactor).toFixed(2))
|
|
|
|
|
$('#factor_ponderado').text(this.addSeparatorsNF(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactorPonderado).toFixed(2), ".", ",", "."))
|
|
|
|
|
$('#factor_ponderado').attr('val', ((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactorPonderado).toFixed(2))
|
|
|
|
|
$('#factor').html(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactor))
|
|
|
|
|
$('#factor').val(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactor).toFixed(2))
|
|
|
|
|
$('#factor_ponderado').html(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactorPonderado))
|
|
|
|
|
$('#factor_ponderado').val(((totalPresupuesto - totalEnvios - totalEnvios_base - margenEnvios) / sumForFactorPonderado).toFixed(2))
|
|
|
|
|
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-currency', { decimalPlaces: 2, currencySymbol: '€', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-currency-4', { decimalPlaces: 4, currencySymbol: '€', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-percent', { decimalPlaces: 0, currencySymbol: '%', currencySymbolPlacement: 's', digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
AutoNumeric.multiple('.autonumeric-resumen-2', { decimalPlaces: 2, digitGroupSeparator: '.', decimalCharacter: ',' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getData() {
|
|
|
|
|
|
|
|
|
|
let data = {
|
|
|
|
|
'total_coste_papel': $('#totalCostePapel').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margen_papel': $('#margenPapel').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margenPercent_papel': $('#porcentajeMargenPapel').text().replace('%', '').replace(',', '.'),
|
|
|
|
|
'total_coste_papel': $('#totalCostePapel').val(),
|
|
|
|
|
'total_margen_papel': $('#margenPapel').val(),
|
|
|
|
|
'total_margenPercent_papel': $('#porcentajeMargenPapel').val(),
|
|
|
|
|
|
|
|
|
|
'total_coste_impresion': $('#totalCosteImpresion').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margen_impresion': $('#margenImpresion').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margenPercent_impresion': $('#porcentajeMargenImpresion').text().replace('%', '').replace(',', '.'),
|
|
|
|
|
'total_coste_impresion': $('#totalCosteImpresion').val(),
|
|
|
|
|
'total_margen_impresion': $('#margenImpresion').val(),
|
|
|
|
|
'total_margenPercent_impresion': $('#porcentajeMargenImpresion').val(),
|
|
|
|
|
|
|
|
|
|
'total_coste_servicios': $('#totalServicios').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margen_servicios': $('#margenServicios').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margenPercent_servicios': $('#porcentajeMargenServicios').text().replace('%', '').replace(',', '.'),
|
|
|
|
|
'total_coste_servicios': $('#totalServicios').val(),
|
|
|
|
|
'total_margen_servicios': $('#margenServicios').val(),
|
|
|
|
|
'total_margenPercent_servicios': $('#porcentajeMargenServicios').val(),
|
|
|
|
|
|
|
|
|
|
'total_coste_envios': $('#totalEnvios').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margen_envios': $('#margenEnvios').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_coste_envios': $('#totalEnvios').val(),
|
|
|
|
|
'total_margen_envios': $('#margenEnvios').val(),
|
|
|
|
|
|
|
|
|
|
'total_costes': $('#totalCostes').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_margenes': $('#totalMargenes').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_costes': $('#totalCostes').val(),
|
|
|
|
|
'total_margenes': $('#totalMargenes').val(),
|
|
|
|
|
|
|
|
|
|
'total_antes_descuento': $('#totalAntesDescuento').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_descuento': $('#descuentoTotal').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_descuentoPercent': $('#total_descuentoPercent').val().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_presupuesto': $('#totalDespuesDecuento').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_precio_unidad': $('#precioUnidadPresupuesto').text().replace('€', '').replace(',', '.'),
|
|
|
|
|
'total_antes_descuento': $('#totalAntesDescuento').val(),
|
|
|
|
|
'total_descuento': $('#descuentoTotal').val(),
|
|
|
|
|
'total_descuentoPercent': $('#total_descuentoPercent').val(),
|
|
|
|
|
'total_presupuesto': $('#totalDespuesDecuento').val(),
|
|
|
|
|
'total_precio_unidad': $('#precioUnidadPresupuesto').val(),
|
|
|
|
|
|
|
|
|
|
'total_factor': $('#factor').text().replace(/,/g, '.'),
|
|
|
|
|
'total_factor_ponderado': $('#factor_ponderado').text().replace(/,/g, '.'),
|
|
|
|
|
'total_factor': $('#factor').val(),
|
|
|
|
|
'total_factor_ponderado': $('#factor_ponderado').val(),
|
|
|
|
|
|
|
|
|
|
'iva_reducido': $('#ivaReducido').val()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ($('#confirmar_presupuesto').prop('checked')) {
|
|
|
|
|
data.confirmar = '1';
|
|
|
|
|
data.total_aceptado = $('#totalDespuesDecuento').text().replace('€', '').replace(',', '.');
|
|
|
|
|
data.total_aceptado = $('#totalDespuesDecuento').val();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
@ -373,7 +378,7 @@ class Resumen {
|
|
|
|
|
this.toastPresupuestoTotal.close()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.toastPresupuestoTotal = toastPresupuestoSummary($("#totalDespuesDecuento").text() ?? 0)
|
|
|
|
|
this.toastPresupuestoTotal = toastPresupuestoSummary($("#totalDespuesDecuento").html() ?? 0)
|
|
|
|
|
this.toastPresupuestoTotal.fire().then((result) => {
|
|
|
|
|
if (result.isDismissed && result.dismiss == 'close') {
|
|
|
|
|
this.updateToastSummary()
|
|
|
|
|
|