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)
Example #2
0
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)
Example #3
0
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()
Example #4
0
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()
Example #5
0
def show_cashbook(om_gui, print_ = False):
    dent1 = om_gui.ui.cashbookDentComboBox.currentText()
    sdate = om_gui.ui.cashbookStartDateEdit.date()
    edate = om_gui.ui.cashbookEndDateEdit.date()
    
    sundries_only = om_gui.ui.sundries_only_radioButton.isChecked()
    treatment_only = om_gui.ui.treatment_only_radioButton.isChecked()

    if sdate > edate:
        om_gui.advise(_("bad date sequence"), 1)
        return False

    html = cashbook.details(dent1, sdate, edate, treatment_only, sundries_only)
    om_gui.ui.cashbookTextBrowser.setHtml(
    '<html><body>'+html+"</body></html>")
    
    if print_:
        myclass = bookprint.printBook('<html><body>'+html+"</body></html>")
        myclass.printpage()
Example #6
0
def show_cashbook(om_gui, print_=False):
    dent1 = om_gui.ui.cashbookDentComboBox.currentText()
    sdate = om_gui.ui.cashbookStartDateEdit.date()
    edate = om_gui.ui.cashbookEndDateEdit.date()

    sundries_only = om_gui.ui.sundries_only_radioButton.isChecked()
    treatment_only = om_gui.ui.treatment_only_radioButton.isChecked()

    if sdate > edate:
        om_gui.advise(_("bad date sequence"), 1)
        return False

    html = cashbook.details(dent1, sdate, edate, treatment_only, sundries_only)
    om_gui.ui.cashbookTextBrowser.setHtml('<html><body>' + html +
                                          "</body></html>")

    if print_:
        myclass = bookprint.printBook('<html><body>' + html + "</body></html>")
        myclass.printpage()
Example #7
0
def historyPrint(om_gui):
    html = om_gui.ui.debugBrowser.toHtml()
    myclass = bookprint.printBook(html)
    myclass.printpage()
Example #8
0
def historyPrint(om_gui):
    html = om_gui.ui.debugBrowser.toHtml()
    myclass = bookprint.printBook(html)
    myclass.printpage()