Example #1
0
from nomina import Nomina

nominas = []

while True:
    print("1. Ingresanomina")
    print("2.salir")

    opcion = input("Ingrese la opcion: ")

    if opcion == '1':
        renglon = []
        n = Nomina()
        salario = float(input("Ingrese el sueldo basico:"))
        diasL = float(input("Ingrese los dias liquidados: "))
        n.setsalarioBasico(salario)
        n.setDiasLiquidados(diasL)

        renglon.append({
            'variable': 'Salario Basico',
            'Resultado': n.getsalarioBasico()
        })
        renglon.append({
            'variable': 'Dias Liquidados',
            'Resultado': n.getDiasLiquidados()
        })
        renglon.append({
            'variable': 'Salario Devengado',
            'Resultado': n.salarioDevengado()
        })
        renglon.append({
Example #2
0
class InterfazNomina:
    def __init__(self):
        self.root = Tk()
        self.root.config(bd=15)
        self.nombres = StringVar()
        self.apellidos = StringVar()
        self.cargo = StringVar()
        self.salario = StringVar()
        self.nomina = Nomina()
        self.texto = Text(self.root)

    def agregarEmpleado(self):
        empleado = Empleado()
        empleado.setNombre(self.nombres.get())
        empleado.setApellido(self.apellidos.get())
        empleado.setCargo(self.cargo.get())
        empleado.setSueldo(self.salario.get())

        self.nomina.setsalarioBasico(float(self.salario.get()))
        self.nomina.setDiasLiquidados(30)
        self.limpiar()
        self.texto.insert('insert', empleado)
        self.texto.insert('insert', '\n **************\n')
        self.texto.insert('insert', self.nomina)
        self.texto.insert('insert', '\n **************\n')

        print(empleado)
        print('************************************')
        print(self.nomina)

    def limpiar(self):
        self.nombres.set("")
        self.apellidos.set("")
        self.cargo.set("")
        self.salario.set("")

    def interfaz(self):
        frame = Frame(self.root, width=480, height=320)

        #NOMBRE
        labelEmpleado = Label(frame, text="Nombre del empleado")
        labelEmpleado.grid(row=0, column=0)
        inputEmpleado = Entry(frame, textvariable=self.nombres)
        inputEmpleado.grid(row=0, column=1)

        #APELLIDO
        labelApellido = Label(frame, text="Apellidos")
        labelApellido.grid(row=1, column=0)
        inputApellido = Entry(frame, textvariable=self.apellidos)
        inputApellido.grid(row=1, column=1)

        #CARGO
        labelCargo = Label(frame, text="Cargo")
        labelCargo.grid(row=2, column=0)
        inputCargo = Entry(frame, textvariable=self.cargo)
        inputCargo.grid(row=2, column=1)

        #SALARIO
        labelSalario = Label(frame, text="Salario")
        labelSalario.grid(row=3, column=0)
        inputSalario = Entry(frame, textvariable=self.salario)
        inputSalario.grid(row=3, column=1)

        agregar = Button(frame, text="Agregar", command=self.agregarEmpleado)
        agregar.grid(row=4, column=1)

        frame.pack(fill="both", expand=1)
        self.texto.pack(fill='both', expand=1)

        self.root.mainloop()