Ejemplo n.º 1
0
    def Facturas(self, widget, data=None):
        self.LoadMesas()
        self.ListF_Cliente.clear()
        Res = BD_Conect.Load(1)
        for i in Res:
            fila = (i[0], i[1], i[2], i[3], i[4], i[5])
            BD_Conect.AltaLista(self.TreeF_Cliente, self.ListF_Cliente, fila)
        self.ListF_Factura.clear()
        Res = BD_Conect.Load(4)
        for i in Res:
            fila = (i[0], i[1], i[2], i[3], i[4])
            BD_Conect.AltaLista(self.TreeF_Factura, self.ListF_Factura, fila)

        self.NB_Principal.set_current_page(2)
Ejemplo n.º 2
0
 def FactsLiteLoad(self, widget, data=None):
     self.CursorFactLiteSlected = True
     model, iter = self.TreeFactsLite.get_selection().get_selected()
     ID = model.get_value(iter, 0)
     Res1 = BD_Conect.LoadOnService(ID)
     for i in Res1:
         DatosFactura = (i[0], i[1], i[2])
     self.ServiceSelected = DatosFactura[0]
     if self.ServiceSelected > 0 and self.ServiceSelected <= 4:
         Com = " - 6 Comensales"
     elif self.ServiceSelected > 4 and self.ServiceSelected <= 5:
         Com = " - 8 Comensales"
     elif self.ServiceSelected > 5:
         Com = " - 10 Comensales"
     self.EB_S_Selected.set_text("Mesa: " + str(self.ServiceSelected) + Com)
     self.EB_S_Camarero.set_text(DatosFactura[1])
     self.EB_S_Cliente.set_text(DatosFactura[2])
     Total = 0
     self.ListSFM.clear()
     Res = BD_Conect.LoadLF(ID)
     for i in Res:
         file = (str(i[0]), str(i[1]), str(i[2]))
         Total = Total + i[1] * i[2]
         BD_Conect.AltaLista(self.TreeSFM, self.ListSFM, file)
     self.EB_S_CosteTotal.set_text(str(Total) + "€")
Ejemplo n.º 3
0
 def LoadS(self):
     self.CursorServicesSelected = False
     self.ListServicios.clear()
     Res = BD_Conect.Load(2)
     for i in Res:
         fila = (i[1], str(i[2]), i[0])
         BD_Conect.AltaLista(self.TreeServicios, self.ListServicios, fila)
Ejemplo n.º 4
0
 def LoadClientes(self):
     ### Limpiamos la lista actual del treeview
     self.ListClientes.clear()
     ResCli = BD_Conect.Load(1)
     for i in ResCli:
         fila = (i[0], i[1], i[2])
         BD_Conect.AltaLista(self.TreeClientes, self.ListClientes, fila)
Ejemplo n.º 5
0
 def FilterByDNI(self, widget, data=None):
     self.ListF_Factura.clear()
     model, iter = self.TreeF_Cliente.get_selection().get_selected()
     ID = model.get_value(iter, 0)
     Res = BD_Conect.LoadFactFilterDNI(ID)
     for i in Res:
         file = (i[0], i[1], i[2], i[3], i[4])
         BD_Conect.AltaLista(self.TreeF_Factura, self.ListF_Factura, file)
Ejemplo n.º 6
0
 def SFactsReload(self, widget, data=None):
     self.ListFactsLite.clear()
     model, iter = self.TreeSM.get_selection().get_selected()
     ID = model.get_value(iter, 0)
     Res = BD_Conect.LoadFactLite(ID)
     for i in Res:
         file = (i[0], i[1], i[4])
         BD_Conect.AltaLista(self.TreeFactsLite, self.ListFactsLite, file)
Ejemplo n.º 7
0
 def KeySearch(self, widget, event):
     """Búsqueda rápida por apellido
     
     Mientras se escriba en la EntryBox del apartado de clientes cada vez que se teclee se realizará una búsqueda de los clientes mediante su apellido
     """
     ResCli = BD_Conect.SearchCli(self.EB_SearchC.get_text())
     self.ListClientes.clear()
     for i in ResCli:
         fila = (i[0], i[1], i[2])
         BD_Conect.AltaLista(self.TreeClientes, self.ListClientes, fila)
Ejemplo n.º 8
0
    def DelService(self, widget, data=None):
        model, iter = self.TreeFactsLite.get_selection().get_selected()
        IDF = model.get_value(iter, 0)

        model, iter = self.TreeSFM.get_selection().get_selected()
        IDS = model.get_value(iter, 0)

        BD_Conect.DelLF(IDF, IDS)
        self.ListSFM.clear()
        Res = BD_Conect.LoadLF(IDF)
        Total = 0
        for i in Res:
            file = (str(i[0]), str(i[1]), str(i[2]))
            Total = Total + i[1] * i[2]
            BD_Conect.AltaLista(self.TreeSFM, self.ListSFM, file)
        self.EB_S_CosteTotal.set_text(str(Total) + "€")
Ejemplo n.º 9
0
 def Servicios(self, widget, data=None):
     self.LoadS()
     self.LoadMesas()
     self.ServiceSelected = 0
     Res = BD_Conect.Load(3)
     self.ListFactsLite.clear()
     for i in Res:
         file = (i[0], i[1], i[4])
         BD_Conect.AltaLista(self.TreeFactsLite, self.ListFactsLite, file)
     self.EB_S_Selected.set_text("")
     self.EB_S_Camarero.set_text("")
     self.EB_S_Cliente.set_text("")
     self.EB_S_CosteTotal.set_text("")
     self.CursorServicesSelected = False
     self.CursorFactLiteSlected = False
     self.NB_Principal.set_current_page(1)
Ejemplo n.º 10
0
    def BuyService(self, widget, data=None):
        if self.CursorFactLiteSlected == True:
            if self.CursorServicesSelected == True:
                model, iter = self.TreeFactsLite.get_selection().get_selected()
                IDF = model.get_value(iter, 0)

                model, iter = self.TreeServicios.get_selection().get_selected()
                IDS = model.get_value(iter, 2)

                BD_Conect.InsertSF(IDF, IDS)
                self.ListSFM.clear()
                Res = BD_Conect.LoadLF(IDF)
                Total = 0
                for i in Res:
                    file = (str(i[0]), str(i[1]), str(i[2]))
                    Total = Total + i[1] * i[2]
                    BD_Conect.AltaLista(self.TreeSFM, self.ListSFM, file)
                self.EB_S_CosteTotal.set_text(str(Total) + "€")
            else:
                a = 1
        else:
            placeholder = 1
Ejemplo n.º 11
0
 def FCliSearch(self, widget, data=None):
     ResCli = BD_Conect.SearchCli(self.EB_F_ClientSearcher.get_text())
     self.ListF_Cliente.clear()
     for i in ResCli:
         fila = (i[0], i[1], i[2], i[3], i[4], i[5])
         BD_Conect.AltaLista(self.TreeF_Cliente, self.ListF_Cliente, fila)
Ejemplo n.º 12
0
 def ServiceSearch(self, widget, data=None):
     self.ListServicios.clear()
     Res = BD_Conect.SearchService(self.EB_S_Searcher.get_text())
     for i in Res:
         fila = (i[1], str(i[2]), i[0])
         BD_Conect.AltaLista(self.TreeServicios, self.ListServicios, fila)
Ejemplo n.º 13
0
 def LoadMesas(self):
     ### Limpiamos la lista actual del treeview
     self.ListMesas.clear()
     ### Obtenemos una lista de todas las mesas y su estado.
     Res = BD_Conect.Load(0)
     ### Para cada mesa comprobamos si está ocupada, en ese caso el botón cambio de imagen y se bloquea
     ### Si no está ocupada el botón se desbloquea y la imágen vuelve a la de disponible
     for i in Res:
         fila = (i[0], i[1], i[2])
         if fila[0] == 1:
             if fila[2] == 'Si':
                 self.IMG_Mesa1.set_from_file("../IMG/Mesa4_NO.jpg")
                 self.BT_Mesa1.set_sensitive(False)
             else:
                 self.IMG_Mesa1.set_from_file("../IMG/Mesa4_SI.jpg")
                 self.BT_Mesa1.set_sensitive(True)
         elif fila[0] == 2:
             if fila[2] == 'Si':
                 self.IMG_Mesa2.set_from_file("../IMG/Mesa4_NO.jpg")
                 self.BT_Mesa2.set_sensitive(False)
             else:
                 self.IMG_Mesa2.set_from_file("../IMG/Mesa4_SI.jpg")
                 self.BT_Mesa2.set_sensitive(True)
         elif fila[0] == 3:
             if fila[2] == 'Si':
                 self.IMG_Mesa3.set_from_file("../IMG/Mesa4_NO.jpg")
                 self.BT_Mesa3.set_sensitive(False)
             else:
                 self.IMG_Mesa3.set_from_file("../IMG/Mesa4_SI.jpg")
                 self.BT_Mesa3.set_sensitive(True)
         elif fila[0] == 4:
             if fila[2] == 'Si':
                 self.IMG_Mesa4.set_from_file("../IMG/Mesa4_NO.jpg")
                 self.BT_Mesa4.set_sensitive(False)
             else:
                 self.IMG_Mesa4.set_from_file("../IMG/Mesa4_SI.jpg")
                 self.BT_Mesa4.set_sensitive(True)
         elif fila[0] == 5:
             if fila[2] == 'Si':
                 self.IMG_Mesa5.set_from_file("../IMG/Mesa6_NO.jpg")
                 self.BT_Mesa5.set_sensitive(False)
             else:
                 self.IMG_Mesa5.set_from_file("../IMG/Mesa6_SI.jpg")
                 self.BT_Mesa5.set_sensitive(True)
         elif fila[0] == 6:
             if fila[2] == 'Si':
                 self.IMG_Mesa6.set_from_file("../IMG/Mesa6_NO.jpg")
                 self.BT_Mesa6.set_sensitive(False)
             else:
                 self.IMG_Mesa6.set_from_file("../IMG/Mesa6_SI.jpg")
                 self.BT_Mesa6.set_sensitive(True)
         elif fila[0] == 7:
             if fila[2] == 'Si':
                 self.IMG_Mesa7.set_from_file("../IMG/Mesa8_NO.jpg")
                 self.BT_Mesa7.set_sensitive(False)
             else:
                 self.IMG_Mesa7.set_from_file("../IMG/Mesa8_SI.jpg")
                 self.BT_Mesa7.set_sensitive(True)
         elif fila[0] == 8:
             if fila[2] == 'Si':
                 self.IMG_Mesa8.set_from_file("../IMG/Mesa8_NO.jpg")
                 self.BT_Mesa8.set_sensitive(False)
             else:
                 self.IMG_Mesa8.set_from_file("../IMG/Mesa8_SI.jpg")
                 self.BT_Mesa8.set_sensitive(True)
     ### Obtenemos una lista sólo de las mesas ocupadas para poner en el tree view
     ResOcuped = BD_Conect.LoadOccuped()
     for i in ResOcuped:
         fila = (i[0], i[1], i[2])
         BD_Conect.AltaLista(self.TreeMesas, self.ListMesas, fila)