Index: pykota/trunk/pykota/storages/sql.py
===================================================================
--- pykota/trunk/pykota/storages/sql.py (revision 2734)
+++ pykota/trunk/pykota/storages/sql.py (revision 2735)
@@ -672,8 +672,4 @@
         self.doModify("UPDATE userpquota SET pagecounter=pagecounter + %s,lifepagecounter=lifepagecounter + %s WHERE id=%s" % (self.doQuote(nbpages), self.doQuote(nbpages), self.doQuote(userpquota.ident)))
        
-    def writeUserPQuotaPagesCounters(self, userpquota, newpagecounter, newlifepagecounter) :    
-        """Sets the new page counters permanently for a user print quota."""
-        self.doModify("UPDATE userpquota SET pagecounter=%s, lifepagecounter=%s, warncount=0, datelimit=NULL WHERE id=%s" % (self.doQuote(newpagecounter), self.doQuote(newlifepagecounter), self.doQuote(userpquota.ident)))
-       
     def saveBillingCode(self, code) :    
         """Saves the billing code to the database."""
@@ -718,7 +714,14 @@
             self.doModify("UPDATE jobhistory SET userid=%s, jobid=%s, pagecounter=%s, action=%s, jobsize=%s, jobprice=%s, filename=%s, title=%s, copies=%s, options=%s, hostname=%s, jobsizebytes=%s, md5sum=%s, pages=%s, billingcode=%s, precomputedjobsize=%s, precomputedjobprice=%s, jobdate=now() WHERE id=%s" % (self.doQuote(user.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(jobprice), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options), self.doQuote(clienthost), self.doQuote(jobsizebytes), self.doQuote(jobmd5sum), self.doQuote(jobpages), self.doQuote(jobbilling), self.doQuote(precomputedsize), self.doQuote(precomputedprice), self.doQuote(printer.LastJob.ident)))
             
-    def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :
-        """Sets soft and hard limits for a user quota."""
-        self.doModify("UPDATE userpquota SET softlimit=%s, hardlimit=%s, warncount=0, datelimit=NULL WHERE id=%s" % (self.doQuote(softlimit), self.doQuote(hardlimit), self.doQuote(userpquota.ident)))
+    def saveUserPQuota(self, userpquota) :
+        """Saves an user print quota entry."""
+        self.doModify("UPDATE userpquota SET softlimit=%s, hardlimit=%s, warncount=%s, datelimit=%s, pagecounter=%s, lifepagecounter=%s WHERE id=%s" \
+                              % (self.doQuote(userpquota.SoftLimit), \
+                                 self.doQuote(userpquota.HardLimit), \
+                                 self.doQuote(userpquota.WarnCount), \
+                                 self.doQuote(userpquota.DateLimit), \
+                                 self.doQuote(userpquota.PageCounter), \
+                                 self.doQuote(userpquota.LifePageCounter), \
+                                 self.doQuote(userpquota.ident)))
         
     def writeUserPQuotaWarnCount(self, userpquota, warncount) :
@@ -730,7 +733,11 @@
         self.doModify("UPDATE userpquota SET warncount=warncount+1 WHERE id=%s" % self.doQuote(userpquota.ident))
         
-    def writeGroupPQuotaLimits(self, grouppquota, softlimit, hardlimit) :
-        """Sets soft and hard limits for a group quota on a specific printer."""
-        self.doModify("UPDATE grouppquota SET softlimit=%s, hardlimit=%s, datelimit=NULL WHERE id=%s" % (self.doQuote(softlimit), self.doQuote(hardlimit), self.doQuote(grouppquota.ident)))
+    def saveGroupPQuota(self, grouppquota) :
+        """Saves a group print quota entry."""
+        self.doModify("UPDATE grouppquota SET softlimit=%s, hardlimit=%s, datelimit=%s WHERE id=%s" \
+                              % (self.doQuote(grouppquota.SoftLimit), \
+                                 self.doQuote(grouppquota.HardLimit), \
+                                 self.doQuote(grouppquota.DateLimit), \
+                                 self.doQuote(grouppquota.ident)))
 
     def writePrinterToGroup(self, pgroup, printer) :
Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 2726)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 2735)
@@ -1114,14 +1114,4 @@
         return self.doModify(userpquota.ident, fields)         
         
-    def writeUserPQuotaPagesCounters(self, userpquota, newpagecounter, newlifepagecounter) :    
-        """Sets the new page counters permanently for a user print quota."""
-        fields = {
-                   "pykotaPageCounter" : str(newpagecounter),
-                   "pykotaLifePageCounter" : str(newlifepagecounter),
-                   "pykotaDateLimit" : None,
-                   "pykotaWarnCount" : "0",
-                 }  
-        return self.doModify(userpquota.ident, fields)         
-       
     def decreaseUserAccountBalance(self, user, amount) :    
         """Decreases user's account balance from an amount."""
@@ -1208,11 +1198,13 @@
             self.doAdd(lastjdn, fields)          
             
-    def writeUserPQuotaLimits(self, userpquota, softlimit, hardlimit) :
-        """Sets soft and hard limits for a user quota."""
+    def saveUserPQuota(self, userpquota) :
+        """Saves an user print quota entry."""
         fields = { 
-                   "pykotaSoftLimit" : str(softlimit),
-                   "pykotaHardLimit" : str(hardlimit),
-                   "pykotaDateLimit" : "None",
-                   "pykotaWarnCount" : "0",
+                   "pykotaSoftLimit" : str(userpquota.SoftLimit),
+                   "pykotaHardLimit" : str(userpquota.HardLimit),
+                   "pykotaDateLimit" : str(userpquota.DateLimit),
+                   "pykotaWarnCount" : str(userpquota.WarnCount),
+                   "pykotaPageCounter" : str(userpquota.PageCounter),
+                   "pykotaLifePageCounter" : str(userpquota.LifePageCounter),
                  }
         self.doModify(userpquota.ident, fields)
@@ -1232,10 +1224,10 @@
         return self.doModify(userpquota.ident, fields)         
         
-    def writeGroupPQuotaLimits(self, grouppquota, softlimit, hardlimit) :
-        """Sets soft and hard limits for a group quota on a specific printer."""
+    def saveGroupPQuota(self, grouppquota) :
+        """Saves a group print quota entry."""
         fields = { 
-                   "pykotaSoftLimit" : str(softlimit),
-                   "pykotaHardLimit" : str(hardlimit),
-                   "pykotaDateLimit" : "None",
+                   "pykotaSoftLimit" : str(grouppquota.SoftLimit),
+                   "pykotaHardLimit" : str(grouppquota.HardLimit),
+                   "pykotaDateLimit" : str(grouppquota.DateLimit),
                  }
         self.doModify(grouppquota.ident, fields)
