Show
Ignore:
Timestamp:
11/13/06 23:24:01 (17 years ago)
Author:
jerome
Message:

The code to refund jobs is there and works (at least with PostgreSQL).
Only the pkrefund command line tool (and CGI script ?) is missing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2953 r3056  
    13031303            self.doModify(pgroup.ident, fields)          
    13041304             
    1305     def retrieveHistory(self, user=None, printer=None, hostname=None, billingcode=None, limit=100, start=None, end=None) : 
     1305    def retrieveHistory(self, user=None, printer=None, hostname=None, billingcode=None, jobid=None, limit=100, start=None, end=None) : 
    13061306        """Retrieves all print jobs for user on printer (or all) between start and end date, limited to first 100 results.""" 
    13071307        precond = "(objectClass=pykotaJob)" 
     
    13151315        if billingcode is not None : 
    13161316            where.append("(pykotaBillingCode=%s)" % self.userCharsetToDatabase(billingcode)) 
     1317        if jobid is not None : 
     1318            where.append("(pykotaJobId=%s)" % jobid) # TODO : jobid is text, so self.userCharsetToDatabase(jobid) but do all of them as well. 
    13171319        if where :     
    13181320            where = "(&%s)" % "".join([precond] + where) 
     
    17781780        return self.doModify(bcode.ident, fields)          
    17791781 
     1782    def refundJob(self, jobident) :    
     1783        """Marks a job as refunded in the history.""" 
     1784        dn = "cn=%s,%s" % (ident, self.info["jobbase"]) 
     1785        fields = { 
     1786                     "pykotaAction" : "REFUND", 
     1787                 }     
     1788        self.doModify(dn, fields)          
     1789         
    17801790    def storageUserFromRecord(self, username, record) : 
    17811791        """Returns a StorageUser instance from a database record."""