Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 2191)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 2211)
@@ -490,5 +490,22 @@
             result = None
             try :
-                result = self.doSearch("objectClass=pykotaJob", ["pykotaJobSizeBytes", "pykotaHostName", "pykotaUserName", "pykotaJobId", "pykotaPrinterPageCounter", "pykotaJobSize", "pykotaAction", "pykotaJobPrice", "pykotaFileName", "pykotaTitle", "pykotaCopies", "pykotaOptions", "pykotaBillingCode", "pykotaPages", "pykotaMD5Sum", "createTimestamp"], base="cn=%s,%s" % (lastjobident, self.info["jobbase"]), scope=ldap.SCOPE_BASE)
+                result = self.doSearch("objectClass=pykotaJob", [ "pykotaJobSizeBytes", 
+                                                                  "pykotaHostName", 
+                                                                  "pykotaUserName", 
+                                                                  "pykotaPrinterName", 
+                                                                  "pykotaJobId", 
+                                                                  "pykotaPrinterPageCounter", 
+                                                                  "pykotaJobSize", 
+                                                                  "pykotaAction", 
+                                                                  "pykotaJobPrice", 
+                                                                  "pykotaFileName", 
+                                                                  "pykotaTitle", 
+                                                                  "pykotaCopies", 
+                                                                  "pykotaOptions", 
+                                                                  "pykotaBillingCode", 
+                                                                  "pykotaPages", 
+                                                                  "pykotaMD5Sum", 
+                                                                  "createTimestamp" ], 
+                                                                base="cn=%s,%s" % (lastjobident, self.info["jobbase"]), scope=ldap.SCOPE_BASE)
             except PyKotaStorageError :    
                 pass # Last job entry exists, but job probably doesn't exist anymore. 
@@ -514,5 +531,5 @@
                 lastjob.JobHostName = fields.get("pykotaHostName", [""])[0]
                 lastjob.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0]
-                lastjob.JobBillingCode = fields.get("pykotaMD5Sum", [None])[0]
+                lastjob.JobBillingCode = fields.get("pykotaBillingCode", [None])[0]
                 lastjob.JobMD5Sum = fields.get("pykotaMD5Sum", [None])[0]
                 lastjob.JobPages = fields.get("pykotaPages", [""])[0]
@@ -1033,5 +1050,22 @@
             where = precond
         jobs = []    
-        result = self.doSearch(where, fields=["pykotaJobSizeBytes", "pykotaHostName", "pykotaUserName", "pykotaPrinterName", "pykotaJobId", "pykotaPrinterPageCounter", "pykotaAction", "pykotaJobSize", "pykotaJobPrice", "pykotaFileName", "pykotaTitle", "pykotaCopies", "pykotaOptions", "createTimestamp"], base=self.info["jobbase"])
+        result = self.doSearch(where, fields=[ "pykotaJobSizeBytes", 
+                                               "pykotaHostName", 
+                                               "pykotaUserName", 
+                                               "pykotaPrinterName", 
+                                               "pykotaJobId", 
+                                               "pykotaPrinterPageCounter", 
+                                               "pykotaAction", 
+                                               "pykotaJobSize", 
+                                               "pykotaJobPrice", 
+                                               "pykotaFileName", 
+                                               "pykotaTitle", 
+                                               "pykotaCopies", 
+                                               "pykotaOptions", 
+                                               "pykotaBillingCode", 
+                                               "pykotaPages", 
+                                               "pykotaMD5Sum", 
+                                               "createTimestamp" ], 
+                                      base=self.info["jobbase"])
         if result :
             for (ident, fields) in result :
@@ -1055,4 +1089,7 @@
                 job.JobHostName = fields.get("pykotaHostName", [""])[0]
                 job.JobSizeBytes = fields.get("pykotaJobSizeBytes", [0L])[0]
+                job.JobBillingCode = fields.get("pykotaBillingCode", [None])[0]
+                job.JobMD5Sum = fields.get("pykotaMD5Sum", [None])[0]
+                job.JobPages = fields.get("pykotaPages", [""])[0]
                 date = fields.get("createTimestamp", ["19700101000000"])[0]
                 year = int(date[:4])
@@ -1289,6 +1326,6 @@
         entries = self.retrieveHistory(user, printer, limit=None)
         if entries :
-            result = [ ("username", "printername", "dn", "jobid", "pagecounter", "jobsize", "action", "jobdate", "filename", "title", "copies", "options", "jobprice", "hostname", "jobsizebytes") ] 
+            result = [ ("username", "printername", "dn", "jobid", "pagecounter", "jobsize", "action", "jobdate", "filename", "title", "copies", "options", "jobprice", "hostname", "jobsizebytes", "md5sum", "pages", "billingcode") ] 
             for entry in entries :
-                result.append((entry.UserName, entry.PrinterName, entry.ident, entry.JobId, entry.PrinterPageCounter, entry.JobSize, entry.JobAction, entry.JobDate, entry.JobFileName, entry.JobTitle, entry.JobCopies, entry.JobOptions, entry.JobPrice, entry.JobHostName, entry.JobSizeBytes)) 
+                result.append((entry.UserName, entry.PrinterName, entry.ident, entry.JobId, entry.PrinterPageCounter, entry.JobSize, entry.JobAction, entry.JobDate, entry.JobFileName, entry.JobTitle, entry.JobCopies, entry.JobOptions, entry.JobPrice, entry.JobHostName, entry.JobSizeBytes, entry.JobMD5Sum, entry.JobPages, entry.JobBillingCode)) 
             return result    
