Changeset 1285 for pykota/trunk/bin

Show
Ignore:
Timestamp:
01/12/04 23:43:40 (20 years ago)
Author:
jalet
Message:

New formula to compute a job's price

Location:
pykota/trunk/bin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1280 r1285  
    2424# 
    2525# $Log$ 
     26# Revision 1.22  2004/01/12 22:43:40  jalet 
     27# New formula to compute a job's price 
     28# 
    2629# Revision 1.21  2004/01/12 18:17:36  jalet 
    2730# Denied jobs weren't stored into the history anymore, this is now fixed. 
     
    192195             
    193196            # update the quota for the current user on this printer  
    194             jobprice = (float(printer.PricePerPage or 0.0) * jobsize) + float(printer.PricePerJob or 0.0) 
    195             if jobsize : 
    196                 self.logdebug("Updating user %s's quota on printer %s" % (user.Name, printer.Name)) 
    197                 userpquota.increasePagesUsage(jobsize) 
     197            self.logdebug("Updating user %s's quota on printer %s" % (user.Name, printer.Name)) 
     198            jobprice = userpquota.increasePagesUsage(jobsize) 
    198199             
    199200            # adds the current job to history     
  • pykota/trunk/bin/pykotme

    r1257 r1285  
    2424# 
    2525# $Log$ 
     26# Revision 1.7  2004/01/12 22:43:40  jalet 
     27# New formula to compute a job's price 
     28# 
    2629# Revision 1.6  2004/01/08 14:10:32  jalet 
    2730# Copyright year changed. 
     
    157160        print _("Job size : %i pages") % nbpages     
    158161        for printer in printers : 
    159             cost = (nbpages * float(printer.PricePerPage or 0)) + float(printer.PricePerJob or 0) 
     162            userpquota = self.storage.getUserPQuota(user, printer) 
     163            cost = userpquota.computeJobPrice(nbpages) 
    160164            print _("Cost on printer %s : %.2f") % (printer.Name, cost) 
    161165