169 | | for printer in printers : |
170 | | upquota = self.storage.getUserPQuota(user, printer) |
171 | | if upquota.Exists : |
172 | | cost = upquota.computeJobPrice(jobsize) |
173 | | self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) |
| 169 | if user.LimitBy == "noprint" : |
| 170 | self.body += "<p>%s</p>" % _("Your account settings forbid you to print at this time.") |
| 171 | else : |
| 172 | for printer in printers : |
| 173 | upquota = self.storage.getUserPQuota(user, printer) |
| 174 | if upquota.Exists : |
| 175 | if printer.MaxJobSize and (jobsize > printer.MaxJobSize) : |
| 176 | msg = _("You are not allowed to print so many pages on printer %s at this time.") % printer.Name |
| 177 | else : |
| 178 | cost = upquota.computeJobPrice(jobsize) |
| 179 | msg = _("Cost on printer %s : %.2f") % (printer.Name, cost) |
| 180 | if printer.PassThrough : |
| 181 | msg = "%s (%s)" % (msg, _("won't be charged, printer is in passthrough mode")) |
| 182 | elif user.LimitBy == "nochange" : |
| 183 | msg = "%s (%s)" % (msg, _("won't be charged, your account is immutable")) |
| 184 | self.body += "<p>%s</p>" % msg |