def daybookView(om_gui, print_=False): dent1 = str(om_gui.ui.daybookDent1ComboBox.currentText()) dent2 = str(om_gui.ui.daybookDent2ComboBox.currentText()) sdate = om_gui.ui.daybookStartDateEdit.date() edate = om_gui.ui.daybookEndDateEdit.date() if sdate > edate: om_gui.advise(_("bad date sequence"), 1) return False filters = str(om_gui.ui.daybook_filters_lineEdit.text().toAscii()) if filters: filters = "AND %s" % filters.replace("%", "%%") om_gui.wait() om_gui.ui.daybookTextBrowser.setHtml(_("polling database...")) try: html = daybook.details(dent1, dent2, sdate, edate, filters) except daybook.connect.ProgrammingError as exc: LOGGER.exception("Bad Query") html = "<h1>%s</h1><pre>%s</pre>" % (_("Bad Query"), str(exc)) except daybook.connect.OperationalError as exc: LOGGER.exception("Bad Query") html = "<h1>%s</h1><pre>%s</pre>" % (_("Bad Query"), str(exc)) except Exception as exc: LOGGER.exception("Unknown Error") html = "<h1>%s</h1><pre>%s</pre>" % (_("Unknown Error"), str(exc)) om_gui.ui.daybookTextBrowser.setHtml(html) if print_: myclass = bookprint.printBook(html) myclass.printpage() om_gui.wait(False)
def daybookView(om_gui, print_=False): dent1 = str(om_gui.ui.daybookDent1ComboBox.currentText()) dent2 = str(om_gui.ui.daybookDent2ComboBox.currentText()) sdate = om_gui.ui.daybookStartDateEdit.date() edate = om_gui.ui.daybookEndDateEdit.date() if sdate > edate: om_gui.advise(_("bad date sequence"), 1) return False html = daybook.details(dent1, dent2, sdate, edate) om_gui.ui.daybookTextBrowser.setHtml(html) if print_: myclass = bookprint.printBook(html) myclass.printpage()
def daybookView(om_gui, print_ = False): dent1 = str(om_gui.ui.daybookDent1ComboBox.currentText()) dent2 = str(om_gui.ui.daybookDent2ComboBox.currentText()) sdate = om_gui.ui.daybookStartDateEdit.date() edate = om_gui.ui.daybookEndDateEdit.date() if sdate > edate: om_gui.advise(_("bad date sequence"),1) return False html = daybook.details(dent1, dent2, sdate, edate) om_gui.ui.daybookTextBrowser.setHtml(html) if print_: myclass = bookprint.printBook(html) myclass.printpage()