def doMonthly(self, qnty): self.monthTo = self.monthFrom + qnty -1 if self.monthTo > 12: self.num_ctrl_qnty.SetValue(1) self.monthTo = self.monthFrom + 1 MonthFrom = gVar.monthNames[self.monthFrom] description, price = fetch.product_details(self.product_id) if qnty == 1: description = "%s : %s" % (description, MonthFrom) else: MonthTo = gVar.monthNames[self.monthTo] description = "%s : %s to %s" % (description, MonthFrom, MonthTo) self.text_ctrl_description.SetValue(description)
def displayData(self, iid, student_id): #rint'displayData', iid, student_id self.product_id = iid description, price = fetch.product_details(iid) self.student_id = student_id NoInduk = fetch.NoInduk(student_id, gVar.schYr) if self.isMonthly(iid): monthFrom = self.getMonthFrom() #rint'gVar.monthNames[monthFrom]', gVar.monthNames[monthFrom] description += ' : ' + gVar.monthNames[monthFrom] self.text_ctrl_description.SetValue(description) #self.num_ctrl_qnty.SetValue(1) #rint'price', price self.num_ctrl_price.SetValue(price)