本文整理匯總了Python中DBManager.DBManager.getEgresos方法的典型用法代碼示例。如果您正苦於以下問題:Python DBManager.getEgresos方法的具體用法?Python DBManager.getEgresos怎麽用?Python DBManager.getEgresos使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.getEgresos方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: CanchasTabFinanzas
# 需要導入模塊: from DBManager import DBManager [as 別名]
# 或者: from DBManager.DBManager import getEgresos [as 別名]
class CanchasTabFinanzas(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY)
self.DBM = DBManager()
self.vbox = wx.BoxSizer( wx.VERTICAL )
hbox1 = wx.BoxSizer( wx.HORIZONTAL )
image1 = wx.Image('calendar.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
btn_cal = wx.BitmapButton(self, id=-1, bitmap=image1, size=(40,30))
image2 = wx.Image('print.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
btn_prt = wx.BitmapButton(self, id=-1, bitmap=image2, size=(40,30))
image3 = wx.Image('money.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
btn_inicio = wx.BitmapButton(self, id=-1, bitmap=image3, size=(40,30))
image4 = wx.Image('cashRegister.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
btn_gasto = wx.BitmapButton(self, id=-1, bitmap=image4, size=(40,30))
#image3 = wx.Image('venta.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap()
#btn_vta = wx.BitmapButton(self, id=-1, bitmap=image3, size=(40,30))
self.desde = None
self.hasta = None
self.Bind(wx.EVT_BUTTON, self.OnCalendar, btn_cal)
#self.Bind(wx.EVT_BUTTON, self.OnVenta, btn_vta)
self.Bind(wx.EVT_BUTTON, self.OnPrint, btn_prt)
self.Bind(wx.EVT_BUTTON, self.OnInicio, btn_inicio)
self.Bind(wx.EVT_BUTTON, self.OnGasto, btn_gasto)
hbox1.Add(btn_cal)
hbox1.Add(btn_prt)
hbox1.Add(btn_inicio)
hbox1.Add(btn_gasto)
#hbox1.Add(btn_vta)
self.vbox.Add(hbox1)
self.hbox2 = wx.BoxSizer( wx.HORIZONTAL )
self.list_ctrl = wx.ListCtrl(self, style=wx.LC_REPORT)
self.hbox2.Add(self.list_ctrl, 2, flag=wx.EXPAND)
self.vbox.Add(self.hbox2, 2, wx.EXPAND)
self.TOTAL = 0
self.SetSizer(self.vbox)
self.__generateContent()
Publisher().subscribe(self.OnExternalCalSelected, ("dates"))
Publisher().subscribe(self.OnTabSelected , ("tab_cuentas_update"))
def __generateContent( self, desde=None, hasta=None):
cuentas = self.DBM.getCuentas(desde, hasta)
egresos = self.DBM.getEgresos(desde, hasta)
index = 0
self.list_ctrl.InsertColumn(0, "Hora")
self.list_ctrl.InsertColumn(1, "Producto")
self.list_ctrl.InsertColumn(2, "Cantidad")
self.list_ctrl.InsertColumn(3, "Precio")
self.list_ctrl.InsertColumn(4, "Total")
for cuenta in cuentas+egresos:
self.list_ctrl.InsertStringItem(index, cuenta[0])
self.list_ctrl.SetStringItem(index, 1, cuenta[1])
if cuenta[1] == "Inicio de caja":
self.list_ctrl.SetStringItem(index, 2, '-')
self.list_ctrl.SetStringItem(index, 3, '-')
else:
self.list_ctrl.SetStringItem(index, 3, "$ %s" % str(cuenta[3]))
self.list_ctrl.SetStringItem(index, 2, str(cuenta[2]))
self.list_ctrl.SetStringItem(index, 4, "$ %s" % str(cuenta[4]))
self.TOTAL += cuenta[4]
if index % 2:
self.list_ctrl.SetItemBackgroundColour(index, "white")
else:
self.list_ctrl.SetItemBackgroundColour(index, "gray")
index += 1
self.list_ctrl.InsertStringItem(index, 'TOTAL')
self.list_ctrl.SetStringItem(index, 1, '')
self.list_ctrl.SetStringItem(index, 2, '')
self.list_ctrl.SetStringItem(index, 3, '')
self.list_ctrl.SetStringItem(index, 4, '$ %s' % str(self.TOTAL))
self.list_ctrl.SetItemBackgroundColour(index, "red")
self.list_ctrl.SetItemTextColour(index, "yellow")
def OnExternalCalSelected( self, evt ):
desde = evt.data[0].__str__().split(' ')[0]
hasta = evt.data[1].__str__().split(' ')[0]
self.desde = desde
self.hasta = hasta
self.TOTAL = 0
self.list_ctrl.ClearAll()
self.__generateContent( desde, hasta )
def OnGasto( self, evt ):
Gasto(self, -1, "Egreso de caja")
self.list_ctrl.ClearAll()
self.__generateContent()
#.........這裏部分代碼省略.........