def ProcessRow(self, rowdata): #(ID, VaccinationID, Date, Amount, BatchNo, WhereTo, AppointmentID) date = miscmethods.GetDateFromSQLDate(rowdata[1]) date = miscmethods.FormatDate(date, self.localsettings) name = rowdata[2] position = rowdata[3] subject = rowdata[4] note = rowdata[5] linkinfo = rowdata[10] if str(rowdata[6]) != "None": removed = miscmethods.GetDateFromSQLDate(rowdata[6]) removed = miscmethods.FormatDate(removed, self.localsettings) #isremoved = "<font color=red size=3><b>" + self.parent.GetLabel("removedlabel") + "</b></font>" else: removed = "" output = ((rowdata[0], date, name, position, linkinfo, subject, removed), -1) return output
def ProcessRow(self, rowdata): filename = rowdata[3] description = rowdata[4] uploaddate = rowdata[6].split("$$$")[0] uploaddate = miscmethods.GetDateFromSQLDate(uploaddate) uploaddate = miscmethods.FormatDate(uploaddate, self.localsettings) filesize = str(rowdata[5]) + " KB" if description == "": filetext = filename else: if filename.__contains__("."): fileextension = filename.split(".")[-1] else: fileextension = "" filetext = description + " (" + fileextension + ")" output = ((rowdata[0], uploaddate, filetext, filesize), -1) return output
def OnGetItem(self, n): if len(self.htmllist) != 0: name = self.htmllist[n][0] surname = self.htmllist[n][1] vaccine = self.htmllist[n][2] date = self.htmllist[n][4] date = miscmethods.GetDateFromSQLDate(date) date = miscmethods.FormatDate(date, self.localsettings) return "<table width=100% cellspacing=0 cellpadding=0><tr><td align=left><font color=blue size=5><b>" + name + " " + surname + "</b> - " + vaccine + "</font></td><td align=right><font color=red size=5><b>" + str( date) + "</b></font> </td></tr></table>"
def EditVetForm(self, ID): panel = ID.GetEventObject().panel listbox = panel.listbox notebook = self.GetGrandParent().GetParent() appointmentid = listbox.htmllist[listbox.GetSelection()][3] appointmentdata = appointmentmethods.AppointmentSettings( self.localsettings, False, appointmentid) stayingid = appointmentdata.staying animalid = appointmentdata.animalid today = datetime.date.today() appointmentdate = miscmethods.GetDateFromSQLDate(appointmentdata.date) if appointmentdate != today: appointmentdata.staying = 0 appointmentdata.done = 1 appointmentdata.withvet = 0 appointmentdata.Submit(True) miscmethods.ShowMessage(self.GetLabel("animalstayedmessage"), self) appointmentdata = appointmentmethods.AppointmentSettings( self.localsettings, animalid, False) appointmentdata.reason = self.GetLabel("overnightstaylabel") appointmentdata.time = str(datetime.datetime.today().time())[:5] appointmentdata.arrived = 1 appointmentdata.withvet = 1 appointmentdata.staying = stayingid appointmentdata.Submit() vetform = vetmethods.VetForm(notebook, appointmentdata, self.localsettings, self) notebook.AddPage(vetform)
def GenerateBatchMovementReport(self, ID): busy = wx.BusyCursor() parent = ID.GetEventObject().GetParent() batchno = parent.batchinput.GetValue() if parent.containscheckbox.GetValue() == True: action = "SELECT medicationin.Date, medication.Name, medicationin.MedicationID, medicationin.Amount, medicationin.BatchNo, DATE_FORMAT(medicationin.Expires, \"%Y-%m-%d\"), medicationin.WhereFrom, 0, medication.Unit FROM medicationin INNER JOIN medication ON medicationin.MedicationID = medication.ID WHERE medicationin.BatchNo LIKE \"%" + str(batchno) + "%\"" resultsin = db.SendSQL(action, self.localsettings.dbconnection) action = "SELECT medicationout.Date, medication.Name, medicationout.MedicationID, medicationout.Amount, medicationout.BatchNo, 0, medicationout.WhereTo, 1, medication.Unit FROM medicationout INNER JOIN medication ON medicationout.MedicationID = medication.ID WHERE medicationout.BatchNo LIKE \"%" + str(batchno) + "%\"" resultsout = db.SendSQL(action, self.localsettings.dbconnection) else: action = "SELECT medicationin.Date, medication.Name, medicationin.MedicationID, medicationin.Amount, medicationin.BatchNo, DATE_FORMAT(medicationin.Expires, \"%Y-%m-%d\"), medicationin.WhereFrom, 0, medication.Unit FROM medicationin INNER JOIN medication ON medicationin.MedicationID = medication.ID WHERE medicationin.BatchNo = \"" + str(batchno) + "\"" resultsin = db.SendSQL(action, self.localsettings.dbconnection) action = "SELECT medicationout.Date, medication.Name, medicationout.MedicationID, medicationout.Amount, medicationout.BatchNo, 0, medicationout.WhereTo, 1, medication.Unit FROM medicationout INNER JOIN medication ON medicationout.MedicationID = medication.ID WHERE medicationout.BatchNo = \"" + str(batchno) + "\"" resultsout = db.SendSQL(action, self.localsettings.dbconnection) header = "<h1 align=center><u>" + self.GetMenu("medicationmovementsofbatchnumberlabel") + str(batchno) + "</u></h1><table align=center>" results = [] for a in resultsin: results.append(a) for a in resultsout: results.append(a) results.sort() body = "" for a in results: date = miscmethods.GetDateFromSQLDate(a[0]) date = miscmethods.FormatDate(date, self.localsettings) name = a[1] if a[7] == 0: fromorto = self.GetMenu("fromlabel").lower() else: fromorto = self.GetMenu("tolabel").lower() quantity = a[3] destination = a[6] body = body + "<tr><td valign=top>" + date + "</td><td valign=top>" + name + " x " + str(quantity) + " " + fromorto + " " + destination + "</td></tr>" footer = "</table>" formmethods.BuildForm(self.localsettings, header + body + footer) del busy parent.GetParent().Close()