Created
April 20, 2021 23:23
-
-
Save JoneSabino/5040ea81be892c569b8fcc4035384a2c to your computer and use it in GitHub Desktop.
Calculo CLT vs. PJ
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
import locale | |
import sys | |
class clt: | |
def __init__(self, salario_b, salario_l, fator_plr, vr, va): | |
self.salario_liquido = salario_l | |
self.vr = vr | |
self.va = va | |
self.terco_ferias = self.salario_liquido / 3 | |
self.fator_plr = fator_plr | |
self.fgts = (salario_b * .08) * 13 | |
def get_salario_anual(self): | |
# 13 == 12 meses + decimo terceiro | |
return (self.salario_liquido * (13 + self.fator_plr)) + \ | |
((self.vr + self.va) * 12) + self.terco_ferias + self.fgts | |
class pj: | |
def __init__(self, salario): | |
self.salario_bruto = salario | |
self.salario_liquido = salario - (salario * .06) - 121 | |
def get_salario_anual(self): | |
return self.salario_liquido * 12 | |
def get_salario_liquido(self): | |
return self.salario_liquido | |
if __name__ == "__main__": | |
locale.setlocale(locale.LC_ALL, 'pt_BR') | |
bruto_clt = float(input(f'Digite o salario BRUTO CLT mensal: ')) | |
liquido_clt = float(input(f'Digite o salario LIQUIDO CLT mensal: ')) | |
vr = float(input(f'Digite o seu VR mensal: ')) | |
va = float(input(f'Digite o seu VA mensal: ')) | |
fator_plr = float(input(f'Digite o numero de salarios que o seu PLR ' | |
f'equivale: ')) | |
mensal_pj = float(input(f'Digite o salario BRUTO PJ mensal: ')) | |
anual_clt = clt(bruto_clt, liquido_clt, fator_plr, vr, va).get_salario_anual() | |
anual_clt_f = locale.format_string("%.2f", anual_clt, grouping=True) | |
pj = pj(mensal_pj) | |
liquido_pj = locale.format_string("%.2f", | |
pj.get_salario_liquido(), | |
grouping=True) | |
anual_pj = pj.get_salario_anual() | |
anual_pj_f = locale.format_string("%.2f", anual_pj, grouping=True) | |
diff = 0 | |
maior = '' | |
print(f'\nConfira seus resultados abaixo:\n') | |
print(f'Salario Anual CLT: {anual_clt_f}') | |
print(f'Salario LIQUIDO MENSAL PJ: {liquido_pj}') | |
print(f'Salario Anual PJ: {anual_pj_f}') | |
if anual_clt > anual_pj: | |
diff = anual_clt - anual_pj | |
maior = 'CLT' | |
elif anual_pj > anual_clt: | |
diff = anual_pj - anual_clt | |
maior = 'PJ' | |
else: | |
diff = anual_pj - anual_clt | |
diff_f = locale.format_string("%.2f", diff, grouping=True) | |
print(f'Vantagem: {maior} \nDiferença anual: R${diff_f}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment