def createPrintJob(self): report = self.createReport() if report == None: return #if len(report["data"]) == 0: datestr = dateToString(self.docdate) docnumber = self.docnumber if config.digittype == 1: docnumber = utility.convertToPersian(docnumber) printjob = printreport.PrintReport(report["data"], report["col-width"], report["heading"]) printjob.setHeader(_("Accounting Document"), {_("Document Number"):docnumber, _("Date"):datestr}) printjob.setDrawFunction("drawDocument") return printjob
def createPrintJob(self): report = self.createReport() if report == None: return if len(report["data"]) == 0: msgbox = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("No ledgers found.")) msgbox.set_title(_("Empty report")) msgbox.run() msgbox.destroy() return printjob = printreport.PrintReport(report["data"], report["col-width"], report["heading"]) todaystr = dateToString(date.today()) printjob.setHeader(_("Trial Balance"), {_("Date"):todaystr}) printjob.setDrawFunction("drawTrialReport") return printjob
def createPrintJob(self): report = self.createReport() if report == None: return if len(report["data"]) == 0: msgbox = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("The requested notebook is empty.")) msgbox.set_title(_("Empty notebook")) msgbox.run() msgbox.destroy() return printjob = printreport.PrintReport(report["data"], report["col-width"], report["heading"]) if self.type == self.__class__.DAILY: todaystr = dateToString(date.today()) printjob.setHeader(_("Daily Notebook"), {_("Date"): todaystr}) printjob.setDrawFunction("drawDailyNotebook") else: if config.digittype == 1: code = utility.convertToPersian(self.subcode) else: code = self.subcode if self.type == self.__class__.LEDGER: printjob.setHeader(_("Ledgers Notebook"), { _("Subject Name"): self.subname, _("Subject Code"): code }) else: printjob.setHeader(_("Sub-ledgers Notebook"), { _("Subject Name"): self.subname, _("Subject Code"): code }) printjob.setDrawFunction("drawSubjectNotebook") return printjob