Esempio n. 1
0
class Aba1:
    def aba1(self):
        ####  Descrição dos problemas apresentados pelo veiculo - Aba 1
        self.frameProb = GradientFrame(self.frame_aba1, relief=SUNKEN)
        self.frameProb.place(relx=0, rely=0.01, relwidth=1, relheight=1)

        self.DescrProb = LabelGlac(self.frame_aba1)
        self.DescrProb.configure(text= "   " + self.m_Atend1)
        self.DescrProb.place(relx=0.04, rely=0.04, relwidth=0.91, relheight=0.12)

        self.area1 = Entry(self.frame_aba1)
        self.area1.place(relx=0.05, rely=0.2,
                         relwidth=0.9, relheight=0.1)

        self.area2 = Entry(self.frame_aba1)
        self.area2.place(relx=0.05, rely=0.35,
                         relwidth=0.9, relheight=0.1)

        self.DescrProb2 = LabelGlac(self.frame_aba1)
        self.DescrProb2.configure(text="   " + self.m_Atend2)
        self.DescrProb2.place(relx=0.04, rely=0.49,
                              relwidth=0.91, relheight=0.12)

        self.area3 = Entry(self.frame_aba1)
        self.area3.place(relx=0.05, rely=0.65,
                         relwidth=0.9, relheight=0.1)

        self.area4 = Entry(self.frame_aba1)
        self.area4.place(relx=0.05, rely=0.8,
                         relwidth=0.9, relheight=0.1)

        ###  Label e Entrada Inicio
        self.hoje = str(self.hj.day) + '/' + str(self.hj.month) + '/' + str(self.hj.year)

        self.descrInicio = Button(self.frame_aba1, font=('Verdana', '8', 'bold'),
            command =self.calendarioInicio)
        self.descrInicio.configure(text = self.m_DataInicial,
                                   fg=self.fg_label,
                                   bg=self.fundo_do_frame)
        self.descrInicio.place(relx=0.05, rely=0.045,
                               relwidth=0.08, relheight=0.1)

        self.listInicio = EntPlaceHold(self.frame_aba1, self.hoje )
        self.listInicio.place(relx=0.14, rely=0.045,
                              relwidth=0.08, relheight=0.1)

        ###  Label e Entrada Fim
        self.descrFim = Button(self.frame_aba1, font=('Verdana', '8', 'bold'),
            command=self.calendarioFim);
        self.descrFim.configure(text = self.m_DataFinal, fg=self.fg_label,
            bg=self.fundo_do_frame)
        self.descrFim.place(relx=0.05, rely=0.495, relwidth=0.08, relheight=0.1)

        self.listFim = EntPlaceHold(self.frame_aba1, self.hoje)
        self.listFim.place(relx=0.14, rely=0.495, relwidth=0.08, relheight=0.1)
Esempio n. 2
0
    def aba4(self):
        ###Frames da moldura
        self.frameProb = GradientFrame(self.frame_aba4)
        self.frameProb.place(relx=0.01,
                             rely=0.01,
                             relwidth=0.98,
                             relheight=0.98)

        # Tanque de combustivel
        descrTanq = LabelGlac(self.frame_aba4)
        descrTanq.configure(width=22, text=self.m_Tanque)
        descrTanq.place(relx=0.02, rely=0.1, relwidth=0.21, relheight=0.1)

        self.are1 = Entry(self.frame_aba4)
        self.are1.place(relx=0.23, rely=0.1, relwidth=0.18, relheight=0.1)

        # Odometro
        descrOdom = LabelGlac(self.frame_aba4)
        descrOdom.configure(text=self.m_Odometro)
        descrOdom.place(relx=0.02, rely=0.22, relwidth=0.21, relheight=0.1)

        self.are2 = Entry(self.frame_aba4)
        self.are2.place(relx=0.23, rely=0.22, relwidth=0.18, relheight=0.1)

        ###  Radio Kit Multimidia
        descrRad = LabelGlac(self.frame_aba4)
        descrRad.configure(text=self.m_Obs)
        descrRad.place(relx=0.05, rely=0.34, relwidth=0.18, relheight=0.1)

        self.are3 = Entry(self.frame_aba4)
        self.are3.place(relx=0.23, rely=0.34, relwidth=0.18, relheight=0.1)

        ####   Calotas
        descrCalot = LabelGlac(self.frame_aba4)
        descrCalot.configure(text=self.m_Obs)
        descrCalot.place(relx=0.05, rely=0.46, relwidth=0.18, relheight=0.1)

        self.are4 = Entry(self.frame_aba4)
        self.are4.place(relx=0.23, rely=0.46, relwidth=0.18, relheight=0.1)

        ####  Triangulo
        descrtri = LabelGlac(self.frame_aba4)
        descrtri.configure(text=self.m_Obs)
        descrtri.place(relx=0.05, rely=0.58, relwidth=0.18, relheight=0.1)

        self.are5 = Entry(self.frame_aba4)
        self.are5.place(relx=0.23, rely=0.58, relwidth=0.18, relheight=0.1)

        ###   Macaco
        descrMacaco = LabelGlac(self.frame_aba4)
        descrMacaco.configure(text=self.m_Obs)
        descrMacaco.place(relx=0.05, rely=0.7, relwidth=0.18, relheight=0.1)

        self.are6 = Entry(self.frame_aba4)
        self.are6.place(relx=0.23, rely=0.7, relwidth=0.18, relheight=0.1)

        ####   Estepe
        descrEst = LabelGlac(self.frame_aba4)
        descrEst.configure(text=self.m_Obs)
        descrEst.place(relx=0.05, rely=0.82, relwidth=0.18, relheight=0.1)

        self.are7 = Entry(self.frame_aba4)
        self.are7.place(relx=0.23, rely=0.82, relwidth=0.18, relheight=0.1)

        ####   Are 8
        descrAre8 = LabelGlac(self.frame_aba4)
        descrAre8.configure(text=self.m_Obs)
        descrAre8.place(relx=0.55, rely=0.1, relwidth=0.18, relheight=0.1)

        self.are8 = Entry(self.frame_aba4)
        self.are8.place(relx=0.73, rely=0.1, relwidth=0.18, relheight=0.1)

        ####   Are 9
        descrAre9 = LabelGlac(self.frame_aba4)
        descrAre9.configure(text=self.m_Obs)
        descrAre9.place(relx=0.55, rely=0.22, relwidth=0.18, relheight=0.1)

        self.are9 = Entry(self.frame_aba4)
        self.are9.place(relx=0.73, rely=0.22, relwidth=0.18, relheight=0.1)

        # Gerar PDF
        vistlabel = LabelGlac(self.frame_aba4)
        vistlabel.configure(text=self.m_ImprimirVistoria)
        vistlabel.place(relx=0.61, rely=0.61, width=220, height=25)

        ###  Botao botaoImprimirVist
        self.botaoImprimirVist = Button(self.frame_aba4,
                                        image=self.button_imprime2)
        if self.versãoLicenca == "Open":
            self.botaoImprimirVist.configure(
                command=lambda: messagebox.showinfo("GLAC ", self.
                                                    m_MensagemRegistro))
        else:
            self.botaoImprimirVist.configure(command=self.imprime_vist)
        self.botaoImprimirVist.place(relx=0.69, rely=0.43, width=72, height=47)
Esempio n. 3
0
class Clientes(CadCli):
    def cadcli(self):
        self.telaCliente()
        self.molduraCliente()
        self.WidgetsClientes()
        self.listaClientes()
        self.WidgetsVeiculos()
        self.janelaCli.mainloop()

    def telaCliente(self):
        self.janelaCli = Toplevel(self.janela)
        self.janelaCli.title("Cadastro de Clientes")
        self.janelaCli.configure(background='#1e3743')
        self.janelaCli.focus_force()
        self.janelaCli.geometry("800x600")
        self.janelaCli.resizable(TRUE, TRUE)
        self.janelaCli.minsize(width=780, height=450)
        self.janelaCli.transient(self.janela)
        self.janelaCli.focus_force()
        self.janelaCli.grab_set()

        self.background_label = Label(self.janelaCli,
                                      image=self.background_image)
        self.background_label.place(relwidth=1, relheight=1)

    def molduraCliente(self):
        self.titulo_cliente = LabelGlac(self.janelaCli)
        self.titulo_cliente.configure(text=self.m_Clientes)
        self.titulo_cliente.place(relx=0.01,
                                  rely=0.04,
                                  relwidth=0.2,
                                  relheight=0.03)

        self.tituloListaClientes = LabelGlac(self.janelaCli)
        self.tituloListaClientes.configure(text='Lista de Clientes')
        self.tituloListaClientes.place(relx=0.495,
                                       rely=0.04,
                                       relwidth=0.3,
                                       relheight=0.03)

        self.frameCadastroCliente = GradientFrame(self.janelaCli)
        self.frameCadastroCliente.place(relx=0.01,
                                        rely=0.07,
                                        relwidth=0.48,
                                        relheight=0.46)

        self.frameListaClientes = GradientFrame(self.janelaCli)
        self.frameListaClientes.place(relx=0.495,
                                      rely=0.07,
                                      relwidth=0.49,
                                      relheight=0.46)

        self.frameVeiculos = GradientFrame(self.janelaCli)
        self.frameVeiculos.place(relx=0.01,
                                 rely=0.58,
                                 relwidth=0.97,
                                 relheight=0.4)

        self.tituloVeiculos = LabelGlac(self.janelaCli)
        self.tituloVeiculos.configure(text=self.m_Automoveis)
        self.tituloVeiculos.place(relx=0.01,
                                  rely=0.55,
                                  relwidth=0.2,
                                  relheight=0.028)

    def WidgetsClientes(self):
        #'Label Codigo'
        self.codPeLabel = LabelGlac(self.janelaCli)
        self.codPeLabel.configure(text=self.m_Codigo)
        self.codPeLabel.place(relx=0.02, rely=0.095, width=60, height=20)

        #'Entry Código'
        self.codPeEntry = EntPlaceHold(self.janelaCli, '')
        self.codPeEntry.configure(validate="key", validatecommand=self.vcmd8)
        self.codPeEntry.place(relx=0.02,
                              rely=0.122,
                              relwidth=0.05,
                              relheight=0.026)

        #'Label Data de Nascimento'
        self.nascPeLabel = LabelGlac(self.janelaCli)
        self.nascPeLabel.configure(text=self.m_Nasc)
        self.nascPeLabel.place(relx=0.39,
                               rely=0.15,
                               relwidth=0.07,
                               relheight=0.02)

        #'Entry Dia'
        self.nascDiaPeEntry = Entry(self.janelaCli)
        self.nascDiaPeEntry.configure(validate="key",
                                      validatecommand=self.vcmd2)
        self.nascDiaPeEntry.place(relx=0.38,
                                  rely=0.17,
                                  relwidth=0.03,
                                  relheight=0.03)

        #'Entry Mês'
        self.nascMesPeEntry = Entry(self.janelaCli)
        self.nascMesPeEntry.configure(validate="key",
                                      validatecommand=self.vcmd2)
        self.nascMesPeEntry.place(relx=0.41,
                                  rely=0.17,
                                  relwidth=0.03,
                                  relheight=0.03)

        #'Entry Ano'
        self.nascAnoPeEntry = Entry(self.janelaCli)
        self.nascAnoPeEntry.configure(validate="key",
                                      validatecommand=self.vcmd4)
        self.nascAnoPeEntry.place(relx=0.44,
                                  rely=0.17,
                                  relwidth=0.04,
                                  relheight=0.03)

        #'Label Nome do Cliente'
        self.nomePeLabel = LabelGlac(self.janelaCli)
        self.nomePeLabel.configure(text=self.m_Nome,
                                   font=('Arial', '8', 'bold'))
        self.nomePeLabel.place(relx=0.02,
                               rely=0.15,
                               relwidth=0.05,
                               relheight=0.02)

        #'Entry Nome Do Cliente'
        self.nomePeEntry = Entry(self.janelaCli)
        self.nomePeEntry.configure(font=('Arial', '8', 'bold'))
        self.nomePeEntry.place(relx=0.02,
                               rely=0.17,
                               relwidth=0.35,
                               relheight=0.03)

        #'Label Logradouro'
        self.logradPeLabel = LabelGlac(self.janelaCli)
        self.logradPeLabel.configure(font=('Verdana', '8', 'bold'),
                                     text=self.m_Endereco)
        self.logradPeLabel.place(relx=0.02,
                                 rely=0.2,
                                 relwidth=0.08,
                                 relheight=0.02)

        #'Entry Logradouro'
        self.logradPeEntry = Entry(self.janelaCli)
        self.logradPeEntry.configure(font=('Arial', '8', 'bold'))
        self.logradPeEntry.place(relx=0.02,
                                 rely=0.22,
                                 relwidth=0.38,
                                 relheight=0.03)

        #'Label Numero'
        self.numPeLabel = LabelGlac(self.janelaCli)
        self.numPeLabel.configure(font=('Verdana', '8', 'bold'),
                                  text=self.m_Numero)
        self.numPeLabel.place(relx=0.405,
                              rely=0.2,
                              relwidth=0.07,
                              relheight=0.02)

        #'Entry Numero'
        self.numPeEntry = Entry(self.janelaCli)
        self.numPeEntry.configure(font=('Arial', '8', 'bold'))
        self.numPeEntry.place(relx=0.41,
                              rely=0.22,
                              relwidth=0.06,
                              relheight=0.03)

        #'Label Complemento'
        self.complemPeLabel = LabelGlac(self.janelaCli)
        self.complemPeLabel.configure(font=('Verdana', '8', 'bold'),
                                      text=self.m_Complemento)
        self.complemPeLabel.place(relx=0.02,
                                  rely=0.25,
                                  relwidth=0.12,
                                  relheight=0.02)

        #'Entry Complemento'
        self.complemPeEntry = Entry(self.janelaCli)
        self.complemPeEntry.configure(font=('Arial', '8', 'bold'))
        self.complemPeEntry.place(relx=0.02,
                                  rely=0.27,
                                  relwidth=0.22,
                                  relheight=0.03)

        #'Label Bairro'
        self.bairroPeLabel = LabelGlac(self.janelaCli)
        self.bairroPeLabel.configure(font=('Verdana', '8', 'bold'),
                                     text=self.m_Bairro)
        self.bairroPeLabel.place(relx=0.25,
                                 rely=0.25,
                                 relwidth=0.06,
                                 relheight=0.02)

        #'Entry Bairro'
        self.bairroPeEntry = Entry(self.janelaCli)
        self.bairroPeEntry.configure(font=('Arial', '8', 'bold'))
        self.bairroPeEntry.place(relx=0.25,
                                 rely=0.27,
                                 relwidth=0.22,
                                 relheight=0.03)

        #'Label Municipio'
        self.cidadePeLabel = LabelGlac(self.janelaCli)
        self.cidadePeLabel.configure(font=('Verdana', '8', 'bold'),
                                     text=self.m_Cidade)
        self.cidadePeLabel.place(relx=0.02,
                                 rely=0.3,
                                 relwidth=0.06,
                                 relheight=0.02)

        #'Entry Municipio'
        self.cidadePeEntry = Entry(self.janelaCli)
        self.cidadePeEntry.configure(font=('Arial', '8', 'bold'))
        self.cidadePeEntry.place(relx=0.02,
                                 rely=0.32,
                                 relwidth=0.41,
                                 relheight=0.03)

        #'Label UF'
        self.ufPeLabel = LabelGlac(self.janelaCli)
        self.ufPeLabel.configure(font=('Verdana', '8', 'bold'), text=self.m_Uf)
        self.ufPeLabel.place(relx=0.44,
                             rely=0.3,
                             relwidth=0.03,
                             relheight=0.02)

        #'Entry UF'
        self.ufPeEntry = Entry(self.janelaCli)
        self.ufPeEntry.configure(font=('Arial', '8', 'bold'))
        self.ufPeEntry.place(relx=0.44,
                             rely=0.32,
                             relwidth=0.03,
                             relheight=0.03)

        #'Label Fone'
        self.fone1Pelabel = LabelGlac(self.janelaCli)
        self.fone1Pelabel.configure(text='Fone 1:',
                                    font=('Verdana', '8', 'bold'))
        self.fone1Pelabel.place(relx=0.02,
                                rely=0.35,
                                relwidth=0.06,
                                relheight=0.02)

        #'Entry Fone 1'
        self.fone1PeEntry = Entry(self.janelaCli)
        self.fone1PeEntry.configure(font=('Verdana', '8', 'bold'),
                                    validate="key",
                                    validatecommand=self.vcmd2)
        self.fone1PeEntry.place(relx=0.02,
                                rely=0.37,
                                relwidth=0.03,
                                relheight=0.03)

        self.fone1PeEntry2 = Entry(self.janelaCli)
        self.fone1PeEntry2.configure(font=('Verdana', '8', 'bold'),
                                     validate="key",
                                     validatecommand=self.vcmd12)

        self.fone1PeEntry2.place(relx=0.06,
                                 rely=0.37,
                                 relwidth=0.12,
                                 relheight=0.03)

        #'Label Fone 2'
        self.fone2Pelabel = LabelGlac(self.janelaCli)
        self.fone2Pelabel.configure(font=('Verdana', '8', 'bold'),
                                    text='Fone 2')
        self.fone2Pelabel.place(relx=0.24,
                                rely=0.35,
                                relwidth=0.06,
                                relheight=0.02)

        #'Entry Fone 2'
        self.fone2PeEntry = Entry(self.janelaCli)
        self.fone2PeEntry.configure(font=('Verdana', '8', 'bold'),
                                    validate="key",
                                    validatecommand=self.vcmd2)
        self.fone2PeEntry.place(relx=0.24,
                                rely=0.37,
                                relwidth=0.03,
                                relheight=0.03)

        self.fone2PeEntry2 = Entry(self.janelaCli)
        self.fone2PeEntry2.configure(font=('Verdana', '8', 'bold'),
                                     validate="key",
                                     validatecommand=self.vcmd12)
        self.fone2PeEntry2.place(relx=0.28,
                                 rely=0.37,
                                 relwidth=0.12,
                                 relheight=0.03)

        #'Label Cpf'
        self.cpfPeLabel = LabelGlac(self.janelaCli)
        self.cpfPeLabel.configure(text=self.m_Cpf)
        self.cpfPeLabel.configure(font=('Verdana', '8', 'bold'))
        self.cpfPeLabel.place(relx=0.31,
                              rely=0.4,
                              relwidth=0.05,
                              relheight=0.02)

        #'Entry CPF'
        self.cpfPeEntry = Entry(self.janelaCli)
        self.cpfPeEntry.configure(font=('Verdana', '8', 'bold'),
                                  validatecommand=self.vcmd12)
        self.cpfPeEntry.place(relx=0.31,
                              rely=0.42,
                              relwidth=0.16,
                              relheight=0.03)

        #'Label CNPJ'
        self.cnpjPeLabel = LabelGlac(self.janelaCli)
        self.cnpjPeLabel.configure(text=self.m_Cnpj)
        self.cnpjPeLabel.configure(font=('Verdana', '8', 'bold'))
        self.cnpjPeLabel.place(relx=0.14,
                               rely=0.4,
                               relwidth=0.05,
                               relheight=0.02)

        #'Entry CNPJ'
        self.cnpjPeEntry = Entry(self.janelaCli)
        self.cnpjPeEntry.configure(font=('Verdana', '8', 'bold'),
                                   validate="key",
                                   validatecommand=self.vcmd12)
        self.cnpjPeEntry.place(relx=0.14,
                               rely=0.42,
                               relwidth=0.16,
                               relheight=0.03)

        #'Label RG'
        self.rgPeLabel = LabelGlac(self.janelaCli)
        self.rgPeLabel.configure(text=self.m_RG)

        #'Entry RG'
        self.rgPeEntry = Entry(self.janelaCli)

        #'Label Obs'
        self.obsPeLabel = LabelGlac(self.janelaCli)
        self.obsPeLabel.configure(font=('Verdana', '8', 'bold'),
                                  text=self.m_Obs)
        self.obsPeLabel.place(relx=0.02,
                              rely=0.45,
                              relwidth=0.05,
                              relheight=0.02)

        #'Entry Obs'
        self.obsPeEntry = Entry(self.janelaCli)
        self.obsPeEntry.configure(font=('Arial', '8', 'bold'))
        self.obsPeEntry.place(relx=0.02,
                              rely=0.47,
                              relwidth=0.22,
                              relheight=0.028)

        #'Label E-mail'
        self.emailPeLabel = LabelGlac(self.janelaCli)
        self.emailPeLabel.configure(font=('Verdana', '8', 'bold'),
                                    text='E-mail')
        self.emailPeLabel.place(relx=0.25,
                                rely=0.45,
                                relwidth=0.05,
                                relheight=0.02)

        #'Entry E-mail'
        self.emailPeEntry = Entry(self.janelaCli)
        self.emailPeEntry.configure(font=('Arial', '8', 'bold'))
        self.emailPeEntry.place(relx=0.25,
                                rely=0.47,
                                relwidth=0.22,
                                relheight=0.028)

        #'Label Inscrição Estadual'
        self.inscEstPeLabel = Label(self.janelaCli,
                                    text='Inscrição Estadual',
                                    bg="#49708D",
                                    fg="white")

        #'Entry Inscrição Estadual'
        self.inscEstPeEntry = Entry(self.janelaCli, bg=self.bg_entry)

        #'Botao Cep'
        self.cepPeBt = ButtonGlac(self.janelaCli)
        self.cepPeBt.configure(text='>>', command=self.cep)
        self.cepPeBt.place(relx=0.02, rely=0.42, relwidth=0.04, relheight=0.03)

        #'Label Cep'
        self.cepPeLabel = LabelGlac(self.janelaCli)
        self.cepPeLabel.configure(font=('Verdana', '8', 'bold'),
                                  text=self.m_Cep)
        self.cepPeLabel.place(relx=0.02,
                              rely=0.4,
                              relwidth=0.06,
                              relheight=0.02)

        #'Entry Cep'
        self.cepPeEntry = Entry(self.janelaCli)
        self.cepPeEntry.configure(validate="key",
                                  font=('Verdana', 8),
                                  validatecommand=self.vcmd8)
        self.cepPeEntry.place(relx=0.06,
                              rely=0.42,
                              relwidth=0.07,
                              relheight=0.03)

        #'Botao Novo Cliente'
        self.botaoAdd = ButtonGlac(self.janelaCli)
        self.botaoAdd.configure(text=self.m_Novo, command=self.add_clienteC)
        self.botaoAdd.place(relx=0.25, rely=0.08, width=60, height=25)

        # Botao Altera dados do Cliente
        self.botaoMud = ButtonGlac(self.janelaCli)
        self.botaoMud.configure(command=self.mud_clienteC, text=self.m_Alterar)
        self.botaoMud.place(relx=0.33, rely=0.08, width=60, height=25)

        # Botao deletar dados do Cliente
        self.botaoDel = ButtonGlac(self.janelaCli)
        self.botaoDel.configure(text=self.m_Apagar,
                                command=self.deletar_windowC)
        self.botaoDel.place(relx=0.41, rely=0.08, width=60, height=25)

        #  Botao limpa
        self.botaolimpa = ButtonGlac(self.janelaCli)
        self.botaolimpa.configure(text=self.m_Limpar,
                                  command=self.limpa_clienteC)
        self.botaolimpa.place(relx=0.17, rely=0.08, width=60, height=25)

        #  Botao busca Cabeça
        self.botaobusca = ButtonGlac(self.janelaCli)
        self.botaobusca.configure(bitmap='questhead',
                                  font=('Verdana', '8', 'bold'),
                                  command=self.busca_clienteC)
        self.botaobusca.place(relx=0.11, rely=0.08, width=35)

    def listaClientes(self):
        self.barracliente = Scrollbar(self.janelaCli,
                                      orient='vertical',
                                      command=self.OnVsbC)
        self.listaServ = ttk.Treeview(self.janelaCli,
                                      height=6,
                                      yscrollcommand=self.barracliente.set,
                                      column=("col1", "col2", "col3", "col4"))

        self.listaServ.heading("#0", text="")
        self.listaServ.column("#0", width=1)
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.column("#1", width=40)
        self.listaServ.heading("#2", text=self.m_Nome)
        self.listaServ.column("#2", width=185)
        self.listaServ.heading("#3", text='')
        self.listaServ.column("#3", width=30)
        self.listaServ.heading("#4", text=self.m_Fone)
        self.listaServ.column("#4", width=105)

        self.listaServ.place(relx=0.5,
                             rely=0.09,
                             relwidth=0.465,
                             relheight=0.42)
        self.listaServ.configure(yscroll=self.barracliente.set)
        self.barracliente.place(relx=0.965,
                                rely=0.09,
                                relwidth=0.015,
                                relheight=0.42)

        self.listaServ.bind("<Double-1>", self.OnDoubleClickC)

        self.conecta_Glac()
        self.lista1 = self.cursor.execute(
            """SELECT  cod_cli, nome, fone1ddd, fone1
            FROM clientes  ORDER BY nome ASC; """)
        for i in self.lista1:
            self.listaServ.insert("", END, values=i)
        self.desconecta_Glac()

    def WidgetsVeiculos(self):
        self.entradaVeiculo2 = Entry(self.janelaCli)
        self.entradaVeiculo2.configure(font=('Verdana', '8', 'bold'))

        self.entradaMontadora2 = Entry(self.janelaCli)
        self.entradaMontadora2.configure(font=('Verdana', '8', 'bold'))

        # Label Código
        self.codEquipLabel = LabelGlac(self.janelaCli)
        self.codEquipLabel.configure(text=self.m_Codigo)

        # Entry Código
        self.codEquipEntry = Entry(self.janelaCli)
        self.codEquipEntry.configure(font=('Verdana', '8', 'bold'))

        # Label Ano
        self.fabrAnoEquipLabel = LabelGlac(self.janelaCli)
        self.fabrAnoEquipLabel.configure(text=self.m_Ano,
                                         font=('Verdana', '8', 'bold'))
        # Entry Ano
        self.fabrAnoEquipEntry = Entry(self.janelaCli)
        self.fabrAnoEquipEntry.configure(font=('Verdana', '8', 'bold'))
        self.fabrAnoEquipEntry.place(relx=0.65,
                                     rely=0.63,
                                     relwidth=0.1,
                                     relheight=0.04)

        self.fabrModeloEquipLabel = LabelGlac(self.janelaCli)
        self.fabrModeloEquipLabel.configure(text=self.m_Ano)
        self.fabrAnoEquipLabel.place(relx=0.65,
                                     rely=0.59,
                                     relwidth=0.1,
                                     relheight=0.04)

        self.fabrModeloEquipEntry = Entry(self.janelaCli)
        self.fabrModeloEquipEntry.configure(font=('Verdana', '8', 'bold'))

        self.nomeEquipLabel = LabelGlac(self.janelaCli)
        self.nomeEquipLabel.configure(text=self.m_Automovel)

        self.nomeEquipEntry = Entry(self.janelaCli)
        self.nomeEquipEntry.configure(font=('Verdana', '8', 'bold'))
        self.nomeEquipEntry.place(relx=0.13,
                                  rely=0.63,
                                  relwidth=0.1,
                                  relheight=0.04)

        self.nomeIdEquipEntry = Entry(self.janelaCli)
        self.nomeIdEquipEntry.configure(font=('Verdana', '8', 'bold'))

        self.serialEquipLabel = LabelGlac(self.janelaCli)
        self.serialEquipLabel.configure(text=self.m_Placa,
                                        font=('Verdana', '7', 'bold'))
        self.serialEquipLabel.place(relx=0.02,
                                    rely=0.59,
                                    relwidth=0.1,
                                    relheight=0.04)

        self.serialEquipEntry = Entry(self.janelaCli)
        self.serialEquipEntry.configure(font=('Verdana', '8', 'bold'))
        self.serialEquipEntry.place(relx=0.02,
                                    rely=0.63,
                                    relwidth=0.1,
                                    relheight=0.04)

        self.corEquipLabel = LabelGlac(self.janelaCli)
        self.corEquipLabel.configure(text=self.m_Cor,
                                     font=('Verdana', '7', 'bold'))
        self.corEquipLabel.place(relx=0.35,
                                 rely=0.59,
                                 relwidth=0.12,
                                 relheight=0.04)

        self.corvar = StringVar(self.janelaCli)
        self.coresV = {
            self.m_Branco, self.m_Amarelo, self.m_Verde, self.m_Bege,
            self.m_Azul, self.m_Laranja, self.m_Vermelho, self.m_Verde,
            self.m_Cinza, self.m_Preto, self.m_Marrom, self.m_Bordo,
            self.m_Prata, self.m_Grafite, self.m_Dourado, self.m_Outro
        }

        self.corvar.set(self.m_Branco)

        self.popupMenu = OptionMenu(self.janelaCli, self.corvar, *self.coresV)
        self.popupMenu.place(relx=0.35,
                             rely=0.63,
                             relwidth=0.12,
                             relheight=0.04)

        self.combEquipLabel = LabelGlac(self.janelaCli)
        self.combEquipLabel.configure(text=self.m_Combustivel,
                                      font=('Verdana', '7', 'bold'))
        self.combEquipLabel.place(relx=0.48,
                                  rely=0.59,
                                  relwidth=0.16,
                                  relheight=0.04)

        self.combvar = StringVar()
        self.combV = {
            self.m_Gasolina, self.m_Alcool, self.m_Diesel, self.m_Flex,
            self.m_Gasolina_e_Gas, self.m_Alcool_e_Gas, self.m_Flex_e_Gas
        }
        self.combvar.set(self.m_Gasolina)

        self.popupMenu = OptionMenu(self.janelaCli, self.combvar, *self.combV)
        self.popupMenu.place(relx=0.48,
                             rely=0.63,
                             relwidth=0.16,
                             relheight=0.04)

        self.marcaEquipLabel = LabelGlac(self.janelaCli)
        self.marcaEquipLabel.configure(text=self.m_Marca,
                                       font=('Verdana', '7', 'bold'))
        self.marcaEquipLabel.place(relx=0.24,
                                   rely=0.59,
                                   relwidth=0.1,
                                   relheight=0.04)

        self.marcaEquipEntry = Entry(self.janelaCli)
        self.marcaIdEquipEntry = EntPlaceHold(self.janelaCli, '')
        self.marcaEquipEntry.place(relx=0.24,
                                   rely=0.63,
                                   relwidth=0.1,
                                   relheight=0.04)

        ##### Veiculo
        self.descrVeiculo = ButtonGlac(self.janelaCli)
        self.descrVeiculo.configure(command=self.busca_autoC,
                                    text=self.m_Veiculo)
        self.descrVeiculo.place(relx=0.13,
                                rely=0.59,
                                relwidth=0.1,
                                relheight=0.04)

        #  Botoes automoveis
        self.botaoAdd2 = ButtonGlac(self.janelaCli)
        self.botaoAdd2.configure(text=self.m_Novo)
        self.botaoAdd2.configure(command=self.add_veiculoC)
        self.botaoAdd2.place(relx=0.9,
                             rely=0.63,
                             relwidth=0.07,
                             relheight=0.04)

        self.botaoMud2 = ButtonGlac(self.janelaCli)
        self.botaoMud2.configure(text=self.m_Alterar)
        self.botaoMud2.configure(command=self.mud_autoC)
        self.botaoMud2.place(relx=0.9, rely=0.7, relwidth=0.07, relheight=0.04)

        self.botaoDel2 = ButtonGlac(self.janelaCli)
        self.botaoDel2.configure(text=self.m_Apagar,
                                 command=self.deletar_windowPlacaC)
        self.botaoDel2.place(relx=0.9,
                             rely=0.77,
                             relwidth=0.07,
                             relheight=0.04)

        self.listaPlaca = ttk.Treeview(self.janelaCli,
                                       height=5,
                                       column=("col1", "col2", "col3", "col4",
                                               "col5", "col6"))
        self.listaPlaca.heading("#0", text="")
        self.listaPlaca.column("#0", width=0)
        self.listaPlaca.heading("#1", text=self.m_Placa)
        self.listaPlaca.column("#1", width=80)
        self.listaPlaca.heading("#2", text=self.m_Veiculo)
        self.listaPlaca.column("#2", width=120)
        self.listaPlaca.heading("#3", text=self.m_Montadora)
        self.listaPlaca.column("#3", width=170)
        self.listaPlaca.heading("#4", text=self.m_Cor)
        self.listaPlaca.column("#4", width=100)
        self.listaPlaca.heading("#5", text=self.m_Combustivel)
        self.listaPlaca.column("#5", width=100)
        self.listaPlaca.heading("#6", text=self.m_Ano)
        self.listaPlaca.column("#6", width=80)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaCli,
                               orient='vertical',
                               command=self.listaPlaca.yview)
        # Adiciona barra de rolagem
        self.listaPlaca.configure(yscroll=self.barra.set)
        self.barra.place(relx=0.835, rely=0.7, relwidth=0.02, relheight=0.27)

        self.listaPlaca.place(relx=0.02,
                              rely=0.7,
                              relwidth=0.81,
                              relheight=0.27)
        #    Binding da listbox
        self.listaPlaca.bind('<Double-1>', self.bind_autoC)
        ############################################################################
    def busca_autoC(self, *args):
        ### Widgets - Listar tecnicos ###
        self.nomeEquipEntry.insert(END, '%')

        veicAuto = self.nomeEquipEntry.get()

        self.listatec = Toplevel()
        self.listatec.title(" GLAC  ")
        self.listatec.configure(background='gray75')
        self.listatec.geometry("420x240")
        self.listatec.resizable(FALSE, FALSE)
        self.listatec.transient(self.janelaCli)
        self.listatec.focus_force()
        self.listatec.grab_set()
        ##########
        self.listatec1 = ttk.Treeview(self.listatec,
                                      height=10,
                                      column=("col1", "col2", "col3"))
        self.listatec1.heading("#0", text="")
        self.listatec1.heading("#1", text='Cod')
        self.listatec1.heading("#2", text=self.m_Automovel)
        self.listatec1.heading("#3", text=self.m_Marca)

        self.listatec1.column("#0", width=0)
        self.listatec1.column("#1", width=40)
        self.listatec1.column("#2", width=180)
        self.listatec1.column("#3", width=150)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.listatec,
                               orient='vertical',
                               command=self.listatec1.yview)

        # Adiciona barra de rolagem
        self.listatec1.configure(yscroll=self.barra.set)
        self.barra.place(x=377, y=6, width=30, height=225)

        self.listatec1.place(x=5, y=5)
        self.conecta_Glac()

        self.cursor.execute(
            """SELECT cod_aut, automovel, marca FROM automoveis, montadora WHERE montadora.cod = automoveis.montad
             AND automovel LIKE '%s' ORDER BY automovel ASC""" % veicAuto)

        rows = self.cursor.fetchall()
        for row in rows:
            self.listatec1.insert("", END, values=row)

        # Binding da listbox
        self.listatec1.bind('<Double-1>', self.add_autobindC)

        self.desconecta_Glac()

    def deletar_windowC(self):
        self.listatec = Toplevel()
        self.listatec.title(" GLAC  ")
        self.listatec.configure(background='gray75')
        self.listatec.geometry("380x85")
        self.listatec.resizable(FALSE, FALSE)
        self.listatec.transient(self.janelaCli)
        self.listatec.focus_force()
        self.listatec.grab_set()

        ##########
        def btnao():
            self.listatec.destroy()

        self.MensLabel = LabelGlac(self.listatec)
        self.MensLabel.configure(text=self.m_msgCertezaDel)
        self.MensLabel.place(x=10, y=10)

        self.BtSim = ButtonGlac(self.listatec)
        self.BtSim.configure(text=self.m_Sim, command=self.del_clienteC)
        self.BtSim.place(relx=0.2, y=50, width=70)

        self.BtNao = ButtonGlac(self.listatec)
        self.BtNao.configure(text=self.m_Nao, command=btnao)
        self.BtNao.place(relx=0.6, y=50, width=70)

    def deletar_windowPlacaC(self):
        self.listatec = Toplevel()
        self.listatec.title(" GLAC  ")
        self.listatec.configure(background='gray75')
        self.listatec.geometry("380x85")
        self.listatec.resizable(FALSE, FALSE)
        self.listatec.transient(self.janelaCli)
        self.listatec.focus_force()
        self.listatec.grab_set()

        ##########
        def btnao():
            self.listatec.destroy()

        self.MensLabel = LabelGlac(self.listatec)
        self.MensLabel.configure(text=self.m_msgCertezaDel)
        self.MensLabel.place(x=10, y=10)

        self.BtSim = ButtonGlac(self.listatec)
        self.BtSim.configure(text=self.m_Sim, command=self.del_placaC)
        self.BtSim.place(relx=0.2, y=50, width=70)

        self.BtNao = ButtonGlac(self.listatec)
        self.BtNao.configure(text=self.m_Nao, command=btnao)
        self.BtNao.place(relx=0.6, y=50, width=70)
Esempio n. 4
0
    def cadest(self):
        janelaEst = Toplevel()
        self.janelaEst = janelaEst
        janelaEst.title(self.m_Estoque)
        janelaEst.configure(background=self.fundo_da_tela)
        janelaEst.geometry("800x405")
        janelaEst.resizable(FALSE, FALSE)
        janelaEst.minsize(width=780, height=420)
        janelaEst.transient(self.janela)
        janelaEst.focus_force()
        janelaEst.grab_set()

        self.conecta_Glac()

        descrNomeServ = LabelGlac(janelaEst)
        descrNomeServ.configure(text=self.m_ControleEstoque,
                                font=('Comic', '18', 'bold'))
        descrNomeServ.place(x=245, y=1)
        ###  A B A S
        abas = Notebook(janelaEst)
        frame_aba1 = Frame(abas)
        frame_aba2 = Frame(abas)

        frame_aba1.configure(background='lightgray')
        frame_aba2.configure(background='lightgray')

        label1 = Label(frame_aba1)
        label1.pack(padx=385, pady=160)
        label2 = Label(frame_aba2)
        label2.pack(padx=385, pady=160)

        abas.add(frame_aba1, text=self.m_Cadastro + ' ' + self.m_Produtos)
        abas.add(frame_aba2, text=self.m_MovimentaEst)

        abas.place(x=10, y=30)
        #
        frameProb = GradientFrame(frame_aba1)
        frameProb.place(x=10, y=10, width=755, height=320)

        descrCodprod = LabelGlac(frame_aba1)
        descrCodprod.configure(text=self.m_Codigo)
        descrCodprod.place(x=0, y=15, width=80, height=25)

        ## Label produtos
        descrProd = LabelGlac(frame_aba1)
        descrProd.configure(text=self.m_Produtos)
        descrProd.place(x=0, y=45, width=80, height=25)

        ###  Botao Carrega
        botaoAdd = ButtonGlac(frame_aba1)
        botaoAdd.configure(text=self.m_Carregar, command=self.carrega_produtoE)
        botaoAdd.place(x=140, y=15, width=90, height=25)

        ###  Botao limpa
        botaolimpa = ButtonGlac(frame_aba1)
        botaolimpa.configure(text=self.m_Limpar, command=self.limpa_produtoE)
        botaolimpa.place(x=275, y=15, width=60, height=25)

        ###  Botao busca
        botaoBusca = ButtonGlac(frame_aba1)
        botaoBusca.configure(text=self.m_Buscar, command=self.busca_produtoE)
        botaoBusca.place(x=275, y=45, width=60, height=25)

        ### Botao Marca Produto
        descrIdMarcaprod = ButtonGlac(frame_aba1)
        descrIdMarcaprod.configure(text=self.m_Marca,
                                   command=self.busca_marcaE)
        descrIdMarcaprod.place(x=0, y=75, width=80, height=25)

        ## Entry codigo
        self.entradaCodprod = Entry(frame_aba1)
        self.entradaCodprod.configure(validate="key",
                                      validatecommand=self.vcmd6)
        self.entradaCodprod.place(x=80, y=15, width=60, height=25)

        ## Entry descrição Produto
        self.entradaProd = Entry(frame_aba1)
        self.entradaProd.place(x=80, y=45, width=180, height=25)

        self.entradaIdMarcaprod = Entry(frame_aba1, width=6)
        # widget oculto, sem place

        self.entradaMarcaprod = Entry(frame_aba1)
        self.entradaMarcaprod.place(x=80, y=75, width=200, height=25)

        descrIdFornec = ButtonGlac(frame_aba1)
        descrIdFornec.configure(text=self.m_Fornecedor,
                                command=self.busca_fornecE)
        descrIdFornec.place(x=0, y=105, width=100, height=25)
        self.entradaIdFornec = Entry(frame_aba1, width=6)
        # entradaIdFornec.place(x=85, y=93)

        self.entradaFornec = Entry(frame_aba1)
        self.entradaFornec.place(x=100, y=105, width=200, height=25)

        descrCusto = LabelGlac(frame_aba1)
        descrCusto.configure(text=self.m_Custo_R)
        descrCusto.place(x=0, y=135, width=80, height=25)

        self.entradaCusto = Entry(frame_aba1)
        self.entradaCusto.configure(validate="key",
                                    validatecommand=self.vcmd8float)
        self.entradaCusto.place(x=80, y=135, width=80, height=25)

        descrValor = LabelGlac(frame_aba1)
        descrValor.configure(text=self.m_Valor_R)
        descrValor.place(x=150, y=135, width=80, height=25)

        self.entradaValor = Entry(frame_aba1)
        self.entradaValor.configure(validate="key",
                                    validatecommand=self.vcmd8float)
        self.entradaValor.place(x=220, y=135, width=80, height=25)

        descrDescricao = LabelGlac(frame_aba1)
        descrDescricao.configure(text=self.m_Descricao)
        descrDescricao.place(x=14, y=175)

        self.entradaDescricao = Entry(frame_aba1)
        self.entradaDescricao.place(x=16, y=195, width=300, height=25)

        botaoAdd = ButtonGlac(frame_aba1)
        botaoAdd.configure(text=self.m_Novo, command=self.add_produtoE)
        botaoAdd.place(x=30, y=250, width=80)

        botaoMudServ = ButtonGlac(frame_aba1)
        botaoMudServ.configure(text=self.m_Alterar, command=self.mud_produtoE)
        botaoMudServ.place(x=130, y=250, width=80)

        botaoDel = ButtonGlac(frame_aba1)
        botaoDel.configure(text=self.m_Apagar, command=self.del_produtoE)
        botaoDel.place(x=230, y=250, width=80)

        ### Widgets - Listar produtos ###
        self.listaServ = ttk.Treeview(frame_aba1,
                                      height=10,
                                      column=("col1", "col2", "col3", "col4",
                                              "col5", "col6"))
        self.listaServ.heading("#0", text="")
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.heading("#2", text=self.m_Produtos)
        self.listaServ.heading("#3", text="")
        self.listaServ.heading("#4", text=self.m_Custo_R)
        self.listaServ.heading("#5", text="")
        self.listaServ.heading("#6", text=self.m_Valor_R)

        self.listaServ.column("#0", width=0)
        self.listaServ.column("#1", width=60)
        self.listaServ.column("#2", width=140)
        self.listaServ.column("#3", width=25)
        self.listaServ.column("#4", width=65)
        self.listaServ.column("#5", width=25)
        self.listaServ.column("#6", width=85)

        # Cria barra de rolagem
        self.barra = Scrollbar(frame_aba1,
                               orient='vertical',
                               command=self.listaServ.yview)
        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=740, y=15, width=15, height=300)

        lista = self.cursor.execute("""
            SELECT cod_sp, servprod, "R$", custo, "R$", valor FROM servprod
            WHERE sp = "P" ORDER BY servprod ASC ;
                            """)
        for i in lista:
            self.listaServ.insert("", END, values=i)

        self.listaServ.place(x=340, y=15, height=300)

        self.listaServ.bind("<Double-1>", self.OnDoubleClickE)

        #####################################################################
        #### ABA 2
        #############################
        ### Cabeçalho dos itens_orc 1 A 10 - Aba 2
        frameItens = GradientFrame(frame_aba2)
        frameItens.place(x=10, y=8, width=760, height=316)

        ### Produto
        produto_aba2label = LabelGlac(frame_aba2)
        produto_aba2label.configure(text=self.m_Produtos)
        produto_aba2label.place(x=20, y=20, width=80, height=25)

        self.codproduto2 = Entry(frame_aba2)

        self.produto_aba2 = Entry(frame_aba2)
        self.produto_aba2.place(x=100, y=20, width=400, height=25)

        #### Entrada
        quant_aba2label = LabelGlac(frame_aba2)
        quant_aba2label.configure(text=self.m_Entrada)
        quant_aba2label.place(x=20, y=50, width=80, height=25)

        self.quant_aba2 = Entry(frame_aba2)
        self.quant_aba2.configure(validate="key",
                                  validatecommand=self.vcmd8float)
        self.quant_aba2.place(x=100, y=50, width=100, height=25)
        self.quant_aba2.insert(END, 0)

        #### Saida
        saida_aba2label = LabelGlac(frame_aba2)
        saida_aba2label.configure(text=self.m_Saida)
        saida_aba2label.place(x=20, y=80, width=80, height=25)

        self.saida_aba2 = Entry(frame_aba2)
        self.saida_aba2.configure(validate="key",
                                  validatecommand=self.vcmd8float)
        self.saida_aba2.place(x=100, y=80, width=100, height=25)
        self.saida_aba2.insert(0, 0)

        #### Custo
        custo_aba2label = LabelGlac(frame_aba2)
        custo_aba2label.configure(text=self.m_Custo_R)
        custo_aba2label.place(x=20, y=110, width=80, height=25)

        self.custo_aba2 = Entry(frame_aba2)
        self.custo_aba2.configure(validate="key",
                                  validatecommand=self.vcmd8float)
        self.custo_aba2.place(x=100, y=110, width=100, height=25)

        #### Data
        data_aba2label = LabelGlac(frame_aba2)
        data_aba2label.configure(text=self.m_Data)
        data_aba2label.place(x=20, y=140, width=80, height=25)

        self.dia_aba2 = Entry(frame_aba2)
        self.dia_aba2.configure(validate="key", validatecommand=self.vcmd2)
        self.dia_aba2.place(x=100, y=140, width=25, height=25)
        self.dia_aba2.insert(END, self.hj.day)

        self.mes_aba2 = StringVar()
        self.mes_aba2V = {
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'
        }
        self.mes_aba2V = sorted(self.mes_aba2V)
        self.mes_aba2.set(self.hj.month)
        self.entradaMes = OptionMenu(frame_aba2, self.mes_aba2,
                                     *self.mes_aba2V)
        self.entradaMes.place(x=125, y=140, width=50, height=25)

        self.ano_aba2 = StringVar()
        self.ano_aba2V = {'2020', '2021', '2022', '2023', '2024', '2025'}
        self.ano_aba2V = sorted(self.ano_aba2V)
        self.ano_aba2.set(self.hj.year)
        self.entradaAno = OptionMenu(frame_aba2, self.ano_aba2,
                                     *self.ano_aba2V)
        self.entradaAno.place(x=150, y=140, width=70, height=25)

        #### Lote
        lote_aba2label = LabelGlac(frame_aba2)
        lote_aba2label.configure(text=self.m_Lote)
        lote_aba2label.place(x=20, y=170, width=80, height=25)

        self.lote_aba2 = EntPlaceHold(frame_aba2, '')
        self.lote_aba2.place(x=100, y=170, width=100, height=25)

        #### Validade
        valid_aba2label = LabelGlac(frame_aba2)
        valid_aba2label.configure(text=self.m_Validade)
        valid_aba2label.place(x=20, y=200, width=80, height=25)

        self.diaV_aba2 = Entry(frame_aba2)
        self.diaV_aba2.configure(validate="key", validatecommand=self.vcmd2)
        self.diaV_aba2.place(x=100, y=200, width=25, height=25)
        self.diaV_aba2.insert(END, self.hj.day)

        self.mesV_aba2 = StringVar()
        self.mesV_aba2V = {
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'
        }
        self.mesV_aba2V = sorted(self.mes_aba2V)
        self.mesV_aba2.set(self.hj.month)
        self.entradaMesV = OptionMenu(frame_aba2, self.mesV_aba2,
                                      *self.mesV_aba2V)
        self.entradaMesV.place(x=125, y=200, width=50, height=25)

        self.anoV_aba2 = StringVar()
        self.anoV_aba2V = {'2020', '2021', '2022', '2023', '2024', '2025'}
        self.anoV_aba2V = sorted(self.ano_aba2V)
        self.anoV_aba2.set(self.hj.year)
        self.entradaAno = OptionMenu(frame_aba2, self.anoV_aba2,
                                     *self.anoV_aba2V)
        self.entradaAno.place(x=150, y=200, width=70, height=25)

        darEntrada = ButtonGlac(frame_aba2)
        darEntrada.configure(text=self.m_InserirRegistro,
                             command=self.add_movE)
        darEntrada.place(x=40, y=260, width=140, height=25)

        quantestlabel = LabelGlac(frame_aba2)
        quantestlabel.configure(text=self.m_Quant + ' ' + self.m_Estoque)
        quantestlabel.place(x=430, y=290, width=150, height=25)

        self.quantest = Entry(frame_aba2)
        self.quantest.place(x=580, y=290, width=100, height=25)

        ### Widgets - Listar produtos ###
        self.listaMov = ttk.Treeview(frame_aba2,
                                     height=10,
                                     column=("col1", "col2", "col3", "col4",
                                             "col5", "col6", "col7", "col8",
                                             "col9", "col10", "col11"))
        self.listaMov.heading("#0", text="")
        self.listaMov.heading("#1", text=self.m_Lote)
        self.listaMov.heading("#2", text="Entr")
        self.listaMov.heading("#3", text="Said")
        self.listaMov.heading("#4", text="Custo")
        self.listaMov.heading("#5", text="D")
        self.listaMov.heading("#6", text="M")
        self.listaMov.heading("#7", text=self.m_Data)
        self.listaMov.heading("#8", text="Forn")
        self.listaMov.heading("#9", text="D")
        self.listaMov.heading("#10", text="M")
        self.listaMov.heading("#11", text=self.m_Validade)

        self.listaMov.column("#0", width=1)
        self.listaMov.column("#1", width=60)
        self.listaMov.column("#2", width=50)
        self.listaMov.column("#3", width=50)
        self.listaMov.column("#4", width=60)
        self.listaMov.column("#5", width=25)
        self.listaMov.column("#6", width=25)
        self.listaMov.column("#7", width=45)
        self.listaMov.column("#8", width=80)
        self.listaMov.column("#9", width=25)
        self.listaMov.column("#10", width=25)
        self.listaMov.column("#11", width=65)

        # Cria barra de rolagem
        self.barraMov = Scrollbar(frame_aba2,
                                  orient='vertical',
                                  command=self.listaMov.yview)

        # Adiciona barra de rolagem
        self.listaMov.configure(yscroll=self.barraMov.set)
        self.barraMov.place(x=742, y=50, width=20, height=220)

        # Adiciona barra de rolagem
        self.listaMov.place(x=235, y=50)
        self.listaMov.bind("<Double-1>", self.OnDoubleClickE)

        self.desconecta_Glac()
        janelaEst.mainloop()
Esempio n. 5
0
class Tecnicos(CadTec):
    def cadtec(self):
        self.janelaTec = Toplevel()
        self.janelaTec.title(self.m_Tecnico)
        self.janelaTec.configure(background=self.fundo_do_frame)
        self.janelaTec.geometry("650x210")
        self.janelaTec.transient(self.janela)
        self.janelaTec.focus_force()
        self.janelaTec.grab_set()

        self.janelaTec.resizable(FALSE, FALSE)

        ###  Botao Novo Cliente
        self.botaoAdd = ButtonGlac(self.janelaTec)
        self.botaoAdd.configure(text=self.m_Novo)
        self.botaoAdd.configure(command=self.add_servT)
        self.botaoAdd.place(x=30, y=140, width=80, height=35)

        ### Botao Altera dados do Cliente
        self.botaoMud = ButtonGlac(self.janelaTec)
        self.botaoMud.configure(text=self.m_Alterar)
        self.botaoMud.configure(command=self.mud_servT)
        self.botaoMud.place(x=130, y=140, width=80, height=35)

        ### Botao deletar dados do Cliente
        self.botaoDel = ButtonGlac(self.janelaTec)
        self.botaoDel.configure(text=self.m_Apagar)
        self.botaoDel.configure(command=self.del_servT)
        self.botaoDel.place(x=230, y=140, width=80, height=35)

        ##  Botao limpa
        self.botaolimpa = ButtonGlac(self.janelaTec)
        self.botaolimpa.configure(text=self.m_Limpar,
                                  command=self.limpa_servicoT)
        self.botaolimpa.place(x=270, y=50, width=70, height=25)

        ###  Botao busca Cabeça
        self.botaobusca = ButtonGlac(self.janelaTec)
        self.botaobusca.configure(bitmap='questhead',
                                  command=self.busca_servicoT)
        self.botaobusca.place(x=290, y=80, width=30, height=30)

        ###  Botao busca Carregar
        self.botaoCarregar = ButtonGlac(self.janelaTec)
        self.botaoCarregar.configure(text=self.m_Carregar,
                                     command=self.carrega_servicoT)
        self.botaoCarregar.place(x=135, y=50, width=130, height=25)

        self.descrCod = LabelGlac(self.janelaTec)
        self.descrCod.configure(text=self.m_Codigo)
        self.descrCod.place(x=1, y=50, width=80, height=25)

        self.entradaCod = EntPlaceHold(self.janelaTec, '')
        self.entradaCod.place(x=80, y=50, width=40, height=25)

        self.descrTec = LabelGlac(self.janelaTec)
        self.descrTec.configure(text=self.m_Tecnico)
        self.descrTec.place(x=1, y=80, width=80, height=25)

        self.entradaTec = EntPlaceHold(self.janelaTec, '')
        self.entradaTec.place(x=80, y=83, width=210, height=25)

        # Widgets - Listar tecnicos
        self.listaServ = ttk.Treeview(self.janelaTec,
                                      height=6,
                                      column=("col1", "col2"))
        self.listaServ.heading("#0", text="")
        self.listaServ.column("#0", width=0)
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.column("#1", width=55)
        self.listaServ.heading("#2", text=self.m_Tecnico)
        self.listaServ.column("#2", width=220)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaTec,
                               orient='vertical',
                               command=self.listaServ.yview)

        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=620, y=50, width=20, height=140)
        self.listaServ.bind("<Double-1>", self.OnDoubleClickT)

        self.conecta_Glac()

        lista = self.cursor.execute("""
                    SELECT cod, tecnico FROM tecnico  ORDER BY tecnico ASC;
                    """)
        for i in lista:
            self.listaServ.insert("", END, values=i)

        self.listaServ.place(x=345, y=50)

        self.desconecta_Glac()

        self.janelaTec.mainloop()
Esempio n. 6
0
class Aba2:
    def aba2(self):
        # Cabeçalho dos itens_orc 1 A 10 - Aba 2
        self.frameItens = GradientFrame(self.frame_aba2)
        self.frameItens.place(relx=0.002,
                              rely=0.01,
                              relwidth=0.99,
                              relheight=0.99)
        # Label codigo
        self.descrCodI = LabelGlac(self.frame_aba2)
        self.descrCodI.configure(bg=self.bg_button,
                                 fg=self.fg_label,
                                 text=self.m_CodigoItem)
        self.descrCodI.place(relx=0.56,
                             rely=0.02,
                             relwidth=0.12,
                             relheight=0.09)
        # Label Servicos Peças
        self.descrCol2 = LabelGlac(self.frame_aba2)
        self.descrCol2.configure(text=self.m_ServicosProdutos,
                                 justify='center',
                                 fg=self.bg_label,
                                 bg=self.fg_label)
        self.descrCol2.place(relx=0.01,
                             rely=0.02,
                             relwidth=0.55,
                             relheight=0.09)

        # Label Valor
        self.descrCol3 = Label(self.frame_aba2,
                               text=self.m_ValorUnit,
                               bg=self.bg_label,
                               fg=self.fg_label,
                               font=('Verdana', '10', 'bold'))
        self.descrCol3.place(relx=0.69,
                             rely=0.02,
                             relwidth=0.09,
                             relheight=0.09)

        # Quantidade
        self.descrQuant = ButtonGlac(self.frame_aba2)
        self.descrQuant.configure(text=self.m_Quant,
                                  bg=self.fg_label,
                                  fg=self.bg_label,
                                  command=self.altera_itens_orc_quant2,
                                  font=('Verdana', '10', 'bold'))
        self.descrQuant.place(relx=0.78,
                              rely=0.02,
                              relwidth=0.05,
                              relheight=0.09)

        ###     Total Item
        self.descrTotalItem = Label(self.frame_aba2,
                                    text=self.m_Total + ' ' + self.m_Item,
                                    bg=self.bg_label,
                                    fg=self.fg_label,
                                    font=('Verdana', '10', 'bold'))
        self.descrTotalItem.place(relx=0.83,
                                  rely=0.02,
                                  relwidth=0.1,
                                  relheight=0.09)

        ### Widgets - Listar item 1 ###
        self.listaCol2a = AutocompleteEntrySP(self.frame_aba2)
        self.listaCol2a.place(relx=0.01,
                              rely=0.11,
                              relwidth=0.5,
                              relheight=0.1)

        ### Codigo do Item
        self.codServ1 = Entry(self.frame_aba2,
                              validate="key",
                              width=6,
                              bd=1,
                              justify='center',
                              fg=self.fg_entry,
                              bg=self.bg_entry,
                              font=('Verdana', '8', 'bold'))
        self.codServ1.place(relx=0.56, rely=0.11, relwidth=0.06, relheight=0.1)

        self.btSeta = self.btSeta.subsample(4, 5)
        self.botaoAddServicos1 = Button(self.frame_aba2,
                                        image=self.btSeta,
                                        command=self.add_servico1)
        self.botaoAddServicos1.place(relx=0.63, rely=0.11, width=30, height=25)

        #### Botao Busca Item
        self.botaoBuscaSP1 = Button(self.frame_aba2,
                                    bd=0,
                                    bg=self.bg_label,
                                    image=self.tecnicoBt,
                                    command=self.busca_servico1)
        self.botaoBuscaSP1.place(relx=0.51, rely=0.11, width=38, height=31)
        #### Coluna Quantidade
        self.listaCol3a = EntPlaceHold(self.frame_aba2, '')
        self.listaCol3a.config(validate="key",
                               validatecommand=self.vcmd4float,
                               bd=1,
                               justify='center',
                               font=('Verdana', '8', 'bold'))
        self.listaCol3a.place(relx=0.78,
                              rely=0.11,
                              relwidth=0.05,
                              relheight=0.1)
        #### Coluna Valor
        self.listaCol4a = EntPlaceHold(self.frame_aba2, '')
        self.listaCol4a.config(validate="key", justify='right')
        self.listaCol4a.place(relx=0.69,
                              rely=0.11,
                              relwidth=0.09,
                              relheight=0.1)
        ###### Coluna Total Unitario
        self.listaCol5a = Entry(self.frame_aba2)
        self.listaCol5a.config(validate="key")
        self.listaCol5a.place(relx=0.83,
                              rely=0.11,
                              relwidth=0.1,
                              relheight=0.1)
        ###### ADD
        self.add = self.add.subsample(4, 5)
        self.botaoAddServicos2 = Button(self.frame_aba2,
                                        bd=1,
                                        bg=self.bg_label,
                                        image=self.add,
                                        command=self.add_itens_orc)
        self.botaoAddServicos2.place(relx=0.931,
                                     rely=0.11,
                                     width=30,
                                     height=25)
        # treeview #
        self.barraServProd = Scrollbar(self.frame_aba2,
                                       orient='vertical',
                                       command=self.OnVsb_Orc2)

        self.listaServProd = ttk.Treeview(
            self.frame_aba2,
            height=10,
            yscrollcommand=self.barraServProd.set,
            column=("col1", "col2", "col3", "col4", "col5", "col6"))

        self.listaServProd.heading("#0", text="")
        self.listaServProd.heading("#1", text=self.m_Item)
        self.listaServProd.heading("#2", text=self.m_Serviços)
        self.listaServProd.heading("#3", text=self.m_Codigo)
        self.listaServProd.heading("#4", text=self.m_Valor)
        self.listaServProd.heading("#5", text=self.m_Quant)
        self.listaServProd.heading("#6",
                                   text=self.m_Valor + ' ' + self.m_Total)

        self.listaServProd.column("#0", width=1)
        self.listaServProd.column("#1", width=10)
        self.listaServProd.column("#2", width=450)
        self.listaServProd.column("#3", width=45)
        self.listaServProd.column("#4", width=60)
        self.listaServProd.column("#5", width=45)
        self.listaServProd.column("#6", width=60)

        self.listaServProd.place(relx=-0.031,
                                 rely=0.24,
                                 relwidth=0.98,
                                 relheight=0.72)

        self.listaServProd.configure(yscroll=self.barraServProd.set)
        self.barraServProd.place(relx=0.948,
                                 rely=0.24,
                                 relwidth=0.02,
                                 relheight=0.72)
        self.listaServProd.bind('<Double-1>', self.altera_itens_orc)
        self.listaServProd.bind('<Return>', self.altera_itens_orc)
        self.listaServProd.bind('<Delete>', self.altera_itens_orc_deletabt2)
Esempio n. 7
0
class MarcaProdutos(CadMarcaProd):
    def cadmarcaprod(self):
        self.janelaM = Toplevel()
        self.janelaM.title(self.m_Marca + ' ' + self.m_Produtos)
        self.janelaM.configure(background=self.fundo_do_frame)
        self.janelaM.geometry("870x200")
        self.janelaM.resizable(FALSE, FALSE)
        self.janelaM.transient(self.janela)
        self.janelaM.focus_force()
        self.janelaM.grab_set()

        self.descrCod = LabelGlac(self.janelaM)
        self.descrCod.configure(text=self.m_Codigo)
        self.descrCod.place(x=5, y=20, width=80, height=25)

        self.entradaCod = EntPlaceHold(self.janelaM, '')
        self.entradaCod.place(x=85, y=20, width=50, height=25)

        ###  Botao Carrega marca
        self.botaoAdd = ButtonGlac(self.janelaM)
        self.botaoAdd.configure(text=self.m_Carregar,
                                command=self.carrega_marca_prod)
        self.botaoAdd.place(x=145, y=20, width=130, height=25)

        ###  Botao limpa automovel
        self.botaolimpa = ButtonGlac(self.janelaM)
        self.botaolimpa.configure(text=self.m_Limpar,
                                  command=self.limpa_marca_prod)
        self.botaolimpa.place(x=280, y=20, width=70, height=25)

        self.descrMarca = LabelGlac(self.janelaM)
        self.descrMarca.configure(text=self.m_Marca)
        self.descrMarca.place(x=5, y=50, width=80, height=25)

        self.entradaMarca = EntPlaceHold(self.janelaM, '')
        self.entradaMarca.place(x=85, y=50, width=200, height=25)

        ###  Botao busca automovel
        self.botaobusca = ButtonGlac(self.janelaM)
        self.botaobusca.configure(text=self.m_Buscar,
                                  command=self.busca_marca_prod)
        self.botaobusca.place(x=285, y=50, width=70, height=25)

        self.descrDescricao = LabelGlac(self.janelaM)
        self.descrDescricao.configure(text=self.m_Descricao)
        self.descrDescricao.place(x=5, y=90, width=80, height=25)

        self.entradaDescricao = EntPlaceHold(self.janelaM, '')
        self.entradaDescricao.place(x=85, y=90, width=250, height=25)

        # Botao adicionar
        self.botaoAdd = ButtonGlac(self.janelaM)
        self.botaoAdd.configure(text=self.m_Novo, command=self.add_marca_prod)
        self.botaoAdd.place(x=30, y=150, width=85, height=25)

        # botao mudar
        self.botaoMud = ButtonGlac(self.janelaM)
        self.botaoMud.configure(text=self.m_Alterar,
                                command=self.mud_marca_prod)
        self.botaoMud.place(x=130, y=150, width=85, height=25)

        # botao deletar
        self.botaoDel = ButtonGlac(self.janelaM)
        self.botaoDel.configure(text=" Apagar ", command=self.del_marca_prod)
        self.botaoDel.place(x=230, y=150, width=85, height=25)

        ### Widgets - Listar produtos ###
        self.listaServ = ttk.Treeview(self.janelaM,
                                      height=7,
                                      column=("col1", "col2", "col3"))
        self.listaServ.heading("#0", text="")
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.heading("#2", text=self.m_Marca)
        self.listaServ.heading("#3", text=self.m_Descricao)

        self.listaServ.column("#0", width=0)
        self.listaServ.column("#1", width=65)
        self.listaServ.column("#2", width=200)
        self.listaServ.column("#3", width=220)
        self.listaServ.place(x=360, y=20)

        self.conecta_Glac()

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaM,
                               orient='vertical',
                               command=self.listaServ.yview)
        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=845, y=20, width=20, height=160)

        lista = self.cursor.execute("""
            SELECT cod_marca, marca, descricao FROM marcaprod ORDER BY marca ASC ;
            """)
        for i in lista:
            self.listaServ.insert("", END, values=i)

        self.listaServ.bind("<Double-1>", self.OnDoubleClickMarc)
        self.desconecta_Glac()

        self.janelaM.mainloop()
Esempio n. 8
0
class Automoveis(cadAuto):
    def cadaut(self):
        self.telaAut()
        self.canvasAut()
    def telaAut(self):
        self.janelaAut = Toplevel()
        self.janelaAut.title('Glac')
        self.janelaAut.configure(background=self.fundo_da_tela)
        self.janelaAut.geometry("800x235")
        self.janelaAut.resizable(FALSE, FALSE)
        self.janelaAut.transient(self.janela)
        self.janelaAut.focus_force()
        self.janelaAut.grab_set()

        self.background_label = Label(self.janelaAut,
            image=self.background_image)
        self.background_label.place(relwidth=1, relheight=1)
    def canvasAut(self):
        self.autoGrad = GradientFrame(self.janelaAut)
        self.autoGrad.place(relx=0.01, rely=0.12,
            relwidth=0.98, relheight=0.85)

        # Label do codigo
        self.descrCod_aut = LabelGlac(self.janelaAut)
        self.descrCod_aut.configure(text=self.m_Codigo)
        self.descrCod_aut.place(x=10, y=52, width=90)

        #### entrada do codigo
        self.entradaCod_autA = EntPlaceHold(self.janelaAut, '')
        self.entradaCod_autA.configure(validate="key",
            validatecommand=self.vcmd4)
        self.entradaCod_autA.place(x=85, y=52, width=40)

        # descrição do veiculo
        self.descrAut = LabelGlac(self.janelaAut)
        self.descrAut.configure(text=self.m_Automovel)
        self.descrAut.place(x=10, y=90)

        self.entradaAutA = EntPlaceHold(self.janelaAut, '')
        self.entradaAutA.configure(width=22)
        self.entradaAutA.place(x=95, y=90)

        #### entry da marca
        self.entradaMarcaA = EntPlaceHold(self.janelaAut, '')
        self.entradaMarcaA.configure(width=28)
        self.entradaMarcaA.place(x=85, y=130)

        self.entradaMarca2A = Entry(width=20)

        ##### label do titulo da janela
        self.descrNomeServ = LabelGlac(self.janelaAut)
        self.descrNomeServ.configure(text=self.m_Automoveis)
        self.descrNomeServ.place(relx=0.4, rely=0,
                                 relwidth= 0.2,relheight=0.1)

        ###### botão busca
        self.botaoBuscaAut = ButtonGlac(self.janelaAut)
        self.botaoBuscaAut.configure(text=self.m_Buscar,
                                     command=self.busca_automovelA)
        self.botaoBuscaAut.place(x=290, y=89, width=65, height=23)

        ##### botao Carregar
        self.botaoCarregaAut = ButtonGlac(self.janelaAut)
        self.botaoCarregaAut.configure(text=self.m_Carregar,
                            command=self.carrega_automovelA)
        self.botaoCarregaAut.place(x=150, y=50, width=90)

        ##### botao limpa
        self.botaoLimpaAut = ButtonGlac(self.janelaAut)
        self.botaoLimpaAut.configure(text=self.m_Limpar,
                            command=self.limpa_automovelA)
        self.botaoLimpaAut.place(x=250, y=50, width=90)

        #### botao marca
        self.botaoMarcaAut = ButtonGlac(self.janelaAut)
        self.botaoMarcaAut.configure(text=self.m_Marca,
                            command=self.busca_autoA)
        self.botaoMarcaAut.place(x=10, y=128,
            width=72, height=23)

        #####
        self.botaoNovoAut = ButtonGlac(self.janelaAut)
        self.botaoNovoAut.configure(text=self.m_Novo,
                            command=self.add_automovelA)
        self.botaoNovoAut.place(x=30, y=180, width=80)

        #####
        self.botaoAlterarAut = ButtonGlac(self.janelaAut)
        self.botaoAlterarAut.configure(text=self.m_Alterar,
                                command=self.mud_automovelA)
        self.botaoAlterarAut.place(x=130, y=180, width=80)

        #####
        self.botaoApagarAut = ButtonGlac(self.janelaAut)
        self.botaoApagarAut.configure(text=self.m_Apagar,
                                command=self.del_automovelA)
        self.botaoApagarAut.place(x=230, y=180, width=80)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaAut,
            orient='vertical', command=self.OnVsbA)

        # Widgets - Listar veiculos
        self.listaServ = ttk.Treeview(self.janelaAut, height=8,
                                column=("col1", "col2", "col3"))
        self.listaServ.heading("#0", text="")
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.heading("#2", text=self.m_Automovel)
        self.listaServ.heading("#3", text=self.m_Marca)

        self.listaServ.column("#0", width=0)
        self.listaServ.column("#1", width=45)
        self.listaServ.column("#2", width=180)
        self.listaServ.column("#3", width=170)
        self.listaServ.configure(yscroll=self.barra.set)
        self.listaServ.place(x=365, y=40)

        # Adiciona barra de rolagem
        self.barra.place(x=765, y=40, width=20, height=185)

        self.busca_automovelA()
        ###
        ''' Função de duplo clique na lista para carregar os dados da seleção
        na tela de cadastro'''
        self.listaServ.bind("<Double-1>", self.OnDoubleClickA)
        ###

        self.janelaAut.mainloop()
    def busca_autoA(self):
        # Widgets -
        self.entradaMarcaA.insert(0, '%')
        veicAuto = self.entradaMarcaA.get()

        self.listatec = Toplevel()
        self.listatec.title(" GLAC  ")
        self.listatec.configure(background='gray75')
        self.listatec.geometry("320x220")
        self.listatec.resizable(FALSE, FALSE)
        self.listatec.transient(self.janelaAut)
        self.listatec.focus_force()
        self.listatec.grab_set()

        ### Widgets -
        self.listaTec1 = ttk.Treeview(self.listatec, height=5,
                                      column=("col1", "col2"))
        self.listaTec1.heading("#0", text="")
        self.listaTec1.heading("#1", text=self.m_Codigo)
        self.listaTec1.heading("#2", text='Marca')

        self.listaTec1.column("#0", width=0)
        self.listaTec1.column("#1", width=60)
        self.listaTec1.column("#2", width=200)

        self.barra.place(relx=0.9, rely=0.1,
                         relwidth=0.1, relheight=0.8)
        # Adiciona barra de rolagem
        self.listaTec1.configure(yscroll=self.barra.set)
        self.listaTec1.place(relx=0.1, rely=0.1,
                             relwidth= 0.8, relheight=0.8)
        # Binding da listbox
        self.listaTec1.bind('<Double-1>', self.add_autobindA)

        self.conecta_Glac()

        buscaservico = self.cursor.execute("""SELECT cod, marca 
            FROM montadora 
            WHERE marca LIKE '%s' ORDER BY marca ASC""" % veicAuto)

        for i in buscaservico:
            self.listaTec1.insert("", END, values=i)

        self.entradaMarcaA.delete('0', 'end')
        self.entradaMarca2A.delete('0', 'end')

        self.desconecta_Glac()
Esempio n. 9
0
class Empresa(CadEmpresa):
    def cademp(self):
        self.janelaEmp = Toplevel()
        self.janelaEmp.title('Glacx' + self.m_Empresa)
        self.janelaEmp.configure(background=self.fundo_da_tela)
        self.janelaEmp.geometry("410x250")
        self.janelaEmp.resizable(FALSE, FALSE)
        self.janelaEmp.transient(self.janela)
        self.janelaEmp.focus_force()
        self.janelaEmp.grab_set()

        self.descrNomeServ = LabelGlac(self.janelaEmp)
        self.descrNomeServ.configure(text=self.m_Estab)
        self.descrNomeServ.place(relx=0.2, rely=0.05, relwidth=0.6)

        self.cliente_canvas2 = Canvas(self.janelaEmp, width=380, height=190,
            cursor='X_cursor', bd=2, bg=self.fundo_do_frame)
        self.cliente_canvas2.place(x=8, y=38)

        self.entradaCod_emp = Entry(self.janelaEmp, width=6)

        ###  Descrição e Entrada Nome
        self.descrNome = LabelGlac(self.janelaEmp)
        self.descrNome.configure(text=self.m_Nome)
        self.descrNome.place(x=10, y=53, width=80)

        self.entradaNome_emp = Listbox(self.janelaEmp, height=1)
        self.entradaNome_emp.place(x=85, y=53, width=300)

        ###  Descrição e Entrada Enedereco
        self.descrEndereco = LabelGlac(self.janelaEmp)
        self.descrEndereco.configure(text=self.m_Endereco)
        self.descrEndereco.place(x=10, y=83, width=80)

        self.entradaEndereco_emp = Listbox(self.janelaEmp, height=1)
        self.entradaEndereco_emp.place(x=85, y=83, width=300)

        ###  Descrição e Entrada Bairro
        self.descrBairro = LabelGlac(self.janelaEmp)
        self.descrBairro.configure(text=self.m_Bairro )
        self.descrBairro.place(x=10, y=103, width=80)

        self.entradaBairro_emp = Listbox(self.janelaEmp, height=1)
        self.entradaBairro_emp.place(x=85, y=103, width=300)

        ###  Descrição e Entrada Municipio
        self.descrMunicipio = LabelGlac(self.janelaEmp)
        self.descrMunicipio.configure(text=self.m_Cidade)
        self.descrMunicipio.place(x=10, y=123, width=80)

        self.entradaMunicipio_emp = Listbox(self.janelaEmp, height=1)
        self.entradaMunicipio_emp.place(x=85, y=123, width=220)

        ###  Descrição e Entrada UF
        self.descrUf = LabelGlac(self.janelaEmp)
        self.descrUf.configure(text=self.m_Uf)
        self.descrUf.place(x=315, y=123, width=30)

        self.entradaUf_emp = Listbox(self.janelaEmp, height=1)
        self.entradaUf_emp.place(x=350, y=123, width=30)

        #  Descrição e Entrada Fone
        self.descrFone = LabelGlac(self.janelaEmp)
        self.descrFone.configure(text=self.m_Fone)
        self.descrFone.place(x=10, y=143, width=80)

        self.entradaFone_emp = Listbox(self.janelaEmp, height=1)
        self.entradaFone_emp.place(x=85, y=143, width=140)

        ###  Descrição e Entrada Cep
        self.descrCep = LabelGlac(self.janelaEmp)
        self.descrCep.configure(text=self.m_Cep)
        self.descrCep.place(x=230, y=143, width=40)

        self.entradaCep_emp = Listbox(self.janelaEmp, height=1)
        self.entradaCep_emp.place(x=270, y=143, width=115)

        ###  Descrição e Entrada Cpf
        self.descrCpf = LabelGlac(self.janelaEmp)
        self.descrCpf.configure(text=self.m_Cnpj)
        self.descrCpf.place(x=10, y=163, width=80)

        self.entradaCpf_emp = Listbox(self.janelaEmp, height=1)
        self.entradaCpf_emp.place(x=85, y=163, width=140)

        ###  Descrição e Entrada Rg
        self.descrRg = LabelGlac(self.janelaEmp)
        self.descrRg.configure(text=self.m_Cpf)
        self.descrRg.place(x=230, y=163, width=40)

        self.entradaRg_emp = Listbox(self.janelaEmp, height=1)
        self.entradaRg_emp.place(x=270, y=163, width=115)

        ###  Descrição e Entrada Obs
        self.descrObs = LabelGlac(self.janelaEmp)
        self.descrObs.configure(text=self.m_Obs)
        self.descrObs.place(x=10, y=193, width=80)

        self.entradaObs_emp = Listbox(self.janelaEmp, height=1)
        self.entradaObs_emp.place(x=85, y=193, width=300)

        self.conecta_Glac()

        lista = self.cursor.execute("""
                SELECT cod_emp FROM empresa;
                """)
        for i in lista:
            self.entradaCod_emp.insert(i, END)

        self.desconecta_Glac()

        self.carrega_empresa()
        self.janelaEmp.mainloop()
Esempio n. 10
0
class Fornecedores(CadForn):
    def cadforn(self):
        self.telaForn()
        self.canvasForn()

    def telaForn(self):
        self.janelaFor = Toplevel()
        self.janelaFor.title(self.m_Fornecedores)
        self.janelaFor.configure(background=self.fundo_do_frame)
        self.janelaFor.geometry("720x290")
        self.janelaFor.resizable(FALSE, FALSE)
        self.janelaFor.transient(self.janela)
        self.janelaFor.focus_force()
        self.janelaFor.grab_set()

    def canvasForn(self):
        # Codigo
        self.descrCod_forn = LabelGlac(self.janelaFor)
        self.descrCod_forn.configure(text=self.m_Codigo + self.m_Pontinhos)
        self.descrCod_forn.place(x=0, y=20)

        self.entradaCod_forn = EntPlaceHold(self.janelaFor, '')
        self.entradaCod_forn.place(x=70, y=20)

        # Fornecedor
        self.descrFornecedor = LabelGlac(self.janelaFor)
        self.descrFornecedor.configure(text=self.m_Fornecedor +
                                       self.m_Pontinhos)
        self.descrFornecedor.place(x=1, y=50)

        self.entradaFornecedor = EntPlaceHold(self.janelaFor, '')
        self.entradaFornecedor.place(x=95, y=50, width=170)

        # Fone
        self.descrFone = LabelGlac(self.janelaFor)
        self.descrFone.configure(text=self.m_Fone + self.m_Pontinhos)
        self.descrFone.place(x=1, y=80)

        self.entradaFone = EntPlaceHold(self.janelaFor, '')
        self.entradaFone.place(x=50, y=80, width=100)

        #
        self.descrCnpj = LabelGlac(self.janelaFor)
        self.descrCnpj.configure(text=self.m_Cnpj + self.m_Pontinhos)
        self.descrCnpj.place(x=160, y=80)

        self.entradaCnpj = EntPlaceHold(self.janelaFor, '')
        self.entradaCnpj.place(x=205, y=80, width=130)

        ####
        self.entradaCep = EntPlaceHold(self.janelaFor, '')
        self.entradaCep.place(x=50, y=113, width=100)

        ####
        self.descrEndereco = LabelGlac(self.janelaFor)
        self.descrEndereco.configure(text=self.m_Endereco)
        self.descrEndereco.place(x=1, y=140, width=80)

        self.entradaEndereco = EntPlaceHold(self.janelaFor, '')
        self.entradaEndereco.place(x=80, y=140, width=250)

        ####
        self.descrMunicipio = LabelGlac(self.janelaFor)
        self.descrMunicipio.configure(text=self.m_Cidade)
        self.descrMunicipio.place(x=1, y=170, width=80)

        self.entradaMunicipio = EntPlaceHold(self.janelaFor, '')
        self.entradaMunicipio.place(x=80, y=170, width=250)

        #
        self.descrDescricao = LabelGlac(self.janelaFor)
        self.descrDescricao.configure(text=self.m_Observacao)
        self.descrDescricao.place(x=0, y=200, width=100)

        self.entradaDescricao = EntPlaceHold(self.janelaFor, '')
        self.entradaDescricao.place(x=100, y=200, width=230)

        self.botaoCarregarForn = ButtonGlac(self.janelaFor)
        self.botaoCarregarForn.configure(text=self.m_Carregar)
        self.botaoCarregarForn.configure(command=self.carrega_fornecedor)
        self.botaoCarregarForn.place(x=120, y=20, width=140)

        self.botaoLimpaForn = ButtonGlac(self.janelaFor)
        self.botaoLimpaForn.configure(text=self.m_Limpar)
        self.botaoLimpaForn.configure(command=self.limpa_fornecedor)
        self.botaoLimpaForn.place(x=270, y=20, width=70)

        self.botaoBuscaForn = ButtonGlac(self.janelaFor)
        self.botaoBuscaForn.configure(text=self.m_Buscar)
        self.botaoBuscaForn.configure(command=self.busca_fornecedor)
        self.botaoBuscaForn.place(x=270, y=50, width=70)

        self.botaoCepForn = ButtonGlac(self.janelaFor)
        self.botaoCepForn.configure(text=self.m_Cep)
        self.botaoCepForn.configure(command=self.cepForn)
        self.botaoCepForn.place(x=0, y=108, width=50, height=25)

        self.botaoNovoForn = ButtonGlac(self.janelaFor)
        self.botaoNovoForn.configure(text=self.m_Novo)
        self.botaoNovoForn.configure(command=self.add_fornec)
        self.botaoNovoForn.place(x=50, y=240, width=90)

        self.botaoAlterarForn = ButtonGlac(self.janelaFor)
        self.botaoAlterarForn.configure(text=self.m_Alterar)
        self.botaoAlterarForn.configure(command=self.mud_fornec)
        self.botaoAlterarForn.place(x=150, y=240, width=90)

        self.botaoApagarFornecedor = ButtonGlac(self.janelaFor)
        self.botaoApagarFornecedor.configure(text=self.m_Apagar)
        self.botaoApagarFornecedor.configure(command=self.del_fornec)
        self.botaoApagarFornecedor.place(x=250, y=240, width=90)

        ### Widgets - Listar veiculos ###
        self.listaServ = ttk.Treeview(self.janelaFor,
                                      height=12,
                                      column=("col1", "col2", "col3", "col4"))
        self.listaServ.heading("#0", text="")
        self.listaServ.column("#0", width=0)
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.column("#1", width=40)
        self.listaServ.heading("#2", text=self.m_Fornecedores)
        self.listaServ.column("#2", width=120)
        self.listaServ.heading("#3", text=self.m_Fone)
        self.listaServ.column("#3", width=70)
        self.listaServ.heading("#4", text=self.m_Cidade)
        self.listaServ.column("#4", width=100)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaFor,
                               orient='vertical',
                               command=self.listaServ.yview)

        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=688, y=12, width=20, height=268)
        self.listaServ.place(x=355, y=12)
        self.listaServ.bind("<Double-1>", self.OnDoubleClickForn)

        self.conecta_Glac()
        lista = self.cursor.execute("""
                    SELECT cod_forn, fornecedor, fone, cnpj, municipio, descricao 
                    FROM fornecedores ORDER BY fornecedor ASC;
                    """)
        rows = self.cursor.fetchall()
        for row in rows:
            self.listaServ.insert("", END, values=row)
        self.desconecta_Glac()
Esempio n. 11
0
class Produtos(CadProdutos):
    def cadprod(self):
        # Montagem da Janela
        self.janelaProd = Toplevel()
        self.janelaProd.configure(background= self.fundo_do_frame)
        self.janelaProd.title(self.m_Produtos)
        self.janelaProd.geometry("882x250")
        self.janelaProd.resizable(FALSE, FALSE)
        self.janelaProd.transient(self.janela)
        self.janelaProd.focus_force()
        self.janelaProd.grab_set()

        # Criação dos widgets

        ########################################################
        # Código do Produto
        #Label
        self.descrCodprod = LabelGlac(self.janelaProd)
        self.descrCodprod.configure(text= self.m_Codigo)
        self.descrCodprod.place(x=2, y=5, width=80, height=25)
        # Entry
        self.entradaCodprod = EntPlaceHold(self.janelaProd, '')
        self.entradaCodprod.place(x=75, y=5, width=60, height=25)
        ##########################################################
        # Descrição do produto
        #Label
        self.descrProd = LabelGlac(self.janelaProd)
        self.descrProd.configure(text=self.m_Produtos)
        self.descrProd.place(x=2, y=33, width=80, height=25)
        # Entry
        self.entradaProd = EntPlaceHold(self.janelaProd, '')
        self.entradaProd.place(x=80, y=33, width=200, height=25)
        #########################################################
        # Botao Carrega
        self.botaoAdd = ButtonGlac(self.janelaProd)
        self.botaoAdd.configure(text= self.m_Carregar,
            command= self.carrega_produtoP)
        self.botaoAdd.place(x=150, y=2, width=115)
        ########################################################
        # Botao limpa
        self.botaolimpa = ButtonGlac(self.janelaProd)
        self.botaolimpa.configure(command=self.limpa_produtoP,
                                  text= self.m_Limpar)
        self.botaolimpa.place(x=275, y=2, width=70, height=25)

        ########################################################
        ###  Botao busca automovel
        self.botaolimpa = ButtonGlac(self.janelaProd)
        self.botaolimpa.configure(command=self.busca_produtoP,
                                  text= self.m_Buscar)
        self.botaolimpa.place(x=275, y=30, width=70, height=25)
        #######################################################
        # Botão Marca do Produto
        self.descrIdMarcaprod = ButtonGlac(self.janelaProd)
        self.descrIdMarcaprod.configure(text= self.m_Marca,
                                        command=self.busca_marcaP)
        self.descrIdMarcaprod.place(x=2, y=62, width=100, height=25)
        # Entry oculta
        self.entradaIdMarcaprod = Entry(self.janelaProd, width=6)

        self.entradaMarcaprod = EntPlaceHold(self.janelaProd, '')
        self.entradaMarcaprod.place(x=105, y=62, width=250, height=25)

        self.descrIdFornec = ButtonGlac(self.janelaProd)
        self.descrIdFornec.configure(text= self.m_Fornecedor,
                                     command=self.busca_fornecP)
        self.descrIdFornec.place(x=1, y=92, width=100, height=25)

        self.entradaIdFornec = Entry(self.janelaProd, width=6)

        self.entradaFornec = EntPlaceHold(self.janelaProd, '')
        self.entradaFornec.place(x=105, y=93, width=250, height=25)

        self.descrCusto = LabelGlac(self.janelaProd)
        self.descrCusto.configure(text= self.m_Custo_R)
        self.descrCusto.place(x=2, y=122, width=80, height=25)

        self.entradaCusto = EntPlaceHold(self.janelaProd, '')
        self.entradaCusto.configure(validate="key",
            validatecommand=self.vcmd8float)
        self.entradaCusto.place(x=83, y=122, width=80, height=25)

        self.descrValor = LabelGlac(self.janelaProd)
        self.descrValor.configure(text= self.m_Valor_R)
        self.descrValor.place(x=170, y=122, width=80, height=25)

        self.entradaValor = EntPlaceHold(self.janelaProd, '')
        self.entradaValor.configure(validate="key",
                                    validatecommand=self.vcmd8float)
        self.entradaValor.place(x=250, y=123, width=80, height=25)

        self.descrDescricao = LabelGlac(self.janelaProd)
        self.descrDescricao.configure(text= self.m_Descricao)
        self.descrDescricao.place(x=2, y=150, width=80, height=25)

        self.entradaDescricao = EntPlaceHold(self.janelaProd, '')
        self.entradaDescricao.place(x=83, y=153, width=250, height=25)

        self.botaoAdd = ButtonGlac(self.janelaProd)
        self.botaoAdd.configure(text= self.m_Novo,
                                command=self.add_produtoP)
        self.botaoAdd.place(x=50, y=190, width=80, height=35)

        self.botaoMudServ = ButtonGlac(self.janelaProd)
        self.botaoMudServ.configure(text= self.m_Alterar,
                                    command=self.mud_produtoP)
        self.botaoMudServ.place(x=150, y=190, width=80, height=35)

        self.botaoDel = ButtonGlac(self.janelaProd)
        self.botaoDel.configure(text= self.m_Apagar,
            command=self.del_produtoP)
        self.botaoDel.place(x=250, y=190, width=80, height=35)

        ### Widgets - Listar produtos ###
        self.listaServ = ttk.Treeview(self.janelaProd,
            height=10, column=("col1", "col2", "col3", "col4", "col5", "col6"))
        self.listaServ.heading("#0", text="")
        self.listaServ.column("#0", width=0)
        self.listaServ.heading("#1", text= self.m_Codigo)
        self.listaServ.column("#1", width=60)
        self.listaServ.heading("#2", text= self.m_Produtos)
        self.listaServ.column("#2", width=220)
        self.listaServ.heading("#3", text="")
        self.listaServ.column("#3", width=25)
        self.listaServ.heading("#4", text= self.m_Custo_R)
        self.listaServ.column("#4", width=70)
        self.listaServ.heading("#5", text="")
        self.listaServ.column("#5", width=25)
        self.listaServ.heading("#6", text= self.m_Valor_R)
        self.listaServ.column("#6", width=80)

        self.conecta_Glac()

        # Cria barra de rolagem
        self.barra = Scrollbar(self.janelaProd, orient='vertical',
                               command=self.listaServ.yview)
        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=845, y=5, width=20, height=230)

        lista = self.cursor.execute("""
            SELECT cod_sp, servprod, "R$", custo, "R$", valor FROM servprod
      	    WHERE sp = "P" ORDER BY servprod ASC ;
            """)
        for i in lista:
            self.listaServ.insert("", END, values=i)

        self.listaServ.place(x=360, y=5)

        self.listaServ.bind("<Double-1>", self.OnDoubleClickP)

        self.desconecta_Glac()

        self.janelaProd.mainloop()
Esempio n. 12
0
class Financeiro(ConsFinan):
    def cadfinan(self):
        self.janelaFin = Toplevel()
        self.janelaFin.configure(background=self.fundo_da_tela)
        self.janelaFin.title(self.m_Financeiro)
        self.janelaFin.geometry("777x335")
        self.janelaFin.resizable(FALSE, FALSE)
        self.janelaFin.transient(self.janela)
        self.janelaFin.focus_force()
        self.janelaFin.grab_set()

        ###  A B A S
        self.abas = Notebook(self.janelaFin)
        self.frame_aba1 = Frame(self.abas)
        self.frame_aba1.configure(background='gray75')

        self.label1 = Label(self.frame_aba1)
        self.label1.pack(padx=385, pady=160)
        self.abas.add(self.frame_aba1, text=self.m_Receitas)
        self.abas.place(x=0, y=0)
        ####
        self.frameProb = GradientFrame(self.frame_aba1)
        self.frameProb.place(relx=0, rely=0, relwidth=1, relheight=1)

        self.descrCodprod = LabelGlac(self.frame_aba1)
        self.descrCodprod.configure(text='Ano')
        self.descrCodprod.place(x=5, y=15, width=80, height=25)

        self.entry5 = StringVar()
        self.entry5V = {'2020', '2021', '2022', '2023', '2024', '2025'}
        self.entry5V = sorted(self.entry5V)
        self.entry5.set(self.hj.year)
        self.entradaCodReceita = OptionMenu(self.frame_aba1, self.entry5,
                                            *self.entry5V)
        self.entradaCodReceita.place(x=85, y=15, width=70, height=25)

        self.descrMes = LabelGlac(self.frame_aba1)
        self.descrMes.configure(text='Mês')
        self.descrMes.place(x=5, y=45, width=80, height=25)

        self.entry6 = StringVar()
        self.entry6V = {
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'
        }
        self.entry6V = sorted(self.entry6V)
        self.entry6.set(self.hj.month)
        self.entradaReceita = OptionMenu(self.frame_aba1, self.entry6,
                                         *self.entry6V)
        self.entradaReceita.place(x=85, y=45, width=70, height=25)

        ###  Botao Carrega
        self.botaoAdd = ButtonGlac(self.frame_aba1)
        self.botaoAdd.configure(text=self.m_Carregar,
                                command=self.carrega_receita)
        self.botaoAdd.place(x=25, y=95, width=110, height=25)

        ###  Botao limpa
        self.botaolimpa = ButtonGlac(self.frame_aba1)
        self.botaolimpa.configure(text=self.m_Limpar,
                                  command=self.limpa_receita)
        self.botaolimpa.place(x=25, y=125, width=110, height=25)

        ### Widgets - Listar produtos ###
        self.listaServ = ttk.Treeview(self.frame_aba1,
                                      height=10,
                                      column=("col1", "col2", "col3", "col4",
                                              "col5", "col6", "col7"))
        self.listaServ.heading("#0", text="")
        self.listaServ.heading("#1", text=self.m_Codigo)
        self.listaServ.heading("#2", text=self.m_Placa)
        self.listaServ.heading("#3", text=self.m_Dia)
        self.listaServ.heading("#4", text=self.m_Mes)
        self.listaServ.heading("#5", text=self.m_Ano)
        self.listaServ.heading("#6", text="")
        self.listaServ.heading("#7", text=self.m_Valor_R)

        self.listaServ.column("#0", width=0)
        self.listaServ.column("#1", width=70)
        self.listaServ.column("#2", width=140)
        self.listaServ.column("#3", width=60)
        self.listaServ.column("#4", width=60)
        self.listaServ.column("#5", width=75)
        self.listaServ.column("#6", width=30)
        self.listaServ.column("#7", width=100)

        # Cria barra de rolagem
        self.barra = Scrollbar(self.frame_aba1,
                               orient='vertical',
                               command=self.listaServ.yview)

        # Adiciona barra de rolagem
        self.listaServ.configure(yscroll=self.barra.set)
        self.barra.place(x=736, y=17, width=20, height=222)
        self.listaServ.place(x=200, y=18)

        self.listaServ.bind("<Double-1>", self.OnDoubleClickFinan)

        ### Widgets - Listar produtos ###

        self.listaServ2 = ttk.Treeview(self.frame_aba1,
                                       height=1,
                                       column=("col1", "col2", "col3"))
        self.listaServ2.heading("#0", text="")
        self.listaServ2.heading("#1", text=self.m_Ano)
        self.listaServ2.heading("#2", text=self.m_Mes)
        self.listaServ2.heading("#3", text=self.m_Total)

        self.listaServ2.column("#0", width=0)
        self.listaServ2.column("#1", width=60)
        self.listaServ2.column("#2", width=60)
        self.listaServ2.column("#3", width=100)

        self.listaServ2.place(x=500, y=250)
        self.janelaFin.mainloop()