def OnSelectSchool(self, evt): school_id = fetch.cmbID(self.choice_schools) sql = "SELECT id, name \ FROM forms \ WHERE school_id = %d \ AND schYr = %d" % (school_id, gVar.schYr) loadCmb.gen(self.choice_forms, sql) self.displayData()
def loadLevels(self): school_id = fetch.cmbID(self.choice_schools) sql = "SELECT id, name \ FROM course_levels \ WHERE school_id = %d \ GROUP BY level \ ORDER BY level" % (school_id,) loadCmb.gen(self.choice_levels, sql) loadCmb.levels_forSchool(self.choice_levels, school_id)
def _do_main(self): sql = "SELECT id, name FROM acc_accounts " loadCmb.gen(self.choice_account, sql) #rintsql self.dateTo = datetime.date.today() self.dateFrom = self.dateTo - datetime.timedelta(days=365) self.datepicker_ctrl_from.SetValue(self.dateFrom) self.datepicker_ctrl_to.SetValue(self.dateTo)
def loadCourses(self): ##rint'loadCourses' school_id = fetch.cmbID(self.choice_schools) sql = "SELECT c.id, c.name \ FROM courses c \ JOIN courses_by_year cby ON cby.course_id = c.id \ WHERE c.school_id = %d \ AND cby.schYr = %d" % (school_id, gVar.schYr) ##rintsql loadCmb.gen(self.choice_courses, sql)
def loadAccounts(self): #FORMAT(IIF (d.Debet = True, d.Jumlah,), '#,##0') sql = "SELECT Kode, Kode & Nama AS title FROM Perkiraan ORDER BY Nama" sql = "SELECT Kode, \ Mid(Kode, 1,1) &'.'& \ Mid(Kode, 2,2) &'.'& \ Mid(Kode, 4,2) &'.'& \ Mid(Kode, 6,2) &': '& Nama AS title\ FROM Perkiraan ORDER BY Kode" loadCmb.gen(self.choice_credits, sql, ' ') loadCmb.gen(self.choice_debits, sql, ' ')
def loadForms(self): school_id = fetch.cmbID(self.choice_schools) level_id = fetch.cmbID(self.choice_levels) level = fetch.level_level_id(level_id) if self.checkbox_filter_by_level.GetValue(): sql = "SELECT id, name \ FROM forms \ WHERE level = %d \ AND schYr = %d" % (level, gVar.schYr) else: sql = "SELECT id, name \ FROM forms \ WHERE school_id = %d \ AND schYr = %d" % (school_id, gVar.schYr) loadCmb.gen(self.choice_forms, sql)
def __do_main(self): self.dateTo = datetime.date.today() self.dateFrom = self.dateTo - datetime.timedelta(days=365) self.datepicker_ctrl_from.SetValue(self.dateFrom) self.datepicker_ctrl_to.SetValue(self.dateTo) headings = (('id',0), ('Receipt No.',100), ('Date',100), ('Student Name',200), ('Form',100), ('Total',100, wx.LIST_FORMAT_RIGHT)) self.vList.SetColumns(headings) sql = "SELECT id, item_name FROM invoice_items" loadCmb.gen(self.choice_pay_type, sql, 'All') self.displayData()
def OnCheckSchool(self, evt): if self.checkbox_filter_by_school.GetValue(): sql = "SELECT id, school_type \ FROM schools \ WHERE isCK = 1" loadCmb.gen(self.choice_schools, sql) self.loadCourses() self.choice_schools.Show() self.checkbox_filter_by_course.Show() if self.checkbox_filter_by_course.GetValue(): self.choice_courses.Show() else: self.choice_schools.Clear() self.checkbox_filter_by_course.Hide() self.choice_courses.Hide() self.choice_schools.Hide() self.Layout() self.displayData()
def OnCheckSchool(self, evt): #rint'Filter > OnCheckSchool' if self.checkbox_filter_by_school.GetValue(): self.choice_schools.Show() sql = "SELECT id, name \ FROM schools \ WHERE isCK = 1" #rintsql loadCmb.gen(self.choice_schools, sql) self.checkbox_filter_by_level.Show() self.OnCheckLevel(wx.Event) else: self.checkbox_filter_by_form.SetValue(False) self.checkbox_filter_by_level.SetValue(False) self.checkbox_filter_by_form.Hide() self.checkbox_filter_by_level.Hide() self.choice_levels.Hide() self.choice_forms.Hide() self.choice_schools.Hide() self.Layout() self.displayData()
def loadDivisions(self): sql = "SELECT Kode, Nama FROM Divisi ORDER BY Nama" loadCmb.gen(self.choice_division, sql, ' ')
def loadSuppliers(self): sql = "SELECT Kode, Nama FROM Suplier ORDER BY Nama" loadCmb.gen(self.choice_supplier, sql, ' ')