Changeset 3088 for pykota/trunk/bin/pkrefund
- Timestamp:
- 11/30/06 22:24:37 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkrefund
r3087 r3088 187 187 self.ypos -= (size + 4) 188 188 189 def pagePDF(self, receiptnumber, name, values, unit name, reason) :189 def pagePDF(self, receiptnumber, name, values, unit, reason) : 190 190 """Generates a new page in the PDF document.""" 191 191 if values["nbpages"] : … … 200 200 self.printVar(_("Jobs refunded"), str(values["nbjobs"]), 22) 201 201 self.printVar(_("Pages refunded"), str(values["nbpages"]), 22) 202 self.printVar(_("Amount refunded"), "%.3f %s" % (values["nbcredits"], unit name), 22)202 self.printVar(_("Amount refunded"), "%.3f %s" % (values["nbcredits"], unit), 22) 203 203 self.ypos -= 20 204 204 self.printVar(_("Reason"), reason, 14) … … 217 217 c.setTitle("PyKota print job refunding receipts") 218 218 c.setSubject("Print job refunding receipts generated with PyKota") 219 220 219 221 220 self.canvas.beginForm("background") … … 261 260 sys.stdout.flush() 262 261 263 def genReceipts(self, peruser, logo, outfname, firstnumber, reason ) :262 def genReceipts(self, peruser, logo, outfname, firstnumber, reason, unit) : 264 263 """Generates the receipts file.""" 265 264 if outfname and len(peruser) : 266 percent = Percent(self) 267 percent.setSize(len(peruser)) 265 percent = Percent(self, size=len(peruser)) 268 266 if outfname != "-" : 269 267 percent.display("%s...\n" % _("Generating receipts")) … … 272 270 number = firstnumber 273 271 for (name, values) in peruser.items() : 274 number += self.pagePDF(number, name, values, options["unit"], reason)272 number += self.pagePDF(number, name, values, unit, reason) 275 273 if outfname != "-" : 276 274 percent.oneMore() … … 391 389 break 392 390 print 393 self.genReceipts(peruser, options["logo"].strip(), options["output"], firstnumber, reason )391 self.genReceipts(peruser, options["logo"].strip(), options["output"], firstnumber, reason, options["unit"]) 394 392 if options["output"] != "-" : 395 393 print _("Refunded %i users for %i jobs, %i pages and %.3f credits") % (len(peruser), nbjobs, nbpages, nbcredits)