Created
February 12, 2018 06:39
-
-
Save dmanchon/d2085b7db89b42b13a874b376257630c to your computer and use it in GitHub Desktop.
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
tramos = [ | |
(0, 12450, 19), | |
(12450, 20200, 24), | |
(20200, 35200, 30), | |
(35200, 60000, 37), | |
(60000, None, 45) | |
] | |
def calculo(salario, pagas=12): | |
t = [] | |
for tramo in tramos: | |
if tramo[0] > salario: | |
break | |
elif tramo[1] == None or tramo[1] > salario: | |
tmp = (salario - tramo[0]) * tramo[2] * (1/100) | |
else: | |
tmp = (tramo[1] - tramo[0]) * tramo[2] * (1/100) | |
t.append(tmp) | |
irpf = sum(t) | |
neto = salario - irpf | |
neto_mensual = neto/pagas | |
return t, irpf, neto, neto_mensual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment