I'm working on a payroll and the function that calculates the IR (income tax) is with some mistake that I honestly can not find at all. If anyone can help me.
function desconto_ir()
{var salario = document.getElementById("salario_bruto").value;
var inss = document.getElementById("valor_calculado_11").value;
var esposa = document.getElementById("casado").value;
var dp1 = document.getElementById("filhos").value;
var dp2 = document.getElementById("dp_22_24").value;
var dependentes = eval(esposa + dp1 + dp2);
var base_de_calculo = (parseFloat(salario - inss - (179.71 * dependentes))).toFixed(2);
if (base_de_calculo <= 1787.77)
{document.getElementById("valor_ir").innerHTML = base_de_calculo;}
else if (base_de_calculo >= 1787.78 && <= 2679.29)
{document.getElementById("valor_ir").innerHTML = (parseFloat((base_de_calculo * 0.075) - 134.08)).toFixed(2);}
else if (base_de_calculo >= 2679.30 && <= 3572.43)
{document.getElementById("valor_ir").innerHTML = (parseFloat((base_de_calculo * 0.15) - 335.03)).toFixed(2);}
else if (base_de_calculo >= 3572.44 && <= 4463.81)
{document.getElementById("valor_ir").innerHTML = (parseFloat((base_de_calculo * 0.225) - 602.96)).toFixed(2);}
else
{document.getElementById("valor_ir").innerHTML = (parseFloat((base_de_calculo * 0.275) - 826.15)).toFixed(2);}}