Changeset 3066 for pykota/trunk/bin/pkrefund
- Timestamp:
- 11/22/06 23:00:56 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkrefund
r3063 r3066 139 139 end=end, 140 140 limit=0) 141 peruser = {} 141 142 nbjobs = 0 142 143 nbpages = 0 … … 148 149 nbpages += job.JobSize 149 150 nbcredits += job.JobPrice 151 counters = peruser.setdefault(job.UserName, { "nbjobs" : 0, "nbpages" : 0, "nbcredits" : 0.0 }) 152 counters["nbpages"] += job.JobSize 153 counters["nbcredits"] += job.JobPrice 150 154 job.refund(reason) 155 counters["nbjobs"] += 1 151 156 nbjobs += 1 152 157 else : 153 158 print _("Date : %s") % str(job.JobDate)[:19] 154 159 print _("JobId : %s") % job.JobId 155 print _("Username : %s") % job.User .Name156 print _("Printername : %s") % job.Printer .Name160 print _("Username : %s") % job.UserName 161 print _("Printername : %s") % job.PrinterName 157 162 print _("Billing code : %s") % job.JobBillingCode 158 163 print _("Pages : %i") % job.JobSize … … 165 170 nbpages += job.JobSize 166 171 nbcredits += job.JobPrice 172 counters = peruser.setdefault(job.UserName, { "nbjobs" : 0, "nbpages" : 0, "nbcredits" : 0.0 }) 173 counters["nbpages"] += job.JobSize 174 counters["nbcredits"] += job.JobPrice 167 175 job.refund(reason) 176 counters["nbjobs"] += 1 168 177 nbjobs += 1 169 178 break … … 172 181 print 173 182 print _("Refunded %i jobs, %i pages and %.3f credits") % (nbjobs, nbpages, nbcredits) 174 175 183 176 184 if __name__ == "__main__" :