No entiendo que tengo mal acá dejo el código para que alguien me eche una mano por favor. Gracias de antemano.
Código Javascript:
Ver original
if(total2>total_impo) { var calcular=document.getElementById("calcular").checked; document.getElementById("seguro2").value = Math.round(document.getElementById("calcular").checked ? (total2)*0.60/100: 0); var calcular1=document.getElementById("calcular1").checked; document.getElementById("caja").value = Math.round(document.getElementById("calcular1").checked ? (total2)*0.60/100: 0); var cantidad=a.total2.value; var precio=a.imposiciones_por.value; var subt=cantidad*precio; var total=subt/100; var total1=(total-1.87)/100; //var total_general=substring(total,total.length,-2);; if (isNaN(subt)) { a.seguro.focus(); } else { a.seguro.value=Math.round(total1); var cantidad=a.total2.value; var precio=a.por_salud.value; var subt=cantidad*precio; var total=(subt/100); if (isNaN(subt)) { a.sistema_salud.focus(); } else { a.sistema_salud.value=Math.round(total); } }
Código Javascript:
Ver original
else { var calcular=document.getElementById("calcular").checked; document.getElementById("seguro2").value = Math.round(document.getElementById("calcular").checked ? (total_impo)*0.60/100: 0); var calcular1=document.getElementById("calcular1").checked; document.getElementById("caja").value = Math.round(document.getElementById("calcular1").checked ? (total_impo)*0.60/100: 0); var cantidad=a.total_impo.value; var precio=a.imposiciones_por.value; var subt=cantidad*precio; var total=(subt/100)-seguro; if (isNaN(subt)) { a.imposiciones.focus(); } else { a.imposiciones.value=Math.round(total); } var cantidad=a.total_impo.value; var precio=a.imposiciones_por.value; var subt=cantidad*precio; var total=subt/100; var total1=(total-1.87)/100; //var total_general=substring(total,total.length,-2);; if (isNaN(subt)) { a.seguro.focus(); } else { a.seguro.value=Math.round(total1); // Control que muestra el total }