Example #1
0
def printdaylists(om_gui, args, expanded=False):
    '''
    prints the single book pages
    args is a tuple (dent, date)
    '''
    dlist = daylistprint.printDaylist()
    something_to_print = False
    for apptix, adate in args:
        data = appointments.printableDaylistData(adate.toPyDate(), apptix)
        if data != []:
            something_to_print = True
            dlist.addDaylist(adate, apptix, data)
    if something_to_print:
        dlist.print_(expanded)
Example #2
0
def printdaylists(om_gui, args, expanded=False):
    '''
    prints the single book pages
    args is a tuple (dent, date)
    '''
    dlist = daylistprint.printDaylist()
    something_to_print = False
    for apptix, adate in args:
        data = appointments.printableDaylistData(adate.toPyDate(), apptix)
        if data != []:
            something_to_print = True
            dlist.addDaylist(adate, apptix, data)
    if something_to_print:
        dlist.print_(expanded)
Example #3
0
def printmultiDayList(om_gui, args):
    '''
    prints the multiday pages
    args = ((dent, date), (dent, date)...)
    '''
    dlist = multiDayListPrint.printDaylist()
    something_to_print = False
    for arg in args:
        data = appointments.printableDaylistData(arg[1].toPyDate(), arg[0])
        # note arg[1]=Qdate
        if data != []:
            something_to_print = True
            dlist.addDaylist(arg[1], arg[0], data)
    if something_to_print:
        dlist.print_()
Example #4
0
def printmultiDayList(om_gui, args):
    '''
    prints the multiday pages
    args = ((dent, date), (dent, date)...)
    '''
    dlist = multiDayListPrint.printDaylist()
    something_to_print = False
    for arg in args:
        data = appointments.printableDaylistData(arg[1].toPyDate(), arg[0])
        # note arg[1]=Qdate
        if data != []:
            something_to_print = True
            dlist.addDaylist(arg[1], arg[0], data)
    if something_to_print:
        dlist.print_()
                        x += colwidths[col]
                        col += 1
                    y += rowHeight

                LeftMargin += columnWidth
                columnNo += 1
            rect = QtCore.QRectF(AbsoluteLeft, pageHeight - rowHeight, pageWidth, rowHeight)
            painter.drawText(rect, "Printed %s" % now, option)
            if page < len(self.dates) - 1:
                self.printer.newPage()
                page += 1
            painter.restore()


if __name__ == "__main__":
    import sys

    localsettings.initiate(False)
    app = QtGui.QApplication(sys.argv)
    from openmolar.dbtools import appointments
    import datetime

    app = QtGui.QApplication(sys.argv)
    d = datetime.date.today()
    apps = appointments.printableDaylistData(d, 4)

    p = printDaylist()
    for i in range(0, 3):
        p.addDaylist(QtCore.QDate.currentDate(), 4, apps[0], apps[1:])
    p.print_()
Example #6
0
                        painter.drawText(
                            rect.adjusted(2,
                                          0,
                                          -2,
                                          0),
                            str(att),
                            option)
                    x += colwidths[col]
                    col += 1
                y += rowHeight

            rect = QtCore.QRectF(LeftMargin, y, pageWidth, rowHeight)
            painter.drawText(rect, "Printed %s" % now, option)
            if page < len(self.dates) - 1:
                self.printer.newPage()
            painter.restore()


if __name__ == "__main__":
    import sys
    from openmolar.dbtools import appointments
    import datetime
    localsettings.initiate()
    app = QtGui.QApplication(sys.argv)
    d = datetime.date.today()
    apps = appointments.printableDaylistData(d, 4)

    p = printDaylist()
    p.addDaylist(QtCore.QDate.currentDate(), 4, apps[0], apps[1:])
    p.print_(True)