Exemple #1
0
    def print_duplicate(self):
        amount = self.amount_spinbox.value()

        myreceipt = receiptPrint.Receipt()

        myreceipt.setProps(self.pt.title, self.pt.fname, self.pt.sname,
                           self.pt.addr1, self.pt.addr2, self.pt.addr3,
                           self.pt.town, self.pt.county, self.pt.pcde)

        myreceipt.total = amount * 100

        myreceipt.receivedDict = {_("Professional Services"): amount * 100}
        myreceipt.isDuplicate = True
        myreceipt.dupdate = self.dup_date_edit.date()

        if myreceipt.print_():
            self.pt.addHiddenNote(
                "printed", "%s %.02f" % (_("duplicate receipt for"), amount))

            self.duplicate_printed = True
            self.accept()
Exemple #2
0
def printReceipt(om_gui, valDict, total="0.00"):
    '''
    print a receipt
    '''
    if om_gui.pt.serialno == 0:
        om_gui.advise(_("no patient selected"), 1)
        return
    myreceipt = receiptPrint.Receipt()

    myreceipt.setProps(om_gui.pt.title, om_gui.pt.fname, om_gui.pt.sname,
                       om_gui.pt.addr1, om_gui.pt.addr2, om_gui.pt.addr3,
                       om_gui.pt.town, om_gui.pt.county, om_gui.pt.pcde)

    myreceipt.total = total

    myreceipt.receivedDict = valDict

    if myreceipt.print_():
        commitPDFtoDB(om_gui, "receipt")
        om_gui.pt.addHiddenNote("printed", "receipt")
        om_gui.updateHiddenNotesLabel()