from tkinter import *
root = Tk()
root.geometry("800x500")
root.resizable(0, 0)
root.config(bg="#176e69")
root.title("Índice de Solvência Geral")
titulo = Label(text="Índice de Solvência Geral",
font=("Arial", "47", "bold"),bg="#176e69",fg="#60ebe3")
titulo.place(relx=0.03, rely=0.05)
texto_sub1 = Label(text="Activos Circulantes",
font=("Arial", "17", "bold"),bg="#176e69",fg="#60ebe3")
texto_sub1.place(relx=0.1, rely=0.3)
texto_sub2 = Label(text="Passivos Circulantes",
font=("Arial", "17", "bold"),bg="#176e69",fg="#60ebe3")
texto_sub2.place(relx=0.6, rely=0.3)
texto_sub3 = Label(text="Activos Não Circulantes",
font=("Arial", "17", "bold"),bg="#176e69",fg="#60ebe3")
texto_sub3.place(relx=0.1, rely=0.5)
texto_sub4 = Label(text="Passivos Não Circulantes",
font=("Arial", "17", "bold"),bg="#176e69",fg="#60ebe3")
texto_sub4.place(relx=0.6, rely=0.5)
Activos_Circulantes = DoubleVar()
Activos_Circulantes_entrada = Entry(textvariable=Activos_Circulantes,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Activos_Circulantes_entrada.place(relx=0.58, rely=0.4, relwidth=0.35)
Passivos_Circulantes = DoubleVar()
Passivos_Circulantes_entrada = Entry(textvariable=Passivos_Circulantes,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Passivos_Circulantes_entrada.place(relx=0.05, rely=0.4, relwidth=0.35)
Activos_NãO_Circulantes = DoubleVar()
Activos_NãO_Circulantes_entrada = Entry(textvariable=Activos_NãO_Circulantes,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Activos_NãO_Circulantes_entrada.place(relx=0.08, rely=0.6, relwidth=0.35)
Passivos_NãO_Circulantes = DoubleVar()
Passivos_NãO_Circulantes_entrada = Entry(textvariable=Passivos_NãO_Circulantes,
font=("Arial", "12", "bold"),
bg="white", fg="blue", justify='center')
Passivos_NãO_Circulantes_entrada.place(relx=0.58, rely=0.6, relwidth=0.35)
def limpar():
Passivos_NãO_Circulantes_entrada.delete(0, END)
Activos_NãO_Circulantes_entrada.delete(0, END)
Passivos_Circulantes_entrada.delete(0, END)
Activos_Circulantes_entrada.delete(0, END)
def app():
anc = Activos_NãO_Circulantes.get()
pnc = Passivos_NãO_Circulantes.get()
pc = Passivos_Circulantes.get()
ac = Activos_Circulantes.get()
at = anc + ac
pt = pnc + pc
Índice_Solvência_Geral = at/pt
if Índice_Solvência_Geral>1:
mensagem = f"Índice Solvência Geral: {round(Índice_Solvência_Geral,2)}\n" \
f"A empresa possui mais activos do que passivos," \
f"o que sugere uma \nposição financeira sólida."
elif Índice_Solvência_Geral ==1:
mensagem = f"Índice Solvência Geral: {round(Índice_Solvência_Geral, 2)}\n" \
f"A empresa possui exatamente os recursos," \
f"necessários para \ncobrir suas obrigações, " \
f"mas não há uma margem de segurança substancial."
else:
mensagem = f"Índice Solvência Geral: {round(Índice_Solvência_Geral, 2)}\n" \
f"A empresa pode ter dificuldades em cumprir suas obrigações de longo prazo\n" \
f" com os recursos disponíveis."
resultado.set(mensagem)
but1 = Button(text="Calcular", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.05, rely=0.7, relwidth=0.25, relheight=0.1)
but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.35, rely=0.7, relwidth=0.2, relheight=0.1)
but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.65, rely=0.7, relwidth=0.2, relheight=0.1)
resultado = StringVar()
resultado_texto = Label(textvariable=resultado,
font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.05, rely=0.82, relwidth=0.9,relheight=0.17)
root.mainloop()