def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 1050,650 ), style = wx.DEFAULT_DIALOG_STYLE ) self.db = tgpos_db.tgpos_DB() #self.Maximize() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetFont( wx.Font( 11, 74, 90, 90, True, "Tahoma" ) ) self.SetForegroundColour( FGCOLOR ) self.SetBackgroundColour( BGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) ContenedorP = wx.BoxSizer( wx.VERTICAL ) header = self.ResourcePath('controlp.png') self.m_bitmap2 = wx.StaticBitmap( self, wx.ID_ANY, wx.Bitmap( header, wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, 0 ) ContenedorP.Add( self.m_bitmap2, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) self.Notebook = wx.aui.AuiNotebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 ) #self.Notebook = wx.Listbook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT ) self.pageNT = store_name.StoreNameConfig(self) self.PageUA = user_add.UserAddDlg(self) self.PageUD = user_delete.EliminarUsuarioClass(self) self.PageUM = user_modify.UserModClass(self) self.PageAP = dlg_Apa.ConfigApa(self) self.PageSD = store_details.StoreDetailConfig(self) self.PageAB = dlg_about.AboutDlg(self) self.PageAU = abouta3.AboutAuthor(self) self.PageOT = dlg_otros.Otros_dlg(self) self.PagePR = prefs.Prefs(self) self.Notebook.AddPage(self.pageNT, "Nombre") self.Notebook.AddPage(self.PageSD, "Detalles") self.Notebook.AddPage(self.PageAP, "Apariencia") self.Notebook.AddPage(self.PageUA, "Agregar Usuario") self.Notebook.AddPage(self.PageUM, "Modificar Usuario") self.Notebook.AddPage(self.PageUD, "Eliminar Usuario") self.Notebook.AddPage(self.PageOT, "Otras Configuraciones") self.Notebook.AddPage(self.PagePR, "Moneda") self.Notebook.AddPage(self.PageAB, "Acerca De") self.Notebook.AddPage(self.PageAU, "Autor") ContenedorP.Add( self.Notebook, 1, wx.ALL|wx.EXPAND, 5 ) self.SetSizer( ContenedorP ) self.Layout() self.Centre( wx.BOTH )
def __init__(self, parent, *args, **kwargs): super(Calendar, self).__init__(parent, *args, **kwargs) #importar base de datos self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] font_1 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.Size = (300, 300) sizer = wx.BoxSizer(wx.VERTICAL) #------------------------------------------------------------------ calend = cal.CalendarCtrl(self, -1, wx.DateTime_Now(), style=cal.CAL_SEQUENTIAL_MONTH_SELECTION) sizer.Add(calend, 0, wx.EXPAND|wx.ALL, 10) #------------------------------------------------------------------ hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.date = wx.StaticText(self, -1, 'Selecciona la fecha') self.date.SetFont(font_1) hbox1.Add(self.date, 1) sizer.Add(hbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 2) #------------------------------------------------------------------ hbox2 = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer.Add(hbox2, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) sizer.Add((-1, 10)) #------------------------------------------------------------------ self.SetSizer(sizer) # Dialog Bindings #------------------------------------------------------------------ self.Bind(cal.EVT_CALENDAR, self.OnDateSelected) #------------------------------------------------------------------ self.Language()
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.TAB_TRAVERSAL ) self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) global usuarios usuarios = self.db.AllUsers() global user_choiceChoices global adminscount adminscount = 0 user_choiceChoices = [] for usuario in usuarios: nivel = " [Desconocido]" if usuario[4] =="0": nivel = " [Usuario]" elif usuario[4] =="1": nivel = " [Administrador]" adminscount = adminscount+1 item = "["+str(usuario[0])+"] "+self.normal(usuario[1])+nivel print item #print item[2] #print item[4:] user_choiceChoices.append(item) if adminscount == 1: global nodeleteadmin nodeleteadmin = True else: nodeleteadmin = False self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer3 = wx.BoxSizer( wx.VERTICAL ) #user_choiceChoices = [ u"User1", u"USer 2" ] self.user_choice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 415,-1 ), user_choiceChoices, 0 ) self.user_choice.SetSelection( 0 ) self.user_choice.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.user_choice.SetBackgroundColour( BGCOLOR ) self.user_choice.SetForegroundColour( FGCOLOR ) bSizer3.Add( self.user_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer2 = wx.GridSizer( 0, 2, 0, 0 ) self.eliminar_button = wx.Button( self, wx.ID_ANY, u"Eliminar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.eliminar_button.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.eliminar_button.SetBackgroundColour( BUTTONBG ) self.eliminar_button.SetForegroundColour( BUTTONFG ) gSizer2.Add( self.eliminar_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer3.Add( gSizer2, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer3 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.eliminar_button.Bind( wx.EVT_BUTTON, self.eliminarUsuario )
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.TAB_TRAVERSAL ) self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) global usuarios usuarios = self.db.AllUsers() global user_choiceChoices user_choiceChoices = [] global adminscount adminscount = 0 for usuario in usuarios: nivel = " [Desconocido]" if usuario[4] =="0": nivel = " [Usuario]" elif usuario[4] =="1": nivel = " [Administrador]" adminscount = adminscount+1 item = "["+str(usuario[0])+"] "+self.normal(usuario[1])+nivel #print item[2] #print item[4:] user_choiceChoices.append(item) if adminscount == 1: global nodeleteadmin nodeleteadmin = True else: nodeleteadmin = False self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 400,-1 ), user_choiceChoices, 0 ) self.m_choice1.SetSelection( -1 ) self.m_choice1.SetBackgroundColour( INPUTBG ) self.m_choice1.SetForegroundColour( INPUTFG ) self.m_choice1.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) bSizer1.Add( self.m_choice1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Nombre:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) self.name_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), 0 ) bSizer1.Add( self.name_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.name_textCtrl.SetForegroundColour( INPUTFG ) self.name_textCtrl.SetBackgroundColour( INPUTBG ) self.name_textCtrl.Enable( False ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Nombrede usuario:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.username_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), 0 ) bSizer1.Add( self.username_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.username_textCtrl.SetForegroundColour( INPUTFG ) self.username_textCtrl.SetBackgroundColour( INPUTBG ) self.username_textCtrl.Enable( False ) self.password_staticText = wx.StaticText( self, wx.ID_ANY, u"Contraseña:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.password_staticText.Wrap( -1 ) bSizer1.Add( self.password_staticText, 0, wx.ALL, 5 ) self.password_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), wx.TE_PASSWORD ) self.password_textCtrl.SetForegroundColour( INPUTFG ) self.password_textCtrl.SetBackgroundColour( INPUTBG ) self.password_textCtrl.Enable( False ) bSizer1.Add( self.password_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) level_choiceChoices = [ u"Usuario", u"Administrador" ] self.level_choice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, level_choiceChoices, 0 ) self.level_choice.SetSelection( 0 ) self.level_choice.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.level_choice.SetForegroundColour( INPUTFG ) self.level_choice.SetBackgroundColour( INPUTBG ) self.level_choice.Enable( False ) bSizer1.Add( self.level_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer1 = wx.GridSizer( 0, 2, 0, 0 ) self.ok_button = wx.Button( self, wx.ID_ANY, u"Modificar", wx.DefaultPosition, wx.Size( 150,-1 ), 0 ) self.ok_button.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.ok_button.SetForegroundColour( BUTTONFG ) self.ok_button.SetBackgroundColour( BUTTONBG ) self.ok_button.Enable( False ) gSizer1.Add( self.ok_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.cancel_button = wx.Button( self, wx.ID_ANY, u"Cancelar", wx.DefaultPosition, wx.Size( 150,-1 ), 0 ) self.cancel_button.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.cancel_button.SetForegroundColour( BUTTONFG ) self.cancel_button.SetBackgroundColour( BUTTONBG ) gSizer1.Add( self.cancel_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer1.Add( gSizer1, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.m_choice1.Bind( wx.EVT_CHOICE, self.rellenarCampos ) self.ok_button.Bind( wx.EVT_BUTTON, self.ok ) self.cancel_button.Bind( wx.EVT_BUTTON, self.cancelar )
def __init__(self, parent, usuario, *args, **kwargs): super(Inventory_Panel, self).__init__(parent, *args, **kwargs) # Set the fonts for the panel #------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) font_3 = wx.Font(15, wx.SWISS, wx.NORMAL, wx.NORMAL) font_4 = wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD) #------------------------------------------------------------------ # Creates the panel objects #------------------------------------------------------------------ self.db = tgpos_db.tgpos_DB() self.config = config.Configuration() self.c_symbol = self.config.cCurrency()[0] self.c_dec = self.config.cCurrency()[1] #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] #self.SetBackgroundColour(wx.WHITE) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) # EndSizer will be the parent of vsizer1 and vsizer2 #------------------------------------------------------------------ endSizer = wx.BoxSizer(wx.HORIZONTAL) #------------------------------------------------------------------ # vsizer1 will be the parent of the left wx.Boxsizers #------------------------------------------------------------------ vsizer1 = wx.BoxSizer(wx.VERTICAL) #------------------------------------------------------------------ lbox1 = wx.BoxSizer(wx.HORIZONTAL) self.title = wx.StaticText(self, -1, 'Administrar inventario') self.title.SetFont(font_1) lbox1.Add(self.title, 0) vsizer1.Add(lbox1, 0, wx.ALIGN_LEFT|wx.EXPAND|wx.ALL, 5) #------------------------------------------------------------------ lbox2 = wx.BoxSizer(wx.HORIZONTAL) self.search_label = wx.StaticText(self, -1, 'Buscar'+': ') self.search_label.SetFont(font_2) self.search_bar = wx.SearchCtrl(self, -1) self.search_bar.ShowSearchButton(False) self.search_bar.ShowCancelButton(True) lbox2.Add(self.search_label, 0, wx.RIGHT|wx.TOP, 5) lbox2.Add(self.search_bar, 1) vsizer1.Add(lbox2, 0, wx.EXPAND|wx.RIGHT|wx.LEFT, 5) vsizer1.Add((-1, 2)) #------------------------------------------------------------------ lbox3 = wx.BoxSizer(wx.HORIZONTAL) self.product_lc = ProductLC(self, -1, style=wx.LC_REPORT|\ wx.LC_VRULES|wx.BORDER_DEFAULT) self.product_lc.SetBackgroundColour( INPUTBG ) self.product_lc.SetForegroundColour( INPUTFG ) lbox3.Add(self.product_lc, 1, wx.EXPAND) vsizer1.Add(lbox3, 1, wx.EXPAND|wx.ALL, 5) endSizer.Add(vsizer1, 4, wx.EXPAND|wx.RIGHT, 5) #------------------------------------------------------------------ # vsizer2 will be the parent of the right wx.Boxsizers #------------------------------------------------------------------ vsizer2 = wx.BoxSizer(wx.VERTICAL) vsizer2.Add((-1, 35)) #------------------------------------------------------------------ self.details_box = wx.StaticBox(self, -1, 'Detalles del producto') rbox1 = wx.StaticBoxSizer(self.details_box, wx.VERTICAL) #--# dbox1 = wx.BoxSizer(wx.HORIZONTAL) self.id_label = wx.StaticText(self, -1, 'Codigo', size=(180, -1)) self.id_label.SetFont(font_2) self.id_number = wx.TextCtrl(self, -1, size = (200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.id_number.SetBackgroundColour( INPUTBG ) self.id_number.SetForegroundColour( INPUTFG ) self.id_number.SetFont(font_4) dbox1.Add(self.id_label, 0, wx.RIGHT|wx.TOP, 7) dbox1.Add(self.id_number, 1) rbox1.Add(dbox1, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 10) #--# dbox2 = wx.BoxSizer(wx.HORIZONTAL) self.item_label = wx.StaticText(self, -1, 'Producto', size=(180, -1)) self.item_label.SetFont(font_2) self.item = wx.TextCtrl(self, -1, size = (200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.item.SetBackgroundColour( INPUTBG ) self.item.SetForegroundColour( INPUTFG ) self.item.SetFont(font_4) dbox2.Add(self.item_label, 0, wx.RIGHT|wx.TOP, 7) dbox2.Add(self.item, 1) rbox1.Add(dbox2, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 10) #--# dbox3 = wx.BoxSizer(wx.HORIZONTAL) self.price_label = wx.StaticText(self, -1, 'Precio', size=(180, -1)) self.price_label.SetFont(font_2) self.price = wx.TextCtrl(self, -1, size = (200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.price.SetBackgroundColour( INPUTBG) self.price.SetForegroundColour( INPUTFG ) self.price.SetFont(font_4) dbox3.Add(self.price_label, 0, wx.RIGHT|wx.TOP, 7) dbox3.Add(self.price, 1) rbox1.Add(dbox3, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 10) #--# dbox4 = wx.BoxSizer(wx.HORIZONTAL) self.stock_label = wx.StaticText(self, -1, 'Inventario', size=(180, -1)) self.stock_label.SetFont(font_2) self.stock = wx.TextCtrl(self, -1, size = (200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.stock.SetBackgroundColour( INPUTBG ) self.stock.SetForegroundColour( INPUTFG ) self.stock.SetFont(font_4) dbox4.Add(self.stock_label, 0, wx.RIGHT|wx.TOP, 7) dbox4.Add(self.stock, 1) rbox1.Add(dbox4, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 10) #--# dbox5 = wx.BoxSizer(wx.HORIZONTAL) self.listadoPrecios = wx.ListCtrl(self, -1, style=wx.LC_REPORT) self.listadoPrecios.InsertColumn(0, 'Descipción') self.listadoPrecios.InsertColumn(1, 'Cantidad') self.listadoPrecios.InsertColumn(2, 'Precio') self.listadoPrecios.SetColumnWidth(0, 200) self.listadoPrecios.SetColumnWidth(1, 60) self.listadoPrecios.SetColumnWidth(2, 60) self.listadoPrecios.SetBackgroundColour( INPUTBG) self.listadoPrecios.SetForegroundColour( INPUTFG) self.listadoPrecios.SetMinSize( wx.Size( 320, 90 ) ) self.listadoPrecios.SetMaxSize( wx.Size( 320,-1 ) ) dbox5.Add(self.listadoPrecios, 1) rbox1.Add(dbox5, 0, wx.ALL|wx.ALIGN_RIGHT, 5) rbox1.Add((-1, 10)) vsizer2.Add(rbox1, 0, wx.EXPAND|wx.ALL, 5) #------------------------------------------------------------------ self.options_box = wx.StaticBox(self, -1, 'Opciones del inventario') rbox2 = wx.StaticBoxSizer(self.options_box, wx.VERTICAL) #--# obox1 = wx.BoxSizer(wx.HORIZONTAL) self.add_product_btn = wx.Button(self, -1, 'Agregar Producto') self.add_product_btn.SetFont(font_2) self.add_product_btn.SetBackgroundColour(BUTTONBG ) self.add_product_btn.SetForegroundColour( BUTTONFG ) obox1.Add(self.add_product_btn, 1, wx.LEFT|wx.RIGHT, 20) rbox2.Add(obox1, 0, wx.EXPAND|wx.TOP, 20) #--# obox3 = wx.BoxSizer(wx.HORIZONTAL) self.stock_product_btn = wx.Button(self, -1, 'Agregar Elementos') self.stock_product_btn.SetFont(font_2) self.stock_product_btn.SetBackgroundColour(BUTTONBG ) self.stock_product_btn.SetForegroundColour(BUTTONFG ) obox3.Add(self.stock_product_btn, 1, wx.LEFT|wx.RIGHT, 20) rbox2.Add(obox3, 0, wx.EXPAND|wx.TOP, 20) #--# obox2 = wx.BoxSizer(wx.HORIZONTAL) self.edit_product_btn = wx.Button(self, -1, 'modificar producto') self.edit_product_btn.SetFont(font_2) self.edit_product_btn.SetBackgroundColour( BUTTONBG ) self.edit_product_btn.SetForegroundColour( BUTTONFG ) obox2.Add(self.edit_product_btn, 1, wx.LEFT|wx.RIGHT, 20) rbox2.Add(obox2, 0, wx.EXPAND|wx.TOP, 20) #rbox2.Add((-1, 20)) #--# obox2 = wx.BoxSizer(wx.HORIZONTAL) self.delete_product_btn = wx.Button(self, -1, 'Eliminar Prodcuto') self.delete_product_btn.SetFont(font_2) self.delete_product_btn.SetBackgroundColour( BUTTONBG ) self.delete_product_btn.SetForegroundColour( BUTTONFG ) obox2.Add(self.delete_product_btn, 1, wx.LEFT|wx.RIGHT, 20) rbox2.Add(obox2, 0, wx.EXPAND|wx.TOP, 20) self.XLSInv_bpButton = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( self.IconPath("inventiario2.png"), wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.Size( 100,150 ), 0|wx.NO_BORDER|wx.TRANSPARENT_WINDOW ) self.XLSInv_bpButton.SetToolTipString( u"Exportar Inventario" ) self.XLSInv_bpButton.SetMinSize( wx.Size( 100,150 ) ) self.XLSInv_bpButton.SetMaxSize( wx.Size( 100,150 ) ) self.XLSInv_bpButton.SetBackgroundColour( BGCOLOR ) rbox2.Add(self.XLSInv_bpButton, 0, wx.EXPAND|wx.TOP, 20) rbox2.Add((-1, 20)) vsizer2.Add(rbox2, 1, wx.EXPAND, 5 ) #------------------------------------------------------------------ endSizer.Add(vsizer2, 3, wx.EXPAND) self.SetSizer(endSizer) #------------------------------------------------------------------ # Bindings #------------------------------------------------------------------ self.Bind(wx.EVT_BUTTON, self.OnAdd, self.add_product_btn) self.Bind(wx.EVT_BUTTON, self.OnAddStok, self.stock_product_btn) self.Bind(wx.EVT_BUTTON, self.OnEdit, self.edit_product_btn) self.Bind(wx.EVT_BUTTON, self.OnDeleteP, self.delete_product_btn) self.XLSInv_bpButton.Bind(wx.EVT_BUTTON, self.ExportINV) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect, self.product_lc) self.search_bar.Bind(wx.EVT_TEXT, self.OnSearch) self.search_bar.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnSearchCancel) #self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.PListRefresh() self.Language() self.stock_product_btn.Disable() self.edit_product_btn.Disable() self.delete_product_btn.Disable()
def __init__(self, parent, *args, **kwargs): super(POS_AddItem, self).__init__(parent, *args, **kwargs) #importar Manejador de base de datos self.db = tgpos_db.tgpos_DB() accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, kESCAPE)] ) self.SetAcceleratorTable(accel_tbl) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] # Set styles for the dialog #------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(14, wx.SWISS, wx.NORMAL, wx.BOLD) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.Size = (400, 230) # Get necessary configuration information #------------------------------------------------------------------ self.config = config.Configuration() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] # Set up the box sizer #------------------------------------------------------------------ sizer = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) #--# self.pos_add_title = wx.StaticText(self, -1, 'Agregar elemento a la venta') self.pos_add_title.SetFont(font_1) hbox1.Add(self.pos_add_title, 0) sizer.Add(hbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.TOP, 5) hbox2 = wx.BoxSizer(wx.HORIZONTAL) #--# self.item_label = wx.TextCtrl(self, -1, '', style=wx.TE_READONLY|wx.TE_CENTER) self.item_label.SetFont(font_2) self.item_label.SetBackgroundColour(INPUTBG) self.item_label.SetForegroundColour(INPUTFG) hbox2.Add(self.item_label, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) sizer.Add((-1, 10)) hbox3 = wx.BoxSizer(wx.HORIZONTAL) #--# self.qt_label = wx.StaticText(self, -1, 'Quantity', size=(80, -1)) self.qt_input = wx.TextCtrl(self, -1, '', style=wx.TE_CENTER) self.qt_input.SetBackgroundColour(INPUTBG) self.qt_input.SetForegroundColour(INPUTFG) self.pr_label = wx.StaticText(self, -1, 'Price'+' ('+self.c_symbol+')', size=(80, -1)) self.pr_input = wx.TextCtrl(self, -1, '', style=wx.TE_CENTER) hbox3.Add(self.qt_label, 0, wx.TOP|wx.RIGHT, 5) self.pr_input.SetBackgroundColour(INPUTBG) self.pr_input.SetForegroundColour(INPUTFG) hbox3.Add(self.qt_input, 1, wx.RIGHT, 20) hbox3.Add(self.pr_label, 0, wx.TOP|wx.RIGHT, 5) hbox3.Add(self.pr_input, 1) sizer.Add(hbox3, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 5) #--# hbox4 = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer.Add(hbox4, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) sizer.Add((-1, 10)) self.SetSizer(sizer) #------------------------------------------------------------------ self.pr_input.Bind(wx.EVT_KEY_UP, self.PriceValidate) self.qt_input.Bind(wx.EVT_KEY_UP, self.QtValidate) self.pr_input.Bind(wx.EVT_KILL_FOCUS, self.PrClean) self.qt_input.Bind(wx.EVT_KILL_FOCUS, self.QtClean) self.Bind(wx.EVT_MENU, self.Close, id=kESCAPE) #------------------------------------------------------------------ self.Language()
def __init__(self, parent, *args, **kwargs): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.TAB_TRAVERSAL ) font1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font2 = wx.Font(15, wx.SWISS, wx.NORMAL, wx.NORMAL) # Box Sizer #------------------------------------------------------------------ sizer = wx.BoxSizer(wx.VERTICAL) #importar base de datos self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] # Title self.title = wx.StaticText(self, -1, 'Acerca De MiniPOS') self.title.SetFont(font1) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) sizer.Add(self.title, 0, wx.LEFT|wx.TOP, 10) #sizer.Add(self.subtitle, 0, wx.LEFT|wx.TOP, 10) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 10) # Credits cred_txt = u'Autor: Andrés Alonzo y Alonzo, 2012' self.cred = wx.StaticText(self, -1, cred_txt) self.cred.SetFont(font2) sizer.Add(self.cred, 0, wx.ALIGN_CENTER|wx.ALL, 20) # Contact contact = '*****@*****.**' self.contact = wx.StaticText(self, -1, contact) sizer.Add(self.contact, 0, wx.ALIGN_CENTER|wx.BOTTOM, 20) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 10) # Summary and legal text = self.GetAboutTxt() self.about_txt = wx.TextCtrl(self, -1, style=wx.TE_READONLY|wx.TE_MULTILINE) try: self.about_txt.SetValue(text) except: self.about_txt.SetValue("Error!!! (utf8-0x0001)") self.about_txt.SetBackgroundColour( BGCOLOR ) self.about_txt.SetForegroundColour( FGCOLOR ) self.about_txt.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) sizer.Add(self.about_txt, 1, wx.EXPAND|wx.ALL, 10) # Set Sizer self.SetSizer(sizer) #------------------------------------------------------------------ self.LangConfig()
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Activación de MiniPOS", pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.CAPTION|wx.CLOSE_BOX|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetFont( wx.Font( 13, 74, 90, 90, True, "" ) ) self.SetForegroundColour( FGCOLOR ) self.SetBackgroundColour( BGCOLOR ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.title_txt = wx.StaticText( self, wx.ID_ANY, u"Activación de MiniPOS", wx.DefaultPosition, wx.DefaultSize, 0 ) self.title_txt.Wrap( -1 ) self.title_txt.SetFont( wx.Font( 13, 74, 90, 90, False, "courier" ) ) bSizer1.Add( self.title_txt, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.codigo_txt = wx.StaticText( self, wx.ID_ANY, u"Codigo de Maquina:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.codigo_txt.Wrap( -1 ) bSizer1.Add( self.codigo_txt, 0, wx.ALL, 5 ) self.codigo = wx.TextCtrl( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_READONLY ) bSizer1.Add( self.codigo, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.serial_txt = wx.StaticText( self, wx.ID_ANY, u"Clave de Activación:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.serial_txt.Wrap( -1 ) bSizer1.Add( self.serial_txt, 0, wx.ALL, 5 ) self.serial = wx.TextCtrl( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE|wx.TE_PROCESS_ENTER ) bSizer1.Add( self.serial, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) C_Botones = wx.GridSizer( 0, 2, 0, 0 ) self.activar_B = wx.Button( self, wx.ID_ANY, u"Activar", wx.DefaultPosition, wx.DefaultSize, 0 ) C_Botones.Add( self.activar_B, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.activar_B.SetBackgroundColour( BUTTONBG ) self.activar_B.SetForegroundColour( BUTTONFG ) self.cancelar_B = wx.Button( self, wx.ID_ANY, u"Cancelar", wx.DefaultPosition, wx.DefaultSize, 0 ) C_Botones.Add( self.cancelar_B, 0, wx.ALL, 5 ) self.cancelar_B.SetBackgroundColour( BUTTONBG) self.cancelar_B.SetForegroundColour( BUTTONFG ) bSizer1.Add( C_Botones, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.serial.Bind( wx.EVT_TEXT_ENTER, self.activar ) self.activar_B.Bind( wx.EVT_BUTTON, self.activar ) self.cancelar_B.Bind( wx.EVT_BUTTON, self.cancelar ) self.SetTransparent(200)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Información", pos = wx.DefaultPosition, size = wx.Size( 490,380 ), style = wx.DEFAULT_DIALOG_STYLE ) # Get necessary configuration information #------------------------------------------------------------------ self.db = tgpos_db.tgpos_DB() self.config = config.Configuration() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.defC = " " self.SetBackgroundColour(BGCOLOR) self.SetForegroundColour(FGCOLOR) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) PrincipalContainer = wx.BoxSizer( wx.VERTICAL ) self.title_label = wx.StaticText( self, wx.ID_ANY, u"INFORMACIÓN", wx.DefaultPosition, wx.DefaultSize, 0 ) self.title_label.Wrap( -1 ) self.title_label.SetFont( wx.Font( 14, 74, 90, 90, False, "Sans" ) ) PrincipalContainer.Add( self.title_label, 0, wx.ALL, 5 ) self.BarCode = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,20 ), wx.TE_PROCESS_ENTER ) self.BarCode.SetFont( wx.Font( 6, 74, 90, 90, False, "Sans" ) ) self.BarCode.SetBackgroundColour(INPUTBG) self.BarCode.SetForegroundColour(INPUTFG) PrincipalContainer.Add( self.BarCode, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) PrincipalContainer.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) nombreCont = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Nombre" ), wx.VERTICAL ) self.Nombre = wx.StaticText( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.Size( 475,-1 ), 0 ) self.Nombre.Wrap( -1 ) self.Nombre.SetFont( wx.Font( 12, 74, 90, 90, False, "Sans" ) ) nombreCont.Add( self.Nombre, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) PrincipalContainer.Add( nombreCont, 1, wx.EXPAND, 5 ) PrecioCont = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Precio" ), wx.VERTICAL ) self.Precio = wx.StaticText( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.Size( -1,-1 ), 0 ) self.Precio.Wrap( -1 ) self.Precio.SetFont( wx.Font( 15, 74, 90, 92, False, "Sans" ) ) PrecioCont.Add( self.Precio, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) PrincipalContainer.Add( PrecioCont, 1, wx.EXPAND, 5 ) StockCont = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Stock" ), wx.VERTICAL ) self.Stock = wx.StaticText( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.Size( -1,-1 ), 0 ) self.Stock.Wrap( -1 ) self.Stock.SetFont( wx.Font( 15, 74, 90, 90, False, "Sans" ) ) StockCont.Add( self.Stock, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) PrincipalContainer.Add( StockCont, 1, wx.EXPAND, 5 ) self.SetSizer( PrincipalContainer ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.Bind( wx.EVT_ACTIVATE, self.Load ) self.Bind( wx.EVT_INIT_DIALOG, self.Load ) self.BarCode.Bind( wx.EVT_TEXT_ENTER, self.SetValues )
def __init__( self, parent ): self.db = tgpos_db.tgpos_DB() wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Administracion de usuarios", pos = wx.DefaultPosition, size = wx.Size( 683,468 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) #Marco Principal main_users = wx.BoxSizer( wx.VERTICAL ) self.m_auinotebook8 = wx.aui.AuiNotebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.aui.AUI_NB_DEFAULT_STYLE ) self.Usuarios_page = wx.Panel( self.m_auinotebook8, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) UsuariosSizer = wx.BoxSizer( wx.VERTICAL ) global usuarios usuarios = self.db.AllUsers() global user_choiceChoices user_choiceChoices = [] for usuario in usuarios: item = "["+str(usuario[0])+"] "+usuario[1] #print item[2] #print item[4:] user_choiceChoices.append(item) #user_choiceChoices = [ u"User 1", u"User 2", u"User 3", u"User 4", u"User 5" ] self.user_choice = wx.Choice( self.Usuarios_page, wx.ID_ANY, wx.DefaultPosition, wx.Size( 600,-1 ), user_choiceChoices, 0 ) self.user_choice.SetSelection( 4 ) self.user_choice.SetFont( wx.Font( 18, 74, 90, 90, False, "Times New Roman" ) ) UsuariosSizer.Add( self.user_choice, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) Usuarios_botones_sizer = wx.GridSizer( 0, 2, 0, 0 ) self.modificar_button = wx.Button( self.Usuarios_page, wx.ID_ANY, u"Modificar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.modificar_button.SetFont( wx.Font( 18, 74, 90, 90, False, "Times New Roman" ) ) Usuarios_botones_sizer.Add( self.modificar_button, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5 ) self.eliminar_button = wx.Button( self.Usuarios_page, wx.ID_ANY, u"Eliminar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.eliminar_button.SetFont( wx.Font( 18, 74, 90, 90, False, "Times New Roman" ) ) Usuarios_botones_sizer.Add( self.eliminar_button, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) UsuariosSizer.Add( Usuarios_botones_sizer, 1, wx.EXPAND, 5 ) self.Usuarios_page.SetSizer( UsuariosSizer ) self.Usuarios_page.Layout() UsuariosSizer.Fit( self.Usuarios_page ) self.m_auinotebook8.AddPage( self.Usuarios_page, u"Usuarios", True, wx.NullBitmap ) self.Anadir_usuarios_page = wx.Panel( self.m_auinotebook8, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) Anadir_usuario_sizer = wx.BoxSizer( wx.VERTICAL ) self.name_label = wx.StaticText( self.Anadir_usuarios_page, wx.ID_ANY, u"Nombre Completo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.name_label.Wrap( -1 ) self.name_label.SetFont( wx.Font( 16, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.name_label, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.name_input = wx.TextCtrl( self.Anadir_usuarios_page, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 250,30 ), 0 ) self.name_input.SetMinSize( wx.Size( 400,30 ) ) self.name_input.SetFont( wx.Font( 16, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.name_input, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.username_label = wx.StaticText( self.Anadir_usuarios_page, wx.ID_ANY, u"Username", wx.DefaultPosition, wx.DefaultSize, 0 ) self.username_label.Wrap( -1 ) self.username_label.SetFont( wx.Font( 16, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.username_label, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.username_input = wx.TextCtrl( self.Anadir_usuarios_page, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 250,30 ), 0 ) self.username_input.SetMinSize( wx.Size( 250,30 ) ) self.username_input.SetFont( wx.Font( 16, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.username_input, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.password_label = wx.StaticText( self.Anadir_usuarios_page, wx.ID_ANY, u"Password", wx.DefaultPosition, wx.DefaultSize, 0 ) self.password_label.Wrap( -1 ) self.password_label.SetFont( wx.Font( 16, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.password_label, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.password_input = wx.TextCtrl( self.Anadir_usuarios_page, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 250,30 ), 0 ) self.password_input.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BACKGROUND ) ) self.password_input.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BACKGROUND ) ) self.password_input.SetFont( wx.Font( 9, 74, 90, 90, False, "Tahoma" ) ) Anadir_usuario_sizer.Add( self.password_input, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) level_choiceChoices = [ u"Usuario Estandar", u"Administrador" ] self.level_choice = wx.Choice( self.Anadir_usuarios_page, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, level_choiceChoices, 0 ) self.level_choice.SetSelection( 0 ) self.level_choice.SetFont( wx.Font( 16, 74, 90, 90, False, "Terminal" ) ) Anadir_usuario_sizer.Add( self.level_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.anadir_button = wx.Button( self.Anadir_usuarios_page, wx.ID_ANY, u"Agregar Usuario", wx.DefaultPosition, wx.DefaultSize, 0 ) self.anadir_button.SetFont( wx.Font( 14, 74, 90, 90, False, "Times New Roman" ) ) Anadir_usuario_sizer.Add( self.anadir_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.Anadir_usuarios_page.SetSizer( Anadir_usuario_sizer ) self.Anadir_usuarios_page.Layout() Anadir_usuario_sizer.Fit( self.Anadir_usuarios_page ) self.m_auinotebook8.AddPage( self.Anadir_usuarios_page, u"Añadir Usuario", False, wx.NullBitmap ) main_users.Add( self.m_auinotebook8, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( main_users ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.modificar_button.Bind( wx.EVT_BUTTON, self.modficar ) self.eliminar_button.Bind( wx.EVT_BUTTON, self.eliminar ) self.anadir_button.Bind( wx.EVT_BUTTON, self.agregar )
def __init__(self, parent, usuari0, *args, **kwargs): super(MainFrame, self).__init__(parent, *args, **kwargs) global BGCOLOR, FGCOLOR, BUTTONFG, BUTTONBG, INPUTBG,INPUTFG,TRANSPARENCY global usuario usuario = usuari0 self.Full = False # Objetos complementarios #------------------------------------------------------------------ self.db = tgpos_db.tgpos_DB() self.config = config.Configuration() # Setear icono del frame #------------------------------------------------------------------ path = self.ResourcePath('icon.png') icon = wx.Icon(path, type=wx.BITMAP_TYPE_PNG) self.SetIcon(icon) # Setear el estilo del frame #------------------------------------------------------------------ #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR) self.SetTransparent(Tema[-1]) #------------------------------------------------------------------ font_1 = wx.Font(25, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) # Menu #------------------------------------------------------------------ self.menu = Menu(usuario, -1) self.menu.SetBackgroundColour( BGCOLOR) self.menu.SetForegroundColour( FGCOLOR) self.SetMenuBar(self.menu) accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_DELETE, idKeyESCAPE),(wx.ACCEL_NORMAL, wx.WXK_F1, idKeyF1),(wx.ACCEL_NORMAL, wx.WXK_F2, idKeyF2),(wx.ACCEL_NORMAL, wx.WXK_F3, idKeyF3),(wx.ACCEL_NORMAL, wx.WXK_F4, idKeyF4),(wx.ACCEL_NORMAL, wx.WXK_F5, idKeyF5),(wx.ACCEL_NORMAL, wx.WXK_F11, idKeyF11)] ) self.SetAcceleratorTable(accel_tbl) #------------------------------------------------------------------ # Create the notebook for the application #------------------------------------------------------------------ self.notebook = wx.aui.AuiNotebook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.aui.AUI_NB_TAB_EXTERNAL_MOVE|wx.HSCROLL|wx.NO_BORDER|wx.TRANSPARENT_WINDOW|wx.VSCROLL|wx.WANTS_CHARS ) self.notebook.SetBackgroundColour( BGCOLOR) self.notebook.SetForegroundColour( FGCOLOR) # Create the notebook pages #------------------------------------------------------------------ self.pos_page = POS_Panel(self.notebook, usuario) self.sales_page = Sales_Panel(self.notebook, usuario) if usuario[4] == "1": self.inventory_page = Inventory_Panel(self.notebook,usuario) self.tab1 = 'Punto de Venta' self.tab2 = 'Registros de Ventas' self.tab3 = 'Inventario' self.Language() self.notebook.AddPage(self.pos_page, self.tab1) self.notebook.AddPage(self.sales_page, self.tab2) if usuario[4] == "1": self.notebook.AddPage(self.inventory_page, self.tab3) if usuario[4] == "0": self.sales_page.edit_receipt_btn.Disable() # Set Notebooks Bitmap imagen1 =wx.Bitmap( self.IconPath('pos.png'), wx.BITMAP_TYPE_ANY ) imagen2 =wx.Bitmap( self.IconPath('ventas.png'), wx.BITMAP_TYPE_ANY ) imagen3 =wx.Bitmap( self.IconPath('inventario.png'), wx.BITMAP_TYPE_ANY ) #self.notebook.SetPageBitmap(0,imagen1) #self.notebook.SetPageBitmap(1,imagen2) #self.notebook.SetPageBitmap(2,imagen3) # Put the notebook in a box sizer #------------------------------------------------------------------ sizer = wx.BoxSizer() sizer.Add(self.notebook, 1, wx.EXPAND | wx.ALIGN_CENTER) self.SetSizer(sizer) #self.p = Process(target=self.server) #self.p.stop = False #self.p.start() #self.p.join() #self.server() CWD = os.getcwd() base_dir = self.ResourcePath("reports/") os.chdir(base_dir) self.httpd = browser.StoppableHTTPServer(("127.0.0.1",3033), SimpleHTTPServer.SimpleHTTPRequestHandler) thread.start_new_thread(self.httpd.serve, ()) os.chdir(CWD) # Put in bindings for panel changes #----------------------------------------------------------------- self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnChange) #self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGING, self.OnChange) #eliminado para mejorar la optimizacion self.Bind(wx.EVT_BUTTON, self.OnButton) self.Bind(wx.EVT_MENU, self.OnMenu) self.Bind(wx.EVT_MENU, self.OnKeyESCAPE, id=idKeyESCAPE) self.Bind(wx.EVT_MENU, self.OnKeyF1, id=idKeyF1) self.Bind(wx.EVT_MENU, self.OnKeyF2, id=idKeyF2) self.Bind(wx.EVT_MENU, self.OnKeyF3, id=idKeyF3) self.Bind(wx.EVT_MENU, self.OnKeyF4, id=idKeyF4) self.Bind(wx.EVT_MENU, self.OnKeyF5, id=idKeyF5) self.Bind(wx.EVT_MENU, self.OnKeyF11, id=idKeyF11) self.Bind(wx.EVT_CLOSE, self.salirdelprogramaprincipal ) #self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.notebook.SetSelection(0)
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY ) #importar base de datos self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Cabimbiar los colores del programa", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) self.m_staticText1.SetFont( wx.Font( 12, 74, 90, 92, False, "Sans" ) ) bSizer1.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer4 = wx.GridSizer( 0, 3, 0, 0 ) PrincipalCaja = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Principal" ), wx.VERTICAL ) gSizer1 = wx.GridSizer( 0, 2, 0, 0 ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Fondo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) gSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.bg = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.Colour( 255, 0, 0 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer1.Add( self.bg, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Texto", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText4.Wrap( -1 ) gSizer1.Add( self.m_staticText4, 0, wx.ALL, 5 ) self.fg = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer1.Add( self.fg, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) PrincipalCaja.Add( gSizer1, 1, wx.EXPAND, 5 ) gSizer4.Add( PrincipalCaja, 1, wx.EXPAND, 5 ) BotonesCaja = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Botones" ), wx.VERTICAL ) gSizer2 = wx.GridSizer( 0, 2, 0, 0 ) self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Fondo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText5.Wrap( -1 ) gSizer2.Add( self.m_staticText5, 0, wx.ALL, 5 ) self.bg_B = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer2.Add( self.bg_B, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Texto", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText6.Wrap( -1 ) gSizer2.Add( self.m_staticText6, 0, wx.ALL, 5 ) self.fg_B = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer2.Add( self.fg_B, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) BotonesCaja.Add( gSizer2, 1, wx.EXPAND, 5 ) gSizer4.Add( BotonesCaja, 1, wx.EXPAND, 5 ) CajaTexto = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Cajas de Texto" ), wx.VERTICAL ) gSizer3 = wx.GridSizer( 0, 2, 0, 0 ) self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Fondo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText7.Wrap( -1 ) gSizer3.Add( self.m_staticText7, 0, wx.ALL, 5 ) self.bg_I = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer3.Add( self.bg_I, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Texto", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText8.Wrap( -1 ) gSizer3.Add( self.m_staticText8, 0, wx.ALL, 5 ) self.fg_I = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE ) gSizer3.Add( self.fg_I, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) CajaTexto.Add( gSizer3, 1, wx.EXPAND, 5 ) gSizer4.Add( CajaTexto, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 ) bSizer1.Add( gSizer4, 1, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText0 = wx.StaticText( self, wx.ID_ANY, u"Cambiar la Opacidad del Programa", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText0.Wrap( -1 ) self.m_staticText0.SetFont( wx.Font( 12, 74, 90, 92, False, "Sans" ) ) bSizer1.Add( self.m_staticText0, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.Transparency = wx.Slider( self, wx.ID_ANY, 50, 10, 255, wx.DefaultPosition, wx.Size( 600,35 ), wx.SL_HORIZONTAL ) bSizer1.Add( self.Transparency, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) ButtonBox = wx.GridSizer( 0, 2, 0, 0 ) self.Ok_button = wx.Button( self, wx.ID_ANY, u"Ok", wx.DefaultPosition, wx.DefaultSize, 0 ) ButtonBox.Add( self.Ok_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.Ok_button.SetBackgroundColour( BUTTONBG ) self.Ok_button.SetForegroundColour( BUTTONFG ) bSizer1.Add( ButtonBox, 1, wx.EXPAND, 0 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.Ok_button.Bind( wx.EVT_BUTTON, self.onOk ) self.onLoad()
def __init__(self, parent, user, *args, **kwargs): super(Sales_Panel, self).__init__(parent, *args, **kwargs) #Setear variables y objetos complementarios global usuario usuario = user self.db = tgpos_db.tgpos_DB() self.printR = print_recibo.Printer() self.printC = print_recibo_s.Printer() #self.imprimir = print_report.Printer() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] # Set fonts for the panel #------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) font_3 = wx.Font(15, wx.SWISS, wx.NORMAL, wx.NORMAL) font_4 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) # The endSizer will hold the left and right box sizers #------------------------------------------------------------------ endSizer = wx.BoxSizer(wx.HORIZONTAL) # Language #------------------------------------------------------------------ self.day, self.week, self.month, self.year = unicode('Día','utf8'), 'Semana', 'Mes', unicode('Año','utf8') self.d1, self.d2, self.w1, self.m1, self.t1 = 'Resumen de movimientos', 'Fecha de inicio Seleccione', 'Personalizado', unicode('Fecha de inicio no puede ser posterior a la fecha de finalización.','utf8'), unicode('Fallo en la fecha de selección','utf8') #------------------------------------------------------------------ # vsizer1 will hold the widgets for the left side #------------------------------------------------------------------ vsizer1 = wx.BoxSizer(wx.VERTICAL) #------------------------------------------------------------------ lbox1 = wx.BoxSizer(wx.HORIZONTAL) self.sales_label = wx.StaticText(self, wx.ID_EDIT, 'Registros de ventas') self.sales_label.SetFont(font_1) lbox1.Add(self.sales_label, 0) vsizer1.Add(lbox1, 0, wx.TOP|wx.LEFT, 5) #------------------------------------------------------------------ self.sales_box = wx.StaticBox(self, -1, 'Historial de ventas') lbox2 = wx.StaticBoxSizer(self.sales_box, wx.VERTICAL) #--# a_box1 = wx.BoxSizer(wx.HORIZONTAL) self.sales_lc = SalesLC(self, -1, style=wx.LC_REPORT|wx.LC_VRULES|\ wx.BORDER_DEFAULT) self.sales_lc.SetBackgroundColour( INPUTBG ) self.sales_lc.SetForegroundColour( INPUTFG ) a_box1.Add(self.sales_lc, 1, wx.EXPAND) lbox2.Add(a_box1, 1, wx.EXPAND|wx.ALL, 5) vsizer1.Add(lbox2, 4, wx.EXPAND) #--# vsizer1.Add((-1, 10)) #------------------------------------------------------------------ self.sale_items_box = wx.StaticBox(self, -1, 'Elementos de la venta') lbox3 = wx.StaticBoxSizer(self.sale_items_box, wx.VERTICAL) #--# self.receipt_lc = RecReviewLC(self, -1, style=wx.LC_REPORT|wx.LC_VRULES|\ wx.LC_HRULES|wx.BORDER_DEFAULT) self.receipt_lc.SetBackgroundColour( INPUTBG ) self.receipt_lc.SetForegroundColour( INPUTFG ) b_box = wx.BoxSizer(wx.HORIZONTAL) b_box.Add(self.receipt_lc, 1, wx.EXPAND) lbox3.Add(b_box, 1, wx.EXPAND|wx.ALL, 5) vsizer1.Add(lbox3, 5, wx.EXPAND) #------------------------------------------------------------------ lbox4 = wx.BoxSizer(wx.HORIZONTAL) self.edit_receipt_btn = wx.Button(self, ID_EDIT_RECEIPT, 'Modificar',size=(-1, 50)) self.delete_receipt_btn = wx.Button(self, -1, 'Eliminar',size=(-1, 50)) if int(usuario[4]) != 1:self.edit_receipt_btn.Disable() if int(usuario[4]) != 1:self.delete_receipt_btn.Disable() self.edit_receipt_btn.SetToolTipString( unicode("Tiempo limite de edición 5 días",'utf8') ) self.print_receipt_btn = wx.Button(self, -1, 'Comprobante',size=(-1, 50)) self.edit_receipt_btn.SetFont(font_4) self.print_receipt_btn.SetFont(font_4) self.delete_receipt_btn.SetFont(font_4) self.print_receipt_btn.SetBackgroundColour( BUTTONBG ) self.edit_receipt_btn.SetBackgroundColour( BUTTONBG ) self.delete_receipt_btn.SetBackgroundColour( BUTTONBG ) self.print_receipt_btn.SetForegroundColour( BUTTONFG ) self.edit_receipt_btn.SetForegroundColour( BUTTONFG ) self.delete_receipt_btn.SetForegroundColour( BUTTONFG ) lbox4.Add(self.edit_receipt_btn, 1, wx.RIGHT|wx.LEFT, 10) lbox4.Add(self.delete_receipt_btn, 1, wx.RIGHT|wx.LEFT, 10) lbox4.Add(self.print_receipt_btn, 1, wx.RIGHT, 10) vsizer1.Add(lbox4, 0, wx.EXPAND|wx.ALL, 5) #------------------------------------------------------------------ # vsizer2 - Holds the gadgets for the right side #------------------------------------------------------------------ vsizer2 = wx.BoxSizer(wx.VERTICAL) self.sumary_label = wx.StaticText(self, wx.ID_EDIT, 'Resumen de Ventas\n') self.sumary_label.SetFont(font_1) vsizer2.Add(self.sumary_label, 0,wx.ALL|wx.ALIGN_CENTER_HORIZONTAL) #------------------------------------------------------------------ rbox1 = wx.BoxSizer(wx.HORIZONTAL) self.sales_period_label = wx.StaticText(self, -1, 'Elija Periodo de venta '+' -') self.sales_period_label.SetFont(font_3) periods = [self.day, self.week, self.month, self.year] self.period_choice = wx.ComboBox(self, -1, choices=periods, style = wx.CB_READONLY) self.period_choice.SetForegroundColour(INPUTFG ) self.period_choice.SetBackgroundColour(INPUTBG ) rbox1.Add(self.sales_period_label, 0, wx.TOP, 5) rbox1.Add((10, -1)) rbox1.Add(self.period_choice, 0) vsizer2.Add(rbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|\ wx.TOP|wx.RIGHT|wx.LEFT, 5) #--# vsizer2.Add((-1, 10)) vsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) vsizer2.Add((-1, 10)) #------------------------------------------------------------------ #DatenSumZ = wx.GridSizer( 0, 2, 0, 0 ) DatePickZ = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Fecha de Inicio y Fin para el resumen" ), wx.VERTICAL ) rbox2FI = wx.BoxSizer(wx.HORIZONTAL) self.st_date_btn = wx.Button(self, -1, 'Inicio',size=(60, -1)) self.st_date_btn.SetFont(font_2) self.st_date = wx.TextCtrl(self, -1, '-', style=wx.TE_CENTER|wx.TE_READONLY) self.st_date.SetFont(font_2) self.st_date_btn.SetBackgroundColour( BUTTONBG ) self.st_date_btn.SetForegroundColour( BUTTONFG ) self.st_date.SetBackgroundColour( INPUTBG ) self.st_date.SetForegroundColour( INPUTFG ) rbox2FI.Add(self.st_date_btn, 0, wx.RIGHT, 5) rbox2FI.Add(self.st_date, 1, wx.RIGHT, 1) DatePickZ.Add(rbox2FI, 0, wx.EXPAND|wx.ALL, 5) rbox2FF = wx.BoxSizer(wx.HORIZONTAL) self.end_date_btn = wx.Button(self, -1, 'Final',size=(60, -1)) self.end_date_btn.SetBackgroundColour( BUTTONBG ) self.end_date_btn.SetForegroundColour( BUTTONFG ) self.end_date_btn.SetFont(font_2) self.end_date = wx.TextCtrl(self, -1, '-', style=wx.TE_CENTER|wx.TE_READONLY) self.end_date.SetBackgroundColour( INPUTBG) self.end_date.SetForegroundColour( INPUTFG) self.end_date.SetFont(font_2) rbox2FF.Add(self.end_date_btn, 0, wx.RIGHT, 5) rbox2FF.Add(self.end_date, 1) DatePickZ.Add(rbox2FF, 0, wx.EXPAND|wx.ALL, 5) #DatenSumZ.Add(DatePickZ, 0, wx.EXPAND|wx.ALL, 5) vsizer2.Add(DatePickZ, 0, wx.EXPAND|wx.ALL, 5) #--# #DatenSumZ.Add((-1, 10)) #DatenSumZ.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) #DatenSumZ.Add((-1, 10)) #------------------------------------------------------------------ self.summary_sbox = wx.StaticBox(self, -1, 'Ventas') rbox3 = wx.StaticBoxSizer(self.summary_sbox, wx.VERTICAL) #--# rbox3_1 = wx.BoxSizer(wx.HORIZONTAL) self.subtotal_label = wx.StaticText(self, -1, 'Sub-total'+'- ', size = (100, -1)) self.subtotal_label.SetFont(font_2) self.subtotal_amount = wx.TextCtrl(self, -1, size=(200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.subtotal_amount.SetBackgroundColour( INPUTBG ) self.subtotal_amount.SetForegroundColour( INPUTFG ) self.subtotal_amount.SetFont(font_2) rbox3_1.Add(self.subtotal_label, 0, wx.TOP|wx.LEFT, 5) rbox3_1.Add(self.subtotal_amount, 0) rbox3.Add(rbox3_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) #--# rbox3_2 = wx.BoxSizer(wx.HORIZONTAL) self.sTax_label = wx.StaticText(self, -1, 'Impuesto'+' -', size = (100, -1)) self.sTax_label.SetFont(font_2) self.sTax_amount = wx.TextCtrl(self, -1, size=(200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.sTax_amount.SetBackgroundColour( INPUTBG ) self.sTax_amount.SetForegroundColour( INPUTFG ) self.sTax_amount.SetFont(font_2) rbox3_2.Add(self.sTax_label, 0, wx.TOP|wx.LEFT, 5) rbox3_2.Add(self.sTax_amount, 0) rbox3.Add(rbox3_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.RIGHT|wx.LEFT, 10) #--# rbox3.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 5) #--# rbox3_3 = wx.BoxSizer(wx.HORIZONTAL) self.total_label = wx.StaticText(self, -1, 'Total'+' -', size=(100, -1)) self.total_label.SetFont(font_4) self.total_amount = wx.TextCtrl(self, -1, size=(200, -1), style=wx.TE_READONLY|wx.TE_CENTER) self.total_amount.SetBackgroundColour( INPUTBG ) self.total_amount.SetForegroundColour( INPUTFG ) self.total_amount.SetFont(font_4) rbox3_3.Add(self.total_label, 0, wx.TOP|wx.RIGHT, 5) rbox3_3.Add(self.total_amount, 0) rbox3.Add(rbox3_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) #DatenSumZ.Add(rbox3, 0, wx.EXPAND|wx.ALL, 5) #vsizer2.Add(DatenSumZ, 0, wx.EXPAND|wx.ALL, 5) vsizer2.Add(rbox3, 0, wx.EXPAND|wx.RIGHT|wx.LEFT, 5) #--# vsizer2.Add((-1, 10)) # Generador de Reportes ReportssbSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"" ), wx.VERTICAL ) self.reports_label = wx.StaticText(self, wx.ID_EDIT, 'Generar Reportes') self.reports_label.SetFont(font_1) ReportssbSizer.Add(self.reports_label, 0,wx.ALL|wx.ALIGN_CENTER_HORIZONTAL) reportsgSizer = wx.GridSizer( 0, 3, 0, 0 ) SumarysbSizerC = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Reporte de Creditos" ), wx.HORIZONTAL ) self.XLSSumaryC_bpButton = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( self.IconPath("creditos.png"), wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.Size( 100,150 ), 0|wx.NO_BORDER|wx.TRANSPARENT_WINDOW ) self.XLSSumaryC_bpButton.SetToolTipString( u"Reporte de Creditos" ) self.XLSSumaryC_bpButton.SetMinSize( wx.Size( 100,150 ) ) self.XLSSumaryC_bpButton.SetMaxSize( wx.Size( 100,150 ) ) self.XLSSumaryC_bpButton.SetBackgroundColour( BGCOLOR) SumarysbSizerC.Add( self.XLSSumaryC_bpButton, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) reportsgSizer.Add( SumarysbSizerC, 1, wx.ALIGN_CENTER_HORIZONTAL, 2 ) #---------------------------------------# SumarysbSizer = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Reporte de Ventas" ), wx.HORIZONTAL ) self.XLSSumary_bpButton = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( self.IconPath("ventas1.png"), wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.Size( 100,150 ), 0|wx.NO_BORDER|wx.TRANSPARENT_WINDOW ) self.XLSSumary_bpButton.SetToolTipString( u"Reporte de Ventas" ) self.XLSSumary_bpButton.SetMinSize( wx.Size( 100,150 ) ) self.XLSSumary_bpButton.SetMaxSize( wx.Size( 100,150 ) ) self.XLSSumary_bpButton.SetBackgroundColour( BGCOLOR) SumarysbSizer.Add( self.XLSSumary_bpButton, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 ) reportsgSizer.Add( SumarysbSizer, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) ReportssbSizer.Add( reportsgSizer, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) vsizer2.Add( ReportssbSizer, 1, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 ) #------------------------------------------------------------------ endSizer.Add(vsizer1, 1, wx.EXPAND|wx.ALL, 5) endSizer.Add(vsizer2, 1, wx.EXPAND|wx.TOP|wx.RIGHT, 5) self.SetSizer(endSizer) # Initialize complementary object instances #------------------------------------------------------------------ self.config = config.Configuration() self.c_symbol = self.config.cCurrency()[0] self.c_dec = self.config.cCurrency()[1] self.thous_sep = self.config.ThousandsSep() self.Language() # Panel Bindings #------------------------------------------------------------------ self.st_date_btn.Bind(wx.EVT_BUTTON, self.OnStDate) self.end_date_btn.Bind(wx.EVT_BUTTON, self.OnEndDate) self.st_date.Bind(wx.EVT_LEFT_DCLICK, self.OnStDate) self.end_date.Bind(wx.EVT_LEFT_DCLICK, self.OnEndDate) #--# self.Bind(wx.EVT_COMBOBOX, self.OnPeriodSel, self.period_choice) self.sales_lc.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.OnSaleSelect) #self.search_bar.Bind(wx.EVT_KEY_UP, self.OnSearch) self.Bind(wx.EVT_BUTTON, self.EditSaleRec) self.XLSSumaryC_bpButton.Bind(wx.EVT_BUTTON, self.OnPrintReportCXLS) self.XLSSumary_bpButton.Bind(wx.EVT_BUTTON, self.OnPrintReportXLS) #self.PDFSumary_bpButton.Bind(wx.EVT_BUTTON, self.OnPrintReportPDF) #self.PDFDetalled_bpButton.Bind(wx.EVT_BUTTON, self.OnPrintProdList) self.print_receipt_btn.Bind(wx.EVT_BUTTON, self.OnPrintReceipt) self.delete_receipt_btn.Bind(wx.EVT_BUTTON, self.OnDeleteReceipt) #self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) #------------------------------------------------------------------ self.period_choice.SetValue(self.day) self.SetDates() self.SalesRecUpdate() self.Total()
def __init__( self, parent ): self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 310,250 ) ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.SetBackgroundColour( BGCOLOR ) self.SetTransparent(TRANSPARENCY) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText0 = wx.StaticText( self, wx.ID_ANY, u"MiniPOS", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText0.Wrap( -1 ) self.m_staticText0.SetFont( wx.Font( 28, 74, 90, 92, False, "Sans" ) ) self.m_staticText0.SetForegroundColour( FGCOLOR ) bSizer1.Add( self.m_staticText0, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Nombre de Usuario:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) self.m_staticText1.SetForegroundColour(FGCOLOR ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) self.username_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 270,30 ), 0 ) self.username_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.username_textCtrl.SetForegroundColour( INPUTFG ) self.username_textCtrl.SetBackgroundColour( INPUTBG ) self.username_textCtrl.SetFocus() bSizer1.Add( self.username_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Clave:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) self.m_staticText2.SetForegroundColour( FGCOLOR) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.password_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 270,30 ), wx.TE_PASSWORD ) self.password_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.password_textCtrl.SetForegroundColour( INPUTFG ) self.password_textCtrl.SetBackgroundColour( INPUTBG ) bSizer1.Add( self.password_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) m_sdbSizer2 = wx.StdDialogButtonSizer() self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK ) m_sdbSizer2.AddButton( self.m_sdbSizer2OK ) self.m_sdbSizer2OK.SetForegroundColour( BUTTONFG ) self.m_sdbSizer2OK.SetBackgroundColour( BUTTONBG ) self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL ) m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel ) self.m_sdbSizer2Cancel.SetForegroundColour( BUTTONFG ) self.m_sdbSizer2Cancel.SetBackgroundColour( BUTTONBG ) m_sdbSizer2.Realize(); bSizer1.Add( m_sdbSizer2, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY ) self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Nombre:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) self.name_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 350,30 ), 0 ) self.name_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Trebuchet MS" ) ) self.name_textCtrl.SetBackgroundColour( INPUTBG ) self.name_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.name_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Slogan:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.slogan_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 350,30 ), 0 ) bSizer1.Add( self.slogan_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.slogan_textCtrl.SetBackgroundColour( INPUTBG ) self.slogan_textCtrl.SetForegroundColour( INPUTFG ) gSizer2 = wx.GridSizer( 0, 2, 0, 0 ) self.ok_button = wx.Button( self, wx.ID_ANY, u"Cambiar", wx.DefaultPosition, wx.Size( 100,30 ), 0 ) self.ok_button.SetBackgroundColour( BUTTONBG ) self.ok_button.SetForegroundColour( BUTTONFG ) gSizer2.Add( self.ok_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer1.Add( gSizer2, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.ok_button.Bind( wx.EVT_BUTTON, self.ok ) global datosTienda datosTienda = self.db.SelectConfigNS() self.name_textCtrl.SetValue(self.normalizar(datosTienda[1])) self.slogan_textCtrl.SetValue(self.normalizar(datosTienda[2]))
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.db = tgpos_db.tgpos_DB() accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, kESCAPE)] ) self.SetAcceleratorTable(accel_tbl) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour(BGCOLOR) self.SetForegroundColour(FGCOLOR) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) PrincipalCont = wx.BoxSizer( wx.VERTICAL ) self.title_label = wx.StaticText( self, wx.ID_ANY, u"Agregando elementos a la venta", wx.DefaultPosition, wx.DefaultSize, 0 ) self.title_label.Wrap( -1 ) self.title_label.SetFont( wx.Font( 14, 74, 90, 90, False, "Sans" ) ) PrincipalCont.Add( self.title_label, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.BarCode = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), wx.TE_PROCESS_ENTER ) self.BarCode.SetBackgroundColour(INPUTBG) self.BarCode.SetForegroundColour(INPUTFG) PrincipalCont.Add( self.BarCode, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) LogListChoices = [] self.LogList = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, LogListChoices, 0 ) self.LogList.SetBackgroundColour(INPUTBG) self.LogList.SetForegroundColour(INPUTFG) PrincipalCont.Add( self.LogList, 1, wx.ALL|wx.EXPAND, 5 ) self.SetSizer( PrincipalCont ) self.Layout() PrincipalCont.Fit( self ) self.Centre( wx.BOTH ) self.Indice = 0 # Connect Events self.Bind( wx.EVT_CLOSE, self.Close ) self.Bind( wx.EVT_INIT_DIALOG, self.Activate ) self.BarCode.Bind( wx.EVT_TEXT_ENTER, self.AgregarElemento ) #self.BarCode.Bind( wx.EVT_TEXT, self.AgregarElemento ) self.LogList.Bind( wx.EVT_LISTBOX, self.ListBoxSelected ) self.LogList.Bind( wx.EVT_LISTBOX_DCLICK, self.ListBoxSelected ) self.LogList.Bind( wx.EVT_SET_FOCUS, self.ListBoxSelected ) self.Bind(wx.EVT_MENU, self.Close, id=kESCAPE)
def __init__(self, parent, *args, **kwargs): super(EditDlg, self).__init__(parent, *args, **kwargs) accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, kESCAPE)] ) self.SetAcceleratorTable(accel_tbl) # Set styles for the dialog #------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) self.Size = (500, 450) # Get necessary configuration information #------------------------------------------------------------------ self.config = config.Configuration() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR) self.SetForegroundColour( FGCOLOR) # Dialog Sizer #------------------------------------------------------------------ sizer = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.edit_label = wx.StaticText(self, -1, 'Modificar Producto') self.edit_label.SetFont(font_1) hbox1.Add(self.edit_label, 0) sizer.Add(hbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.TOP, 5) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.item_label = wx.StaticText(self, -1, 'Nombre', size=(130, -1)) self.item_label.SetFont(font_2) self.item_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.item_input.SetBackgroundColour(INPUTBG) self.item_input.SetForegroundColour(INPUTFG) hbox2.Add(self.item_label, 0, wx.RIGHT|wx.TOP, 5) hbox2.Add(self.item_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.parte_label = wx.StaticText(self, -1, 'Codigo de parte', size=(130, -1)) self.parte_label.SetFont(font_2) self.parte_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.parte_input.SetForegroundColour(INPUTFG) self.parte_input.SetBackgroundColour(INPUTBG) hbox2.Add(self.parte_label, 0, wx.RIGHT|wx.TOP, 5) hbox2.Add(self.parte_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox20 = wx.BoxSizer(wx.HORIZONTAL) self.barra_label = wx.StaticText(self, -1, 'Codigo de Barras', size=(130, -1)) self.barra_label.SetFont(font_2) self.barra_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.barra_input.SetForegroundColour(INPUTFG) self.barra_input.SetBackgroundColour(INPUTBG) hbox20.Add(self.barra_label, 0, wx.RIGHT|wx.TOP, 5) hbox20.Add(self.barra_input, 1) sizer.Add(hbox20, 0, wx.EXPAND|wx.ALL, 10) #--# hbox33 = wx.BoxSizer(wx.HORIZONTAL) self.priceC_label = wx.StaticText(self, -1, 'Precio de Compra', size=(130, -1)) self.priceC_label.SetFont(font_2) self.priceC_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.priceC_input.SetForegroundColour(INPUTFG) self.priceC_input.SetBackgroundColour(INPUTBG) hbox33.Add(self.priceC_label, 0, wx.RIGHT|wx.TOP, 5) hbox33.Add(self.priceC_input, 1) sizer.Add(hbox33, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.price_label = wx.StaticText(self, -1, 'Precio', size=(130, -1)) self.price_label.SetFont(font_2) self.price_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.price_input.SetForegroundColour(INPUTFG) self.price_input.SetBackgroundColour(INPUTBG) hbox3.Add(self.price_label, 0, wx.RIGHT|wx.TOP, 5) hbox3.Add(self.price_input, 1) sizer.Add(hbox3, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) hbox5 = wx.BoxSizer(wx.HORIZONTAL) self.stock_label = wx.StaticText(self, -1, 'Inventario', size=(130, -1)) self.stock_label.SetFont(font_2) self.stock_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.stock_input.SetForegroundColour(INPUTFG) self.stock_input.SetBackgroundColour(INPUTBG) hbox5.Add(self.stock_label, 0, wx.RIGHT|wx.TOP, 5) hbox5.Add(self.stock_input, 1) sizer.Add(hbox5, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) hbox55 = wx.BoxSizer(wx.HORIZONTAL) self.info_label = wx.StaticText(self, -1, 'NOTA: Para poder modificar los multiprecios se debe eliminar el producto y \nagrearlo de nuevo') hbox55.Add(self.info_label, 0, wx.RIGHT|wx.TOP, 5) sizer.Add(hbox55, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# ''' hbox4 = wx.BoxSizer(wx.HORIZONTAL) self.bulk = wx.CheckBox(self, -1, 'Bulk Item') hbox4.Add(self.bulk, 0) sizer.Add(hbox4, 0, wx.LEFT|wx.RIGHT, 10) ''' #--# hbox5 = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer.Add(hbox5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) sizer.Add((-1, 10)) self.SetSizer(sizer) # Bindings #------------------------------------------------------------------ self.parte_input.Bind( wx.EVT_KILL_FOCUS, self.ValidateParte ) self.barra_input.Bind( wx.EVT_KILL_FOCUS, self.ValidateBarra ) self.price_input.Bind(wx.EVT_KEY_UP, self.ValidatePrice) self.stock_input.Bind(wx.EVT_KEY_UP, self.ValidateCant) self.price_input.Bind(wx.EVT_KILL_FOCUS, self.PrClean) self.priceC_input.Bind(wx.EVT_KEY_UP, self.ValidatePriceC) self.priceC_input.Bind(wx.EVT_KILL_FOCUS, self.PrCleanC) self.Bind(wx.EVT_MENU, self.Salir, id=kESCAPE) #------------------------------------------------------------------ self.Language()
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 285,152 ), style = wx.DEFAULT_DIALOG_STYLE ) #importar base de datos self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Imprimir Comprobante luego de Completar Venta", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) self.m_staticText1.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, u"Activado ", wx.DefaultPosition, wx.Size( 200,-1 ), 0 ) self.m_checkBox1.SetFont( wx.Font( 20, 74, 90, 90, False, "Tahoma" ) ) bSizer1.Add( self.m_checkBox1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) #gSizer1 = wx.GridSizer( 0, 2, 0, 0 ) #Linea separadora self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) #Titulo self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Logotipo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) self.m_staticText2.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) #Contenedor de la opcion de logo LogotipoSIzer = wx.GridSizer( 0, 2, 0, 0 ) #Mstrar Logo self.m_bitmap1 = wx.StaticBitmap( self, wx.ID_ANY, wx.Bitmap(self.ResourcePath('logo.png')), wx.DefaultPosition, wx.Size( -1,100 ), 0 ) LogotipoSIzer.Add( self.m_bitmap1, 0, wx.ALL, 5 ) #Boton para cambiar el logo self.logo_button = wx.Button( self, wx.ID_ANY, u"Cambiar Logotipo", wx.DefaultPosition, wx.DefaultSize, 0 ) self.logo_button.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) self.logo_button.SetBackgroundColour( BUTTONBG ) self.logo_button.SetForegroundColour( BUTTONFG ) LogotipoSIzer.Add( self.logo_button, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) bSizer1.Add( LogotipoSIzer, 0, wx.EXPAND, 5 ) #Linea separadora self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) bSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) TipoFactura = wx.GridSizer( 0, 2, 0, 0 ) #Titulo self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Tipo de comprobante", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) self.m_staticText2.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) Tipo1 = wx.BoxSizer( wx.VERTICAL ) self.m_bitmap1 = wx.StaticBitmap( self, wx.ID_ANY, wx.Bitmap( self.ResourcePath("tipo1.png"), wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.Size( 130,154 ), 0 ) Tipo1.Add( self.m_bitmap1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.T1_toggleBtn = wx.ToggleButton( self, wx.ID_ANY, u"Tipo 1", wx.DefaultPosition, wx.DefaultSize, 0 ) self.T1_toggleBtn.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) Tipo1.Add( self.T1_toggleBtn, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) TipoFactura.Add( Tipo1, 0, wx.EXPAND, 5 ) tipo2 = wx.BoxSizer( wx.VERTICAL ) self.m_bitmap2 = wx.StaticBitmap( self, wx.ID_ANY, wx.Bitmap( self.ResourcePath("tipo2.png"), wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.Size( 130,154 ), 0 ) tipo2.Add( self.m_bitmap2, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.T2_toggleBtn = wx.ToggleButton( self, wx.ID_ANY, u"Tipo 2", wx.DefaultPosition, wx.DefaultSize, 0 ) self.T2_toggleBtn.SetFont( wx.Font( 11, 74, 90, 90, False, "Tahoma" ) ) tipo2.Add( self.T2_toggleBtn, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) TipoFactura.Add( tipo2, 0, wx.EXPAND, 5 ) bSizer1.Add( TipoFactura, 0, wx.EXPAND|wx.ALL, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.m_checkBox1.Bind( wx.EVT_CHECKBOX, self.check ) self.logo_button.Bind( wx.EVT_BUTTON, self.OpenLogo ) self.T1_toggleBtn.Bind( wx.EVT_TOGGLEBUTTON, self.Cambiar1 ) self.T2_toggleBtn.Bind( wx.EVT_TOGGLEBUTTON, self.Cambiar2 ) # otras cositas :D #self.db = tgpos_db.tgpos_DB() datos = self.db.SelectConfigNS() if int(datos[6]) == 1: self.m_checkBox1.SetValue(True) self.m_checkBox1.SetLabel("Activado") else: self.m_checkBox1.SetValue(False) self.m_checkBox1.SetLabel("Desactivado") TipoComp = self.db.SelectConfigComprobante() try: TipoComp = int(TipoComp) except: pass if TipoComp == 1: self.T1_toggleBtn.SetValue( True ) elif TipoComp == 2: self.T2_toggleBtn.SetValue( True ) else: print "ERROR: Tipo de comprobante invalido",TipoComp
def __init__(self, parent, *args, **kwargs): #super(MainFrame, self).__init__(parent, *args, **kwargs) #def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Agregar elementos", pos = wx.DefaultPosition, size = wx.Size( 462,160), style = wx.DEFAULT_DIALOG_STYLE ) # Get necessary configuration information #------------------------------------------------------------------ self.config = config.Configuration() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] self.db = tgpos_db.tgpos_DB() accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, kESCAPE)] ) self.SetAcceleratorTable(accel_tbl) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour(BGCOLOR) self.SetForegroundColour(FGCOLOR) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) ContenedorPrincipal = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Agregando Elementos", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) self.m_staticText1.SetFont( wx.Font( 14, 74, 90, 90, False, "Tahoma" ) ) ContenedorPrincipal.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) LogBoxChoices = [ u"Log de Acciones:" ] self.BarCode = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), wx.TE_PROCESS_ENTER ) #self.BarCode = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,50 ), wx.TE_MULTILINE|wx.TE_NO_VSCROLL ) self.BarCode.SetBackgroundColour(BGCOLOR) self.BarCode.SetForegroundColour(BGCOLOR) ContenedorPrincipal.Add( self.BarCode, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.LogBox = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, LogBoxChoices, 0 ) self.LogBox.SetBackgroundColour(INPUTBG) self.LogBox.SetForegroundColour(INPUTFG) ContenedorPrincipal.Add( self.LogBox, 1, wx.ALL|wx.EXPAND, 5 ) self.SetSizer( ContenedorPrincipal ) self.Layout() #self.m_statusBar1 = self.CreateStatusBar( 1, wx.ST_SIZEGRIP, wx.ID_ANY ) self.Centre( wx.BOTH ) # Connect Events #self.BarCode.Bind( wx.EVT_TEXT, self.AddItem ) self.BarCode.Bind( wx.EVT_TEXT_ENTER, self.AddItem ) self.Bind( wx.EVT_CLOSE, self.Cerrar ) self.BarCode.SetFocus() self.Bind(wx.EVT_MENU, self.Cerrar, id=kESCAPE) #self.BarCode.Hide() self.BarCode.SetFocus()
def __init__(self, parent, *args, **kwargs): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 595,467 ), style = wx.DEFAULT_DIALOG_STYLE ) #Importar y definir las variables para la apariencia self.db = tgpos_db.tgpos_DB() Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] #self.SetBackgroundColour(wx.WHITE) self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) # Get the current Configuration Settings #------------------------------------------------------------------ # [1]-Lang, [2]-currSym, [3]-currDec, [4]-ToggleThousSep # [5]-Toggle Sales Tax, [6]-SalesTax self.config = config.Configuration() self.settings = self.config.ConfigSettings() self.StartLang = self.settings[1] # Style Elements #------------------------------------------------------------------ font1 = wx.Font(15, wx.SWISS, wx.NORMAL, wx.NORMAL) font2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) self.Size= ((450, 450)) #------------------------------------------------------------------ # BOX SIZER #------------------------------------------------------------------ sizer = wx.BoxSizer(wx.VERTICAL) self.title = wx.StaticText(self, -1, 'Configuracion de Moneda') self.title.SetFont(font1) sizer.Add(self.title, 0, wx.LEFT|wx.TOP, 5) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) #hbox1 = wx.BoxSizer(wx.HORIZONTAL) #self.lang_label = wx.StaticText(self, -1, 'Language'+': ', size=(180, -1)) #self.lang_label.SetFont(font2) #self.lang_choice = wx.ComboBox(self, -1, choices=languages, #style=wx.CB_READONLY) #hbox1.Add(self.lang_label, 0, wx.RIGHT|wx.TOP, 5) #hbox1.Add(self.lang_choice, 1) #sizer.Add(hbox1, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.sym_label = wx.StaticText(self, -1, 'Simbolo de Moneda'+': ', size=(180, -1)) self.sym_label.SetFont(font2) self.sym_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.sym_input.SetBackgroundColour( INPUTBG ) self.sym_input.SetForegroundColour( INPUTFG ) hbox2.Add(self.sym_label, 0, wx.TOP|wx.RIGHT, 5) hbox2.Add(self.sym_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) #--# sizer.Add((-1, 10)) hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.dec_label = wx.StaticText(self, -1, 'Decimales'+': ', size=(180, -1)) self.dec_label.SetFont(font2) self.dec_input = wx.ComboBox(self, -1, choices=('0', '1', '2', '3'), style = wx.CB_READONLY) hbox3.Add(self.dec_label, 0, wx.RIGHT|wx.TOP, 5) self.dec_input.SetBackgroundColour( INPUTBG ) self.dec_input.SetForegroundColour( INPUTFG ) hbox3.Add(self.dec_input, 1) sizer.Add(hbox3, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) hbox4 = wx.BoxSizer(wx.HORIZONTAL) self.tSep_check = wx.CheckBox(self, -1, 'Separador de Miles') self.tSep_check.SetFont(font2) hbox4.Add(self.tSep_check, 0) sizer.Add(hbox4, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 10) hbox5 = wx.BoxSizer(wx.HORIZONTAL) self.sTax_check = wx.CheckBox(self, -1, 'IVA sobre las ventas') self.sTax_check.SetFont(font2) hbox5.Add(self.sTax_check, 0) sizer.Add(hbox5, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) #--# sizer.Add((-1, 10)) hbox6 = wx.BoxSizer(wx.HORIZONTAL) self.sTax_label = wx.StaticText(self, -1, 'Porcentaje de IVA'+ ' (%):', size=(180, -1)) self.sTax_label.SetFont(font2) self.sTax_input = wx.TextCtrl(self, -1, style = wx.TE_CENTER) self.sTax_input.SetBackgroundColour( INPUTBG ) self.sTax_input.SetForegroundColour( INPUTFG ) hbox6.Add(self.sTax_label, 0, wx.RIGHT|wx.TOP, 5) hbox6.Add(self.sTax_input, 1) sizer.Add(hbox6, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 20) self.SetSizer(sizer) BotonesCont = wx.BoxSizer( wx.HORIZONTAL ) self.ok_button = wx.Button( self, wx.ID_ANY, u"Guardar", wx.DefaultPosition, wx.DefaultSize, 0 ) BotonesCont.Add( self.ok_button, 0, wx.ALL, 5 ) sizer.Add( BotonesCont, 1, wx.EXPAND, 5 ) # Functions #------------------------------------------------------------------ self.Init() #self.Language() # Bindings #------------------------------------------------------------------ self.sTax_check.Bind(wx.EVT_CHECKBOX, self.OnTSep) self.sTax_input.Bind(wx.EVT_KEY_UP, self.OnSTax) self.sTax_input.Bind(wx.EVT_KILL_FOCUS, self.CleanTax) self.ok_button.Bind( wx.EVT_BUTTON, self.Guardar )
def __init__(self, parent, user, *args, **kwargs): super(POS_Panel, self).__init__(parent, *args, **kwargs) global usuario usuario = user # Objetos Complementarios self.db = tgpos_db.tgpos_DB() self.printR = print_recibo.Printer() self.printC = print_recibo_s.Printer() # Set the fonts for the panel # ------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) font_3 = wx.Font(15, wx.SWISS, wx.NORMAL, wx.NORMAL) font_4 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD) font_5 = wx.Font(13, wx.SWISS, wx.NORMAL, wx.BOLD) # Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) tempcolor = Tema[0] FGCOLOR = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) tempcolor = Tema[2] BUTTONFG = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) tempcolor = Tema[3] BUTTONBG = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) tempcolor = Tema[4] INPUTBG = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) tempcolor = Tema[5] INPUTFG = wx.Colour(tempcolor[0], tempcolor[1], tempcolor[2]) TRANSPARENCY = Tema[6] self.SetBackgroundColour(BGCOLOR) # EndSizer will be the parent of vsizer1 and vsizer2 # ------------------------------------------------------------------ endSizer = wx.BoxSizer(wx.HORIZONTAL) # ------------------------------------------------------------------ # vsizer1 will be the parent of the left wx.Boxsizers # ------------------------------------------------------------------ vsizer1 = wx.BoxSizer(wx.VERTICAL) # vsizer1.SetMinSize( wx.Size( 700,-1 ) ) # ------------------------------------------------------------------ lbox1 = wx.BoxSizer(wx.HORIZONTAL) self.title = wx.StaticText(self, -1, "Punto de Venta") self.title.SetFont(font_1) self.title.SetForegroundColour(FGCOLOR) lbox1.Add(self.title, 0) vsizer1.Add(lbox1, 0, wx.ALIGN_LEFT | wx.EXPAND | wx.ALL, 10) # ------------------------------------------------------------------ lbox2 = wx.BoxSizer(wx.HORIZONTAL) self.search_label = wx.StaticText(self, -1, "Buscar" + ": ") self.search_label.SetFont(font_2) self.search_bar = wx.SearchCtrl(self, -1) self.search_bar.ShowCancelButton(True) self.search_bar.ShowSearchButton(False) # self.search_bar.SetBackgroundColour( INPUTBG ) lbox2.Add(self.search_label, 0, wx.RIGHT | wx.TOP, 5) lbox2.Add(self.search_bar, 1) vsizer1.Add(lbox2, 0, wx.EXPAND | wx.RIGHT | wx.LEFT, 5) vsizer1.Add((-1, 2)) # ------------------------------------------------------------------ lbox3 = wx.BoxSizer(wx.HORIZONTAL) self.product_lc = ProductLC(self, -1, style=wx.LC_REPORT | wx.LC_VRULES | wx.BORDER_DEFAULT) self.product_lc.SetBackgroundColour(INPUTBG) self.product_lc.SetForegroundColour(INPUTFG) lbox3.Add(self.product_lc, 1, wx.EXPAND) vsizer1.Add(lbox3, 1, wx.EXPAND | wx.ALL, 5) endSizer.Add(vsizer1, 1, wx.EXPAND, 5) # ------------------------------------------------------------------ # vsizer2 will be the parent of the right wx.Boxsizers # ------------------------------------------------------------------ vsizer2 = wx.BoxSizer(wx.VERTICAL) # vsizer2.SetMinSize( wx.Size( 100,-1 ) ) vsizer2.Add((-1, 10)) # ------------------------------------------------------------------ rbox1 = wx.BoxSizer(wx.HORIZONTAL) self.receipt_label = wx.StaticText(self, -1, "Venta: ") self.receipt_label.SetFont(font_3) self.receipt_label.SetForegroundColour(INPUTFG) self.nombre_label = wx.StaticText(self, -1, "Nombre:") self.nombre_label.SetFont(font_3) self.nombre_label.SetForegroundColour(INPUTFG) self.nit_label = wx.StaticText(self, -1, "Nit:") self.nit_label.SetFont(font_3) self.nit_label.SetForegroundColour(INPUTFG) self.receipt_num = wx.TextCtrl(self, -1, style=wx.TE_READONLY | wx.TE_CENTER) # self.receipt_num = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 40,-1 ), wx.TE_READONLY ) self.receipt_num.SetBackgroundColour(INPUTBG) self.receipt_num.SetForegroundColour(INPUTFG) self.nombre_name = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.nombre_name.SetBackgroundColour(INPUTBG) self.nombre_name.SetForegroundColour(INPUTFG) self.nit_num = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.nit_num.SetBackgroundColour(INPUTBG) self.nit_num.SetForegroundColour(INPUTFG) rbox1.Add(self.receipt_label, 0, wx.TOP, 5) rbox1.Add(self.receipt_num, 0, wx.LEFT | wx.RIGHT, 3) rbox1.Add(self.nombre_label, 0, wx.TOP, 5) rbox1.Add(self.nombre_name, 1, wx.LEFT | wx.RIGHT, 2) rbox1.Add(self.nit_label, 0, wx.TOP, 5) rbox1.Add(self.nit_num, 1, wx.LEFT | wx.RIGHT, 2) vsizer2.Add(rbox1, 0, wx.EXPAND | wx.ALL, 5) # ------------------------------------------------------------------ rbox2 = wx.BoxSizer(wx.HORIZONTAL) self.sepLine1 = wx.StaticLine(self, -1) # self.a3_label = wx.StaticText(self, -1, 'Hola Mundo!') # rbox2.Add(self.a3_label, 1) rbox2.Add(self.sepLine1, 1) vsizer2.Add(rbox2, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) # ------------------------------------------------------------------ rbox3 = wx.BoxSizer(wx.HORIZONTAL) self.receipt_lc = ReceiptLC(self, -1, style=wx.LC_REPORT | wx.LC_VRULES | wx.BORDER_DEFAULT | wx.LC_HRULES) self.receipt_lc.SetBackgroundColour(INPUTBG) self.receipt_lc.SetForegroundColour(INPUTFG) rbox3.Add(self.receipt_lc, 1, wx.EXPAND) vsizer2.Add(rbox3, 4, wx.EXPAND | wx.ALL, 5) # ------------------------------------------------------------------ self.static_box = wx.StaticBox(self, -1, "Resumen de la venta") rbox4 = wx.StaticBoxSizer(self.static_box, wx.VERTICAL) # subbox1 will hold the total label and amount subbox1 = wx.BoxSizer(wx.HORIZONTAL) self.subtotal_label = wx.StaticText(self, -1, "Sub Total") self.subtotal_label.SetFont(font_4) self.subtotal_label.SetForegroundColour(FGCOLOR) self.subtotal_amount = wx.TextCtrl(self, -1, style=wx.TE_READONLY | wx.TE_RIGHT) self.subtotal_amount.SetBackgroundColour(INPUTBG) self.subtotal_amount.SetForegroundColour(INPUTFG) self.subtotal_amount.SetFont(font_4) subbox1.Add(wx.StaticText(self, -1, ""), 2) subbox1.Add(self.subtotal_label, 2, wx.TOP | wx.RIGHT, 5) subbox1.Add(self.subtotal_amount, 2) rbox4.Add(subbox1, 0, wx.EXPAND | wx.ALL, 10) # --# subbox2 = wx.BoxSizer(wx.HORIZONTAL) self.tax_label = wx.StaticText(self, -1, "Impuesto de Venta") self.tax_label.SetForegroundColour(FGCOLOR) self.tax_amount = wx.TextCtrl(self, -1, style=wx.TE_READONLY | wx.TE_RIGHT) self.tax_amount.SetBackgroundColour(INPUTBG) self.tax_amount.SetForegroundColour(INPUTFG) self.tax_label.SetFont(font_2) self.tax_amount.SetFont(font_2) subbox2.Add(wx.StaticText(self, -1, ""), 2) subbox2.Add(self.tax_label, 2, wx.TOP | wx.RIGHT, 5) subbox2.Add(self.tax_amount, 2) rbox4.Add(subbox2, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) # --# subbox3 = wx.BoxSizer(wx.HORIZONTAL) subbox3.Add(wx.StaticText(self, -1, ""), 2) subbox3.Add(wx.StaticLine(self, -1), 4) rbox4.Add(subbox3, 0, wx.EXPAND | wx.TOP, 10) # --# subbox4 = wx.BoxSizer(wx.HORIZONTAL) self.total_label = wx.StaticText(self, -1, "Total") self.total_label.SetForegroundColour(FGCOLOR) self.total_amount = wx.TextCtrl(self, -1, style=wx.TE_READONLY | wx.TE_RIGHT) self.total_label.SetFont(font_5) self.total_amount.SetBackgroundColour(INPUTBG) self.total_amount.SetForegroundColour(INPUTFG) self.total_amount.SetFont(font_5) subbox4.Add(wx.StaticText(self, -1, ""), 2) subbox4.Add(self.total_label, 2, wx.TOP | wx.RIGHT, 5) subbox4.Add(self.total_amount, 2) rbox4.Add(subbox4, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) # --# vsizer2.Add(rbox4, 2, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, 5) # self.credito_checkBox = wx.CheckBox( self, wx.ID_ANY, u"Credito?", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_RIGHT ) # ------------------------------------------------------------------ # RecordSale( rbox5 = wx.BoxSizer(wx.HORIZONTAL) self.credito_btn = wx.Button(self, -1, "Credito", size=(-1, 50)) self.credito_btn.SetBackgroundColour(BUTTONBG) self.credito_btn.SetForegroundColour(BUTTONFG) self.credito_btn.SetFont(font_4) self.complete_btn = wx.Button(self, -1, "Completar", size=(-1, 50)) self.complete_btn.SetBackgroundColour(BUTTONBG) self.complete_btn.SetForegroundColour(BUTTONFG) self.complete_btn.SetFont(font_4) self.cancel_btn = wx.Button(self, -1, "Cancelar", size=(-1, 50)) self.cancel_btn.SetBackgroundColour(BUTTONBG) self.cancel_btn.SetForegroundColour(BUTTONFG) self.cancel_btn.SetFont(font_4) rbox5.Add(self.cancel_btn, 3, wx.RIGHT, 1) rbox5.Add(self.credito_btn, 1) rbox5.Add(self.complete_btn, 3) vsizer2.Add(rbox5, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15) vsizer2.Add((-1, 5)) # ------------------------------------------------------------------ endSizer.Add(vsizer2, 1, wx.EXPAND, 5) self.SetSizer(endSizer) # Set up complimentary objects # ------------------------------------------------------------------ self.config = config.Configuration() self.c_symbol = self.config.cCurrency()[0] self.c_dec = self.config.cCurrency()[1] self.thous_sep = self.config.ThousandsSep() # ------------------------------------------------------------------ self.m1, self.t1, self.m2, self.t2, self.btn_l1 = "", "", "", "", "" self.btn_l2, self.r_label, self.t_label = "", "", "" self.Language() # ----------------------------------------------------------------- self.PListRefresh() self.SetReceiptNo() self.SaleInfoSetup() self.edit_mode = False self.OnCancel(None) # Bindings # ------------------------------------------------------------------ self.search_bar.Bind(wx.EVT_TEXT, self.OnSearch) self.product_lc.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect) self.receipt_lc.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRClick) self.receipt_lc.Bind(wx.EVT_LEFT_DCLICK, self.OnEdit) self.Bind(wx.EVT_BUTTON, self.OnComplete, self.complete_btn) self.Bind(wx.EVT_BUTTON, self.OnCredito, self.credito_btn) self.Bind(wx.EVT_BUTTON, self.OnCancel, self.cancel_btn) self.search_bar.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnSearchCancel)
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Eliminar Venta", pos = wx.DefaultPosition, size = wx.Size( 376,480 ), style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.db = tgpos_db.tgpos_DB() Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR) self.SetTransparent(Tema[-1]) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Se eliminará la venta:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) gSizer1 = wx.GridSizer( 0, 2, 0, 0 ) self.clienteVenta= wx.StaticText( self, wx.ID_ANY, u"#", wx.DefaultPosition, wx.DefaultSize, 0 ) self.clienteVenta.Wrap( -1 ) gSizer1.Add( self.clienteVenta, 0, wx.ALL|wx.ALIGN_RIGHT, 5 ) self.textNo = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.textNo.SetBackgroundColour( INPUTBG) self.textNo.SetForegroundColour( INPUTFG) self.textNo.Enable( False ) gSizer1.Add( self.textNo, 1, wx.ALL|wx.EXPAND, 5 ) self.clienteFecha = wx.StaticText( self, wx.ID_ANY, u"Fecha:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.clienteFecha.Wrap( -1 ) gSizer1.Add( self.clienteFecha, 0, wx.ALL|wx.ALIGN_RIGHT, 5 ) self.textFecha = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.textFecha.SetBackgroundColour( INPUTBG) self.textFecha.SetForegroundColour( INPUTFG) self.textFecha.Enable( False ) gSizer1.Add( self.textFecha, 1, wx.ALL|wx.EXPAND, 5 ) self.ClienteLabel = wx.StaticText( self, wx.ID_ANY, u"Cliente:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.ClienteLabel.Wrap( -1 ) gSizer1.Add( self.ClienteLabel, 0, wx.ALL|wx.ALIGN_RIGHT, 5 ) self.textCliente = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.textCliente.SetBackgroundColour( INPUTBG) self.textCliente.SetForegroundColour( INPUTFG) self.textCliente.Enable( False ) gSizer1.Add( self.textCliente, 1, wx.ALL|wx.EXPAND, 5 ) self.clienteTotal = wx.StaticText( self, wx.ID_ANY, u"Total:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.clienteTotal.Wrap( -1 ) gSizer1.Add( self.clienteTotal, 0, wx.ALL|wx.ALIGN_RIGHT, 5 ) self.textTotal = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.textTotal.SetBackgroundColour( INPUTBG) self.textTotal.SetForegroundColour( INPUTFG) self.textTotal.Enable( False ) gSizer1.Add( self.textTotal, 1, wx.ALL|wx.EXPAND, 5 ) bSizer1.Add( gSizer1, 1, wx.EXPAND, 5 ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Los siguientes elementos se tendrán que agregar manualmente al inventario.", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) bSizer1.Add( self.m_staticText3, 0, wx.ALL|wx.EXPAND, 5 ) self.elementosListado = wx.ListCtrl(self, -1, style=wx.LC_REPORT) self.elementosListado.InsertColumn(0, 'Codigo') self.elementosListado.InsertColumn(1, 'Producto') self.elementosListado.InsertColumn(2, 'Cant.') self.elementosListado.SetColumnWidth(0, 80) self.elementosListado.SetColumnWidth(1, 230) self.elementosListado.SetColumnWidth(2, 60) self.elementosListado.SetBackgroundColour( INPUTBG) self.elementosListado.SetForegroundColour( INPUTFG) bSizer1.Add( self.elementosListado, 1, wx.EXPAND, 5 ) bSizer2 = wx.BoxSizer( wx.HORIZONTAL ) self.cancelarButton = wx.Button( self, wx.ID_ANY, u"Cancelar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.cancelarButton.SetBackgroundColour( BUTTONBG ) self.cancelarButton.SetForegroundColour( BUTTONFG ) bSizer2.Add( self.cancelarButton, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) self.eliminarButton = wx.Button( self, wx.ID_ANY, u"Eliminar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.eliminarButton.SetBackgroundColour( BUTTONBG ) self.eliminarButton.SetForegroundColour( BUTTONFG ) bSizer2.Add( self.eliminarButton, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 ) bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.cancelarButton.Bind( wx.EVT_BUTTON, self.Cancelar ) self.eliminarButton.Bind( wx.EVT_BUTTON, self.Eliminar )
def __init__(self): self.db = tgpos_db.tgpos_DB()
def __init__( self, parent ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Panel de control -> MiniPOS", pos = wx.DefaultPosition, size = wx.Size( 751,469 ), style = wx.CAPTION|wx.CLOSE_BOX|wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.TRANSPARENT_WINDOW ) self.db = tgpos_db.tgpos_DB() self.SetSizeHintsSz( wx.Size( 751,469 ), wx.Size( 751,469 ) ) #self.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) ) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetFont( wx.Font( 13, 74, 90, 90, True, "Tahoma" ) ) self.SetForegroundColour( FGCOLOR ) self.SetBackgroundColour( BGCOLOR ) gSizer1 = wx.GridSizer( 0, 1, 0, 0 ) sbSizer7 = wx.StaticBoxSizer( wx.StaticBox( self, wx.ID_ANY, u"Panel de control" ), wx.VERTICAL ) gSizer3 = wx.GridSizer( 0, 2, 0, 0 ) bSizer3 = wx.BoxSizer( wx.VERTICAL ) gbSizer1 = wx.GridBagSizer( 0, 0 ) gbSizer1.SetFlexibleDirection( wx.BOTH ) gbSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) if hasattr(sys, 'frozen'): path0 = os.path.join('resources', 'icons', 'users.bmp') else: path0 = os.path.split(__file__)[0] path0 = os.path.join(path0, 'resources', 'icons', 'users.bmp') self.m_bpButton5 = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( path0, wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_bpButton5.Enable( False ) gbSizer1.Add( self.m_bpButton5, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer6 = wx.BoxSizer( wx.VERTICAL ) self.agregar_staticText = wx.StaticText( self, wx.ID_ANY, u"Agregar Usuario", wx.DefaultPosition, wx.DefaultSize, 0 ) self.agregar_staticText.Wrap( -1 ) #self.agregar_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.agregar_staticText.SetToolTipString( u"Agrega un usuario al sistema POS" ) #self.agregar_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer6.Add( self.agregar_staticText, 0, wx.ALL, 5 ) self.modificar_staticText = wx.StaticText( self, wx.ID_ANY, u"Modificar Usuario", wx.DefaultPosition, wx.DefaultSize, 0 ) self.modificar_staticText.Wrap( -1 ) #self.modificar_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) #self.modificar_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.modificar_staticText.SetToolTipString( u"Modifica un usuario existente en la base de datos" ) bSizer6.Add( self.modificar_staticText, 0, wx.ALL, 5 ) self.eliminar_staticText = wx.StaticText( self, wx.ID_ANY, u"Eliminar Usuario", wx.DefaultPosition, wx.DefaultSize, 0 ) self.eliminar_staticText.Wrap( -1 ) #self.eliminar_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) #self.eliminar_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) self.eliminar_staticText.SetToolTipString( u"Elimina un usuario de la base de datos" ) bSizer6.Add( self.eliminar_staticText, 0, wx.ALL, 5 ) gbSizer1.Add( bSizer6, wx.GBPosition( 0, 4 ), wx.GBSpan( 1, 2 ), wx.EXPAND, 0 ) bSizer3.Add( gbSizer1, 1, wx.EXPAND|wx.ALIGN_RIGHT, 5 ) gbSizer11 = wx.GridBagSizer( 0, 0 ) gbSizer11.SetFlexibleDirection( wx.BOTH ) gbSizer11.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) if hasattr(sys, 'frozen'): path1 = os.path.join('resources', 'icons', 'info.bmp') else: path1 = os.path.split(__file__)[0] path1= os.path.join(path1, 'resources', 'icons', 'info.bmp') ###Contenido Borrado por considerarse inservible y dificil de codear y reemplazado por la infomacion del programa self.m_bpButton53 = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( path1, wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, 0 ) gbSizer11.Add( self.m_bpButton53, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_bpButton53.Enable( False ) bSizer63 = wx.BoxSizer( wx.VERTICAL ) self.info_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Informacion del programa", wx.DefaultPosition, wx.DefaultSize, 0 ) self.info_staticText3.Wrap( -1 ) #self.info_staticText3.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.info_staticText3.SetToolTipString( u"informacion detallada sobre el programa" ) #self.info_staticText3.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer63.Add( self.info_staticText3, 0, wx.ALL, 5 ) self.autor_staticText25 = wx.StaticText( self, wx.ID_ANY, u"Acerca del Autor", wx.DefaultPosition, wx.DefaultSize, 0 ) self.autor_staticText25.Wrap( -1 ) #self.autor_staticText25.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.autor_staticText25.SetToolTipString( u"Informacion sobre el autor del programa" ) #self.autor_staticText25.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer63.Add( self.autor_staticText25, 0, wx.ALL, 5 ) gbSizer11.Add( bSizer63, wx.GBPosition( 0, 4 ), wx.GBSpan( 1, 2 ), wx.EXPAND, 0 ) bSizer3.Add( gbSizer11, 1, wx.EXPAND, 5 ) gSizer3.Add( bSizer3, 1, wx.EXPAND, 5 ) bSizer5 = wx.BoxSizer( wx.VERTICAL ) gbSizer12 = wx.GridBagSizer( 0, 0 ) gbSizer12.SetFlexibleDirection( wx.BOTH ) gbSizer12.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) if hasattr(sys, 'frozen'): path2 = os.path.join('resources', 'icons', 'configuracion.bmp') else: path2 = os.path.split(__file__)[0] path2= os.path.join(path2, 'resources', 'icons', 'configuracion.bmp') self.m_bpButton52 = wx.BitmapButton( self, wx.ID_ANY, wx.Bitmap( path2, wx.BITMAP_TYPE_ANY ), wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_bpButton52.Enable( False ) gbSizer12.Add( self.m_bpButton52, wx.GBPosition( 0, 0 ), wx.GBSpan( 1, 1 ), wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer62 = wx.BoxSizer( wx.VERTICAL ) self.nombreTienda_staticText = wx.StaticText( self, wx.ID_ANY, u"Nombre y Slogan", wx.DefaultPosition, wx.DefaultSize, 0 ) self.nombreTienda_staticText.Wrap( -1 ) #self.nombreTienda_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.nombreTienda_staticText.SetToolTipString( u"Cambia el nombre y slogan de la empresa o tienda (aparecera en todas las facturas)" ) #self.nombreTienda_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer62.Add( self.nombreTienda_staticText, 0, wx.ALL, 5 ) self.tiendainfo_staticText = wx.StaticText( self, wx.ID_ANY, u"Información", wx.DefaultPosition, wx.DefaultSize, 0 ) self.tiendainfo_staticText.Wrap( -1 ) #self.tiendainfo_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.tiendainfo_staticText.SetToolTipString( u"Direccion, telefono, pagina web" ) #self.tiendainfo_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer62.Add( self.tiendainfo_staticText, 0, wx.ALL, 5 ) self.moneda_staticText = wx.StaticText( self, wx.ID_ANY, u"Moneda", wx.DefaultPosition, wx.DefaultSize, 0 ) self.moneda_staticText.Wrap( -1 ) #self.moneda_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.moneda_staticText.SetToolTipString( u"Cambia el simbolo de la moneda y modifica el IVA" ) #self.moneda_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer62.Add( self.moneda_staticText, 0, wx.ALL, 5 ) self.apa_staticText = wx.StaticText( self, wx.ID_ANY, u"Apariencia", wx.DefaultPosition, wx.DefaultSize, 0 ) self.apa_staticText.Wrap( -1 ) #self.moneda_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.apa_staticText.SetToolTipString( u"Cambia los colores y la transparencia del programa" ) #self.moneda_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer62.Add( self.apa_staticText, 0, wx.ALL, 5 ) self.otros_staticText = wx.StaticText( self, wx.ID_ANY, u"Otros...", wx.DefaultPosition, wx.DefaultSize, 0 ) self.otros_staticText.Wrap( -1 ) #self.tiendainfo_staticText.SetForegroundColour( wx.Colour( 0, 0, 255 ) ) self.otros_staticText.SetToolTipString( u"Modifica otras opciones del programa" ) #self.tiendainfo_staticText.SetFont( wx.Font( 10, 74, 90, 90, True, "Tahoma" ) ) bSizer62.Add( self.otros_staticText, 0, wx.ALL, 5 ) gbSizer12.Add( bSizer62, wx.GBPosition( 0, 4 ), wx.GBSpan( 1, 2 ), wx.EXPAND, 0 ) bSizer5.Add( gbSizer12, 1, wx.EXPAND, 5 ) gbSizer13 = wx.GridBagSizer( 0, 0 ) gbSizer13.SetFlexibleDirection( wx.BOTH ) gbSizer13.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) bSizer5.Add( gbSizer13, 1, wx.EXPAND, 5 ) gSizer3.Add( bSizer5, 1, wx.EXPAND, 5 ) sbSizer7.Add( gSizer3, 1, wx.EXPAND, 5 ) gSizer1.Add( sbSizer7, 1, wx.EXPAND, 5 ) self.SetSizer( gSizer1 ) self.Layout() self.Centre( wx.BOTH ) # Connect Events self.eliminar_staticText.Bind( wx.EVT_LEFT_DOWN, self.eliminarUsuario ) self.modificar_staticText.Bind( wx.EVT_LEFT_DOWN, self.modificarUsuario ) self.agregar_staticText.Bind( wx.EVT_LEFT_DOWN, self.agregarUsuario ) #self.UserList_staticText.Bind( wx.EVT_LEFT_DOWN, self.listadoDeusuarios ) #self.eliminar_staticText1.Bind( wx.EVT_LEFT_DOWN, self.eliminarProveedor ) #self.modificar_staticText1.Bind( wx.EVT_LEFT_DOWN, self.modificarProveedor ) #self.agregar_staticText1.Bind( wx.EVT_LEFT_DOWN, self.agregarProveedor ) #self.m_staticText24.Bind( wx.EVT_LEFT_DOWN, self.ListadoDeProveedores ) self.nombreTienda_staticText.Bind( wx.EVT_LEFT_DOWN, self.NombredelaTienda ) self.moneda_staticText.Bind( wx.EVT_LEFT_DOWN, self.ModificarMoneda ) self.apa_staticText.Bind( wx.EVT_LEFT_DOWN, self.ModificarApa ) self.tiendainfo_staticText.Bind( wx.EVT_LEFT_DOWN, self.ModificarInfoTienda ) self.otros_staticText.Bind( wx.EVT_LEFT_DOWN, self.OtrosConfig ) self.info_staticText3.Bind( wx.EVT_LEFT_DOWN, self.InfoPrograma ) #self.terminosUso_staticText3.Bind( wx.EVT_LEFT_DOWN, self.TerminosdeUso ) self.autor_staticText25.Bind( wx.EVT_LEFT_DOWN, self.author )
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.TAB_TRAVERSAL ) self.db = tgpos_db.tgpos_DB() self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) bSizer11 = wx.BoxSizer( wx.VERTICAL ) self.nombre_staticText = wx.StaticText( self, wx.ID_ANY, u"Nombre Completo:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.nombre_staticText.Wrap( -1 ) self.nombre_staticText.SetFont( wx.Font( 10, 74, 90, 90, False, "Tahoma" ) ) bSizer11.Add( self.nombre_staticText, 0, wx.ALL, 5 ) self.nombre_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,-1 ), 0 ) self.nombre_textCtrl.SetFont( wx.Font( 10, 74, 90, 92, False, "Tahoma" ) ) self.nombre_textCtrl.SetBackgroundColour( INPUTBG ) self.nombre_textCtrl.SetForegroundColour( INPUTFG ) bSizer11.Add( self.nombre_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.username_staticText = wx.StaticText( self, wx.ID_ANY, u"Nombre de Usuario:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.username_staticText.Wrap( -1 ) self.username_staticText.SetFont( wx.Font( 10, 74, 90, 90, False, "Tahoma" ) ) bSizer11.Add( self.username_staticText, 0, wx.ALL, 5 ) self.username_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), 0 ) self.username_textCtrl.SetFont( wx.Font( 10, 74, 90, 92, False, "Tahoma" ) ) self.username_textCtrl.SetBackgroundColour( INPUTBG ) self.username_textCtrl.SetForegroundColour( INPUTFG ) bSizer11.Add( self.username_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.password_staticText = wx.StaticText( self, wx.ID_ANY, u"Contraseña: ", wx.DefaultPosition, wx.DefaultSize, 0 ) self.password_staticText.Wrap( -1 ) self.password_staticText.SetFont( wx.Font( 10, 74, 90, 90, False, "Tahoma" ) ) bSizer11.Add( self.password_staticText, 0, wx.ALL, 5 ) self.password_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 300,-1 ), wx.TE_PASSWORD ) self.password_textCtrl.SetFont( wx.Font( 8, 74, 90, 92, False, "Tahoma" ) ) self.password_textCtrl.SetBackgroundColour( INPUTBG ) self.password_textCtrl.SetForegroundColour( INPUTFG ) bSizer11.Add( self.password_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) level_choiceChoices = [ u"Usuario Estandar", u"Administrador" ] self.level_choice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, level_choiceChoices, 0 ) self.level_choice.SetSelection( 0 ) self.level_choice.SetFont( wx.Font( 10, 74, 90, 92, False, "Tahoma" ) ) self.level_choice.SetBackgroundColour( INPUTBG ) self.level_choice.SetForegroundColour( INPUTFG ) bSizer11.Add( self.level_choice, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer4 = wx.GridSizer( 0, 2, 0, 0 ) self.agregar_button = wx.Button( self, wx.ID_ANY, u"Agregar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.agregar_button.SetFont( wx.Font( 10, 74, 90, 92, False, "Tahoma" ) ) self.agregar_button.SetBackgroundColour( BUTTONBG ) self.agregar_button.SetForegroundColour( BUTTONFG ) gSizer4.Add( self.agregar_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.cancelar_button = wx.Button( self, wx.ID_ANY, u"Cancelar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.cancelar_button.SetFont( wx.Font( 10, 74, 90, 92, False, "Tahoma" ) ) self.cancelar_button.SetBackgroundColour( BUTTONBG ) self.cancelar_button.SetForegroundColour( BUTTONFG ) gSizer4.Add( self.cancelar_button, 0, wx.ALL, 5 ) bSizer11.Add( gSizer4, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer11 ) self.Layout() bSizer11.Fit( self ) self.Centre( wx.BOTH ) # Connect Events self.agregar_button.Bind( wx.EVT_BUTTON, self.agregarUsuario ) self.cancelar_button.Bind( wx.EVT_BUTTON, self.CancelarButton )
# -*- coding: utf-8 -*- ########################################################################### ## Andy Alonzo y Alonzo ## http://tecnogenios.tk ## http://aaya.tk ## TecnoGenios POS ## Sistema de gestion de tiendas o empresas ########################################################################### # Contains the print functions for TecnoGeniosPOS import os,sys from fpdf import FPDF import tgpos_db db = tgpos_db.tgpos_DB() class Printer(): def __init__(self): pass def ResourcePath(self, filename): 'Returns the relative path to any file in the resources directory.' if hasattr(sys, 'frozen'): filepath = os.path.join('resources', filename) else: filepath = os.path.join(os.path.split(__file__)[0], 'resources', filename) print os.path.join(os.path.dirname(sys.executable), filepath) return os.path.join(os.path.dirname(sys.executable), filepath) def formatCant(self, cant): import config
def __init__(self, parent, *args, **kwargs): super(AddDlg, self).__init__(parent, *args, **kwargs) font1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) self.Size = (500, 600) # Objetos complementarios #------------------------------------------------------------------ self.config = config.Configuration() self.db = tgpos_db.tgpos_DB() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] accel_tbl = wx.AcceleratorTable( [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, kESCAPE)] ) self.SetAcceleratorTable(accel_tbl) #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) sizer = wx.BoxSizer(wx.VERTICAL) #------------------------------------------------------------------ hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.add_label = wx.StaticText(self, -1, 'Agregar nuevo Producto') self.add_label.SetFont(font1) hbox1.Add(self.add_label, 0) sizer.Add(hbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.TOP|wx.BOTTOM, 5) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.item_label = wx.StaticText(self, -1, 'Nombre: *', size=(130, -1)) self.item_label.SetFont(font2) self.item_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.item_input.SetBackgroundColour( INPUTBG ) self.item_input.SetForegroundColour( INPUTFG ) hbox2.Add(self.item_label, 0, wx.TOP|wx.RIGHT, 5) hbox2.Add(self.item_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.parte_label = wx.StaticText(self, -1, 'Codigo de Parte: *', size=(130, -1)) self.parte_label.SetFont(font2) self.parte_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.parte_input.SetBackgroundColour(INPUTBG) self.parte_input.SetForegroundColour(INPUTFG) hbox2.Add(self.parte_label, 0, wx.TOP|wx.RIGHT, 5) hbox2.Add(self.parte_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.barra_label = wx.StaticText(self, -1, 'Codigo de Barra: **', size=(130, -1)) self.barra_label.SetFont(font2) self.barra_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER|wx.TE_PROCESS_ENTER) self.barra_input.SetBackgroundColour(INPUTBG) self.barra_input.SetForegroundColour(INPUTFG) hbox2.Add(self.barra_label, 0, wx.TOP|wx.RIGHT, 5) hbox2.Add(self.barra_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox4 = wx.BoxSizer(wx.HORIZONTAL) self.cant_label = wx.StaticText(self, -1, 'Cantidad: *', size=(130, -1)) self.cant_label.SetFont(font2) self.cant_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.cant_input.SetBackgroundColour(INPUTBG) self.cant_input.SetForegroundColour(INPUTFG) hbox4.Add(self.cant_label, 0, wx.TOP|wx.RIGHT, 5) hbox4.Add(self.cant_input, 1) sizer.Add(hbox4, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# hbox33 = wx.BoxSizer(wx.HORIZONTAL) self.priceC_label = wx.StaticText(self, -1, 'Precio de compra *' +' ('+self.c_symbol+')', size=(130, -1)) self.priceC_label.SetFont(font2) self.priceC_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.priceC_input.SetBackgroundColour(INPUTBG) self.priceC_input.SetForegroundColour(INPUTFG) hbox33.Add(self.priceC_label, 0, wx.TOP|wx.RIGHT, 5) hbox33.Add(self.priceC_input, 1) sizer.Add(hbox33, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.price_label = wx.StaticText(self, -1, 'Precio *' +' ('+self.c_symbol+')', size=(130, -1)) self.price_label.SetFont(font2) self.price_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER) self.price_input.SetBackgroundColour(INPUTBG) self.price_input.SetForegroundColour(INPUTFG) hbox3.Add(self.price_label, 0, wx.TOP|wx.RIGHT, 5) hbox3.Add(self.price_input, 1) sizer.Add(hbox3, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) MultiContenedor = wx.BoxSizer( wx.VERTICAL ) self.checkMulti = wx.CheckBox( self, wx.ID_ANY, u"Precios Multiples", wx.DefaultPosition, wx.DefaultSize, 0 ) MultiContenedor.Add( self.checkMulti, 0, wx.ALL, 5 ) bSizer21 = wx.BoxSizer( wx.HORIZONTAL ) self.descLabel1 = wx.StaticText( self, wx.ID_ANY, u"#1 Descripcion", wx.DefaultPosition, wx.DefaultSize, 0 ) self.descLabel1.Wrap( -1 ) self.descLabel1.SetToolTipString( u"Descripcion del precio, Ej. Mayorista, Preferido, etc." ) bSizer21.Add( self.descLabel1, 0, wx.ALL, 5 ) self.descripcion1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.descripcion1.Enable( False ) bSizer21.Add( self.descripcion1, 0, wx.ALL, 5 ) self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"Cantidad", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText31.Wrap( -1 ) self.m_staticText31.SetToolTipString( u"Cantidad Minima para que aplique este precio" ) bSizer21.Add( self.m_staticText31, 0, wx.ALL, 5 ) self.cantidad1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.cantidad1.Enable( False ) bSizer21.Add( self.cantidad1, 0, wx.ALL, 5 ) self.precioLabel1 = wx.StaticText( self, wx.ID_ANY, u"Precio", wx.DefaultPosition, wx.DefaultSize, 0 ) self.precioLabel1.Wrap( -1 ) self.precioLabel1.SetToolTipString( u"El precio que tendrán los productos al llegar a la cantidad minima indicada anteriormente" ) bSizer21.Add( self.precioLabel1, 0, wx.ALL, 5 ) self.precio1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.precio1.Enable( False ) bSizer21.Add( self.precio1, 0, wx.ALL, 5 ) MultiContenedor.Add( bSizer21, 1, wx.EXPAND, 5 ) bSizer22 = wx.BoxSizer( wx.HORIZONTAL ) self.descLabel2 = wx.StaticText( self, wx.ID_ANY, u"#2 Descripcion", wx.DefaultPosition, wx.DefaultSize, 0 ) self.descLabel2.Wrap( -1 ) self.descLabel2.SetToolTipString( u"Descripcion del precio, Ej. Mayorista, Preferido, etc." ) bSizer22.Add( self.descLabel2, 0, wx.ALL, 5 ) self.descripcion2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.descripcion2.Enable( False ) bSizer22.Add( self.descripcion2, 0, wx.ALL, 5 ) self.cantLabel2 = wx.StaticText( self, wx.ID_ANY, u"Cantidad", wx.DefaultPosition, wx.DefaultSize, 0 ) self.cantLabel2.Wrap( -1 ) self.cantLabel2.SetToolTipString( u"Cantidad Minima para que aplique este precio" ) bSizer22.Add( self.cantLabel2, 0, wx.ALL, 5 ) self.cantidad2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.cantidad2.Enable( False ) bSizer22.Add( self.cantidad2, 0, wx.ALL, 5 ) self.precioLabel2 = wx.StaticText( self, wx.ID_ANY, u"Precio", wx.DefaultPosition, wx.DefaultSize, 0 ) self.precioLabel2.Wrap( -1 ) self.precioLabel2.SetToolTipString( u"El precio que tendrán los productos al llegar a la cantidad minima indicada anteriormente" ) bSizer22.Add( self.precioLabel2, 0, wx.ALL, 5 ) self.precio2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.precio2.Enable( False ) bSizer22.Add( self.precio2, 0, wx.ALL, 5 ) MultiContenedor.Add( bSizer22, 1, wx.EXPAND, 5 ) bSizer23 = wx.BoxSizer( wx.HORIZONTAL ) self.descLabel3 = wx.StaticText( self, wx.ID_ANY, u"#3 Descripcion", wx.DefaultPosition, wx.DefaultSize, 0 ) self.descLabel3.Wrap( -1 ) self.descLabel3.SetToolTipString( u"Descripcion del precio, Ej. Mayorista, Preferido, etc." ) bSizer23.Add( self.descLabel3, 0, wx.ALL, 5 ) self.descripcion3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.descripcion3.Enable( False ) bSizer23.Add( self.descripcion3, 0, wx.ALL, 5 ) self.cantLabel1 = wx.StaticText( self, wx.ID_ANY, u"Cantidad", wx.DefaultPosition, wx.DefaultSize, 0 ) self.cantLabel1.Wrap( -1 ) self.cantLabel1.SetToolTipString( u"Cantidad Minima para que aplique este precio" ) bSizer23.Add( self.cantLabel1, 0, wx.ALL, 5 ) self.cantidad3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.cantidad3.Enable( False ) bSizer23.Add( self.cantidad3, 0, wx.ALL, 5 ) self.precioLabel3 = wx.StaticText( self, wx.ID_ANY, u"Precio", wx.DefaultPosition, wx.DefaultSize, 0 ) self.precioLabel3.Wrap( -1 ) self.precioLabel3.SetToolTipString( u"El precio que tendrán los productos al llegar a la cantidad minima indicada anteriormente" ) bSizer23.Add( self.precioLabel3, 0, wx.ALL, 5 ) self.precio3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.precio3.Enable( False ) bSizer23.Add( self.precio3, 0, wx.ALL, 5 ) MultiContenedor.Add( bSizer23, 1, wx.EXPAND, 5 ) sizer.Add(MultiContenedor, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# hbox5 = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer.Add(hbox5, 1, wx. ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) sizer.Add((-1, 10)) self.SetSizer(sizer) self.item_input.SetFocus() # Set Event Bindings #------------------------------------------------------------------ self.item_input.Bind(wx.EVT_KILL_FOCUS, self.nombreClean) self.price_input.Bind(wx.EVT_KEY_UP, self.ValidatePrice) self.priceC_input.Bind(wx.EVT_KEY_UP, self.ValidatePriceC) self.cant_input.Bind(wx.EVT_KEY_UP, self.ValidateCant) self.parte_input.Bind(wx.EVT_KEY_UP, self.parteCheck) self.parte_input.Bind(wx.EVT_KILL_FOCUS, self.parteClean) self.price_input.Bind(wx.EVT_KILL_FOCUS, self.PrClean) self.barra_input.Bind(wx.EVT_KILL_FOCUS, self.barraClean) self.priceC_input.Bind(wx.EVT_KILL_FOCUS, self.PrCleanC) self.barra_input.Bind( wx.EVT_TEXT_ENTER, self.BarraFormat ) self.parte_input.Bind( wx.EVT_KILL_FOCUS, self.ValidateParte ) self.barra_input.Bind( wx.EVT_KILL_FOCUS, self.ValidateBarra ) self.checkMulti.Bind( wx.EVT_CHECKBOX, self.MultipreciosShow ) self.Bind(wx.EVT_MENU, self.Cerrar, id=kESCAPE) self.precio1.Bind(wx.EVT_KEY_UP, self.ValidatePriceM) self.precio2.Bind(wx.EVT_KEY_UP, self.ValidatePriceM) self.precio3.Bind(wx.EVT_KEY_UP, self.ValidatePriceM) self.precio1.Bind(wx.EVT_KILL_FOCUS, self.PrCleanM) self.precio2.Bind(wx.EVT_KILL_FOCUS, self.PrCleanM) self.precio3.Bind(wx.EVT_KILL_FOCUS, self.PrCleanM) self.cantidad1.Bind(wx.EVT_KEY_UP, self.ValidateCantM) self.cantidad2.Bind(wx.EVT_KEY_UP, self.ValidateCantM) self.cantidad3.Bind(wx.EVT_KEY_UP, self.ValidateCantM)
def __init__(self, parent, *args, **kwargs): super(EditstockDlg, self).__init__(parent, *args, **kwargs) # Set styles for the dialog #------------------------------------------------------------------ font_1 = wx.Font(20, wx.SWISS, wx.NORMAL, wx.NORMAL) font_2 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL) self.Size = (500, 260) # Get necessary configuration information #------------------------------------------------------------------ self.config = config.Configuration() self.cSettings = self.config.cCurrency() self.c_symbol = self.cSettings[0] self.c_dec = self.cSettings[1] self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) # Dialog Sizer #------------------------------------------------------------------ sizer = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.edit_label = wx.StaticText(self, -1, 'Agregar Elementos a un producto') self.edit_label.SetFont(font_1) hbox1.Add(self.edit_label, 0) sizer.Add(hbox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.TOP, 5) #--# sizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND) #--# hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.item_label = wx.StaticText(self, -1, 'Nombre: ', size=(400, -1)) self.item_label.SetFont(font_2) #self.item_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER|wx.TE_READONLY) hbox2.Add(self.item_label, 0, wx.RIGHT|wx.TOP, 5) #hbox2.Add(self.item_input, 1) sizer.Add(hbox2, 0, wx.EXPAND|wx.ALL, 10) #--# hbox3 = wx.BoxSizer(wx.HORIZONTAL) self.price_label = wx.StaticText(self, -1, 'Precio: ', size=(400, -1)) self.price_label.SetFont(font_2) #self.price_input = wx.TextCtrl(self, -1, style=wx.TE_CENTER|wx.TE_READONLY) hbox3.Add(self.price_label, 0, wx.RIGHT|wx.TOP, 5) #hbox3.Add(self.price_input, 1) sizer.Add(hbox3, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) hbox5 = wx.BoxSizer(wx.HORIZONTAL) self.stock_label = wx.StaticText(self, -1, 'Inventario: ', size=(240, -1)) self.stock_label.SetFont(font_2) self.stock_input = wx.TextCtrl(self, -1, style=wx.TE_LEFT) self.stock_input.SetBackgroundColour(INPUTBG) self.stock_input.SetForegroundColour(INPUTFG) hbox5.Add(self.stock_label, 0, wx.RIGHT|wx.TOP, 5) hbox5.Add(self.stock_input, 1) sizer.Add(hbox5, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, 10) #--# #hbox4 = wx.BoxSizer(wx.HORIZONTAL) #self.bulk = wx.CheckBox(self, -1, 'Bulk Item') #hbox4.Add(self.bulk, 0) #sizer.Add(hbox4, 0, wx.LEFT|wx.RIGHT, 10) #--# hbox5 = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer.Add(hbox5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 10) sizer.Add((-1, 10)) self.SetSizer(sizer) # Bindings #------------------------------------------------------------------ self.stock_input.Bind(wx.EVT_KEY_UP, self.ValidateCant)
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 550,430 ), style = wx.DEFAULT_DIALOG_STYLE ) self.db = tgpos_db.tgpos_DB() #importar base de datos self.db = tgpos_db.tgpos_DB() #Importar y definir las variables para la apariencia Tema = self.db.posTema() tempcolor = Tema[1] BGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[0] FGCOLOR = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[2] BUTTONFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[3] BUTTONBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[4] INPUTBG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) tempcolor = Tema[5] INPUTFG = wx.Colour( tempcolor[0], tempcolor[1], tempcolor[2] ) TRANSPARENCY = Tema[6] self.SetBackgroundColour( BGCOLOR ) self.SetForegroundColour( FGCOLOR ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) self.SetFont( wx.Font( 13, 70, 90, 90, False, wx.EmptyString ) ) bSizer1 = wx.BoxSizer( wx.VERTICAL ) self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Direccion:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText1.Wrap( -1 ) bSizer1.Add( self.m_staticText1, 0, wx.ALL, 5 ) self.dir_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,50 ), wx.TE_MULTILINE ) self.dir_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.dir_textCtrl.SetBackgroundColour( INPUTBG ) self.dir_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.dir_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Tel:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText2.Wrap( -1 ) bSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 ) self.tel_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,30 ), 0 ) self.tel_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.tel_textCtrl.SetBackgroundColour( INPUTBG ) self.tel_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.tel_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Email:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText5.Wrap( -1 ) bSizer1.Add( self.m_staticText5, 0, wx.ALL, 5 ) self.email_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,30 ), 0 ) self.email_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.email_textCtrl.SetBackgroundColour( INPUTBG ) self.email_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.email_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Pagina web:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText3.Wrap( -1 ) bSizer1.Add( self.m_staticText3, 0, wx.ALL, 5 ) self.Web_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,30 ), 0 ) self.Web_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.Web_textCtrl.SetBackgroundColour( INPUTBG ) self.Web_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.Web_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) self.nit_staticText = wx.StaticText( self, wx.ID_ANY, u"NIT:", wx.DefaultPosition, wx.DefaultSize, 0 ) self.nit_staticText.Wrap( -1 ) bSizer1.Add( self.nit_staticText, 0, wx.ALL, 5 ) self.nit_textCtrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 400,30 ), 0 ) self.nit_textCtrl.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.nit_textCtrl.SetBackgroundColour( INPUTBG ) self.nit_textCtrl.SetForegroundColour( INPUTFG ) bSizer1.Add( self.nit_textCtrl, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) gSizer1 = wx.GridSizer( 0, 2, 0, 0 ) self.ok_button = wx.Button( self, wx.ID_ANY, u"Modificar", wx.DefaultPosition, wx.DefaultSize, 0 ) self.ok_button.SetFont( wx.Font( 12, 74, 90, 90, False, "Tahoma" ) ) self.ok_button.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) ) self.ok_button.SetBackgroundColour( BUTTONBG ) self.ok_button.SetForegroundColour( BUTTONFG ) gSizer1.Add( self.ok_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 ) bSizer1.Add( gSizer1, 1, wx.EXPAND, 5 ) self.SetSizer( bSizer1 ) self.Layout() self.Centre( wx.BOTH ) #Agregar datos a los objetos global datosTienda datosTienda = [] datosTienda0 = self.db.SelectConfigNS() for i in datosTienda0: try: datosTienda.append(self.normalizar(i)) except: datosTienda.append(i) #self.name_textCtrl.SetValue(datosTienda[1]) #self.slogan_textCtrl.SetValue(datosTienda[2]) self.dir_textCtrl.SetValue(self.normalizar(datosTienda[5])) self.tel_textCtrl.SetValue(datosTienda[3]) self.Web_textCtrl.SetValue(datosTienda[4]) self.email_textCtrl.SetValue(datosTienda[7]) self.nit_textCtrl.SetValue(datosTienda[8]) # Connect Events self.ok_button.Bind( wx.EVT_BUTTON, self.ok )