Last active
February 7, 2018 00:43
-
-
Save lricoy/e0dcf0411cb378b70fb2844a2255657a to your computer and use it in GitHub Desktop.
Over simplified way to calculate IRRF/netSalary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const calculateIRRF = baseAmount => { | |
if (baseAmount <= 1903.98) { | |
return 0; | |
} | |
let value = 0; | |
if (baseAmount <= 2826.65) { | |
value = baseAmount * 0.075 - 142.8; | |
} else if (baseAmount <= 3751.05) { | |
value = baseAmount * 0.15 - 354.8; | |
} else if (baseAmount <= 4664.68) { | |
value = baseAmount * 0.225 - 636.13; | |
} else { | |
value = baseAmount * 0.275 - 869.36; | |
} | |
return value.toFixed(2); | |
}; | |
export const calculateNetSalary = base => base - calculateIRRF(base); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on: https://github.com/nicholaspufal/salario-liquido