mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
se modifica el calculo del factor ponderado y se añade orden al tamaño de papel
This commit is contained in:
@ -74,6 +74,8 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
margenImpresion = parseFloat($('#margenImpresion').text().replace('€', ''))
|
||||
}
|
||||
|
||||
sumForFactorPonderado = sumForFactor;
|
||||
|
||||
if(updateServicios){
|
||||
|
||||
if ( typeof $("#tableOfServiciosEncuadernacion").DataTable() !== 'undefined' && $("#tableOfServiciosEncuadernacion").DataTable().rows().count() > 0){
|
||||
@ -119,15 +121,21 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
}
|
||||
|
||||
totalServicios -= margenServicios;
|
||||
|
||||
sumForFactorPonderado += totalServicios;
|
||||
|
||||
var porcentajeMargenServicios = margenServicios/(margenServicios+totalServicios)*100
|
||||
$('#porcentajeMargenServicios').text(isNaN(porcentajeMargenServicios.toFixed(0))?0:porcentajeMargenServicios.toFixed(0) + '%')
|
||||
$('#totalServicios').text(totalServicios.toFixed(2) + '€')
|
||||
$('#margenServicios').text(margenServicios.toFixed(2) + '€')
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
totalServicios = parseFloat($('#totalServicios').text().replace('€', ''))
|
||||
margenServicios = parseFloat($('#margenServicios').text().replace('€', ''))
|
||||
|
||||
sumForFactorPonderado += totalServicios;
|
||||
}
|
||||
|
||||
if(updateEnvio){
|
||||
@ -168,7 +176,7 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
$('#precioUnidadPresupuesto').text((precioUnidad).toFixed(2) + '€')
|
||||
|
||||
$('#factor').text(((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactor).toFixed(2))
|
||||
$('#factor_ponderado').text(((totalPresupuesto-totalEnvios-margenEnvios)/totalCostes).toFixed(2))
|
||||
$('#factor_ponderado').text(((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactorPonderado).toFixed(2))
|
||||
}
|
||||
|
||||
function getValuesResumenForm(){
|
||||
|
||||
Reference in New Issue
Block a user