Custo Total do Produto

from tkinter import *
root = Tk()
root.geometry("1000x500")
root.resizable(0, 0)
root.config(bg="#103030")
root.title("Custo Total do Produto")

titulo = Label(text="Custo Total do Produto",
font=("Arial", 40, "bold"), bg="#103030", fg="#49e3e3")
titulo.place(relx=0.25, rely=0.05)

# Custo das Matérias-Primas
texto_sub1 = Label(text="Custo das Matérias-Primas:", font=("Arial", 12, "bold"),
bg="#103030", fg="#49e3e3")
texto_sub1.place(relx=0.02, rely=0.25)
Custo_Matérias_Primas = StringVar()
Custo_Matérias_Primas_entrada = Entry(textvariable=Custo_Matérias_Primas,
font=("Arial", 12, "bold"), bg="white", fg="blue"
, justify='center')
Custo_Matérias_Primas_entrada.place(relx=0.3, rely=0.26, relwidth=0.15)
Custo_Matérias_Primas_entrada.focus()

# Custo da Mão de Obra Direta
texto_sub2 = Label(text="Custo da Mão-de-Obra Direta:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub2.place(relx=0.5, rely=0.25)
Custo_Mão_Obra_Direta = StringVar()
Custo_Mão_Obra_Direta_entrada = Entry(textvariable=Custo_Mão_Obra_Direta,
font=("Arial", 12, "bold"), bg="white",
fg="blue", justify='center')
Custo_Mão_Obra_Direta_entrada.place(relx=0.8, rely=0.26, relwidth=0.15)

# Custos da Mão de Obra Indireta
texto_sub3 = Label(text="Custos da Mão-de-Obra Indireta:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub3.place(relx=0.02, rely=0.4)
Mão_Obra_Indireta = StringVar()
Mão_Obra_Indireta_entrada = Entry(textvariable=Mão_Obra_Indireta,
font=("Arial", 12, "bold"), bg="white", fg="blue", justify='center')
Mão_Obra_Indireta_entrada.place(relx=0.32, rely=0.4, relwidth=0.15)

# Custos de Fabricação
texto_sub4 = Label(text="Custos de Fabricação:", font=("Arial", 12, "bold"),
bg="#103030", fg="#49e3e3")
texto_sub4.place(relx=0.5, rely=0.4)
Custos_Fabricação = StringVar()
Custos_Fabricação_entrada = Entry(textvariable=Custos_Fabricação,
font=("Arial", 12, "bold"),
bg="white", fg="blue", justify='center')
Custos_Fabricação_entrada.place(relx=0.8, rely=0.4, relwidth=0.15)

# Custos de Embalagem
texto_sub5 = Label(text="Custos de Embalagem:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub5.place(relx=0.02, rely=0.55)
Custos_Embalagem = StringVar()
Custos_Embalagem_entrada = Entry(textvariable=Custos_Embalagem,
font=("Arial", 12, "bold"),
bg="white", fg="blue", justify='center')
Custos_Embalagem_entrada.place(relx=0.32, rely=0.55, relwidth=0.15)

# Custos de Transporte e Logística
texto_sub6 = Label(text="Custos de Transporte e Logística:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub6.place(relx=0.5, rely=0.55)
Custos_Transporte_Logística = StringVar()
Custos_Transporte_Logística_entrada = Entry(textvariable=Custos_Transporte_Logística,
font=("Arial", 12, "bold"),
bg="white", fg="blue", justify='center')
Custos_Transporte_Logística_entrada.place(relx=0.8, rely=0.55, relwidth=0.15)

# Custos de Marketing e Publicidade
texto_sub7 = Label(text="Custos de Marketing e Publicidade:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub7.place(relx=0.02, rely=0.65)
Custos_Marketing_Publicidade = StringVar()
Custos_Marketing_Publicidade_entrada = Entry(textvariable=Custos_Marketing_Publicidade,
font=("Arial", 12, "bold"),
bg="white", fg="blue", justify='center')
Custos_Marketing_Publicidade_entrada.place(relx=0.32, rely=0.65, relwidth=0.15)

# Custos Administrativos e Gerais
texto_sub8 = Label(text="Custos Administrativos e Gerais:",
font=("Arial", 12, "bold"), bg="#103030", fg="#49e3e3")
texto_sub8.place(relx=0.5, rely=0.65)
Custos_Administrativos_Gerais = StringVar()
Custos_Administrativos_Gerais_entrada = Entry(textvariable=Custos_Administrativos_Gerais,
font=("Arial", 12, "bold"),
bg="white", fg="blue", justify='center')
Custos_Administrativos_Gerais_entrada.place(relx=0.8, rely=0.65, relwidth=0.15)

def limpar():
Custos_Administrativos_Gerais_entrada.delete(0,END)
Custos_Embalagem_entrada.delete(0,END)
Custo_Matérias_Primas_entrada.delete(0,END)
Custos_Transporte_Logística_entrada.delete(0,END)
Custo_Mão_Obra_Direta_entrada.delete(0,END)
Mão_Obra_Indireta_entrada.delete(0,END)
Custos_Marketing_Publicidade_entrada.delete(0,END)
Custos_Fabricação_entrada.delete(0,END)
resultado_texto.config(text="")
def app():
try:
custo_administrativo =float(Custos_Administrativos_Gerais.get())
c_embalagem = float(Custos_Embalagem.get())
c_Matérias_Primas= float(Custo_Matérias_Primas.get())
c_Mão_Obra_Direta = float(Custo_Mão_Obra_Direta.get())
c_Mão_Obra_Indireta = float(Mão_Obra_Indireta.get())
c_Custos_Marketing_Publicidade = float( Custos_Marketing_Publicidade.get())
c_Custos_Fabricação=float( Custos_Fabricação.get())
Transporte_Logística=float( Custos_Transporte_Logística.get())
Custo_Total_Produto = custo_administrativo+c_embalagem+c_Matérias_Primas+\
c_Mão_Obra_Direta+c_Mão_Obra_Indireta+\
c_Custos_Marketing_Publicidade+c_Custos_Fabricação+Transporte_Logística
resultado_texto.config(text=f"Custo total do Produto: {Custo_Total_Produto}")
except ValueError:
resultado_texto.config(text="Erro de Digitação")


but1 = Button(text="Mostrar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=app)
but1.place(relx=0.1, rely=0.75, relwidth=0.25, relheight=0.05)

but_limpar = Button(text="Limpar", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=limpar)
but_limpar.place(relx=0.4, rely=0.75, relwidth=0.25, relheight=0.05)

but_sair = Button(text="Sair", bd=2, bg='#107db2', fg='white',
font=('verdana', 12, 'bold'), command=root.destroy)
but_sair.place(relx=0.7, rely=0.75, relwidth=0.25, relheight=0.05)
resultado_texto = Label(font=("Arial", 12, "bold"), bg="#cfe2f3")
resultado_texto.place(relx=0.05, rely=0.85, relwidth=0.9, relheight=0.1)

root.mainloop()

Comentários

Mensagens populares deste blogue

Criar Cartões de Visita

12 signos egípcios

Calcular a percentagem de ocupação