def __init__(self, *args, **kwds): kwds["style"] = wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) self.panel_inv_heading = wx.Panel(self, -1) self.label_qnty = wx.StaticText(self.panel_inv_heading, -1, "Qnty Account") self.label_description = wx.StaticText(self.panel_inv_heading, -1, "Description") self.panel_header_spc = wx.Panel(self.panel_inv_heading, -1) self.label_price = wx.StaticText(self.panel_inv_heading, -1, "Price") self.label_mTotal = wx.StaticText(self.panel_inv_heading, -1, "Total") self.panel_invoice_items = wx.Panel(self, -1) self.static_line = wx.StaticLine(self, -1) self.panel_bottom = wx.Panel(self, -1) self.button_new_item = wx.Button(self.panel_bottom, -1, "+") self.choice_product = wx.Choice(self.panel_bottom, -1, choices=[]) self.label_l_tot = wx.StaticText(self.panel_bottom, -1, "Total") self.text_ctrl_total = NumCtrl(self.panel_bottom, -1, "0", style= wx.TE_READONLY) self.button_enter = wx.Button(self, -1, "Enter Invoice") pub.subscribe(self.updateTotal, 'update.invTotal') self.Bind(wx.EVT_BUTTON, self.OnNewItem, self.button_new_item) self.Bind(wx.EVT_BUTTON, self.OnEnter, self.button_enter) self.__set_properties() self.__do_layout() self.invoice_id = 0 sql = "SELECT id, name FROM products" loadCmb.gen(self.choice_product, sql)
def loadAccounts(self): sql = " SELECT id, CONCAT(\ Mid(code, 1,1), '.', \ Mid(code, 2,2), '.', \ Mid(code, 4,2), '.', \ Mid(code, 6,2), ': ', name) AS title\ FROM acc_accounts ORDER BY id" #rintsql loadCmb.gen(self.choice_credits, sql, ' ') loadCmb.gen(self.choice_debits, sql, ' ')
def loadAccounts(self): sql = "SELECT id, name FROM acc_accounts ORDER BY name" loadCmb.gen(self.choice_debits, sql)
def loadDivisions(self): #rint'loadDivisions' sql = "SELECT id, name \ FROM acc_divisions ORDER BY name" loadCmb.gen(self.choice_division, sql, ' ')
def loadSuppliers(self): #rint'loadSuppliers' sql = "SELECT id, name \ FROM acc_suppliers ORDER BY name" loadCmb.gen(self.choice_supplier, sql, ' ')