Last active
February 4, 2022 22:49
-
-
Save bactisme/35ef23f3f73a9dd97d00 to your computer and use it in GitHub Desktop.
Calcul de l'impot français par tranche (javascript)
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
// http://www.impots.gouv.fr/portal/dgi/public/popup?espId=1&typePage=cpr02&docOid=documentstandard_6182 | |
// Impots sur revenus 2018 | |
// Voir commentaire du gist pour les années suivantes | |
function impotBareme(montant){ | |
var impot = 0; | |
var tranches = new Array(); | |
tranches.push([6011, 0]); | |
tranches.push([11991, 0.055]); | |
tranches.push([26631, 0.14]); | |
tranches.push([71397, 0.30]); | |
tranches.push([151200, 0.41]); | |
for(var i = 0; i < 4; i++){ | |
if (montant >= tranches[i][0]){ | |
danslatranche = tranches[i][0]; | |
impot += danslatranche * tranches[i][1]; | |
montant = montant - tranches[i][0]; | |
}else if (montant < tranches[i][0]){ | |
impot += montant*tranches[i][1]; | |
montant = 0; | |
break; | |
} | |
} | |
if (montant > 0) | |
impot += montant*0.45; | |
return Math.round(impot, 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mise à jour 2022 sur revenus 2021 😜