コード例 #1
0
ファイル: _InvoiceItem.py プロジェクト: ckSchool/bucky
 def isMonthly(self, iid):
     sql = "SELECT * \
              FROM acc_products \
             WHERE id = %d \
               AND recurring_monthly = 1" % iid
     
     if fetch.getCount(sql)>0:
         self.Monthly = True
     else:
         self.Monthly = False
         
     return self.Monthly
コード例 #2
0
ファイル: _Transaction2.py プロジェクト: ckSchool/bucky
 def OnNewDivision(self, evt):
     dlg = wx.TextEntryDialog(self, 'division name', 'New division name', '')
     if dlg.ShowModal() == wx.ID_OK:
         new_name = dlg.GetValue().strip()
         if new_name:
             sql = "SELECT name \
                      FROM acc_divisions \
                     WHERE name = '%s'" % new_name
             if fetch.getCount(sql):
                 msg = "Sorry division '%s' already exists" % new_name
                 fetch.msg(msg)
             else:
                 sql = "INSERT INTO acc_divisions \
                                    (name) \
                             VALUES ('%s')" % (new_name)
                 #rintsql
                 fetch.updateDB(sql)
                 self.loadDivisions()
                 loadCmb.restore_str(self.choice_division, new_name)
     dlg.Destroy()
コード例 #3
0
ファイル: _Transaction2.py プロジェクト: ckSchool/bucky
    def OnNewSupplier(self, evt):
        #rint"open dlgTextEntry 'new supplier' "
        dlg = wx.TextEntryDialog(self, 'Supplier Name', 'New Supplier Name', '')
 
        if dlg.ShowModal() == wx.ID_OK:
            new_name = dlg.GetValue().strip()
            if new_name:
                sql = "SELECT name \
                         FROM acc_suppliers \
                        WHERE name = '%s'" % new_name
                if fetch.getCount(sql):
                    msg = "Sorry supplier '%s' already exists" % new_name
                    fetch.msg(msg)
                else:
                    sql = "INSERT INTO acc_suppliers \
                                       (name) \
                                VALUES ('%s')" % new_name
                    fetch.updateDB(sql)
                    self.loadSuppliers()
                    loadCmb.restore_str(self.choice_supplier, new_name)