Changeset 1056 for pykota/trunk

Show
Ignore:
Timestamp:
07/02/03 11:29:12 (21 years ago)
Author:
jalet
Message:

Bug fixed when wanting a report and an user/group was limited by account balance

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1052 r1056  
    2222PyKota NEWS : 
    2323 
     24    - 1.10 : 
     25     
     26        - Bug fixed wrt quota reports when print limiting is by  
     27          account balance. 
     28           
    2429    - 1.09 : 
    2530     
  • pykota/trunk/pykota/reporters/text.py

    r1048 r1056  
    2121# 
    2222# $Log$ 
     23# Revision 1.2  2003/07/02 09:29:12  jalet 
     24# Bug fixed when wanting a report and an user/group was limited by account balance 
     25# 
    2326# Revision 1.1  2003/06/30 12:46:15  jalet 
    2427# Extracted reporting code. 
     
    8184        lifetimepaid = float(entry.LifeTimePaid or 0.0) 
    8285         
    83         if quota.DateLimit is not None : 
    84             now = DateTime.now() 
    85             datelimit = DateTime.ISO.ParseDateTime(quota.DateLimit) 
    86             if now >= datelimit : 
     86        if entry.LimitBy.lower() == "balance" :     
     87            if balance <= 0 : 
    8788                datelimit = "DENY" 
    88         elif (quota.HardLimit is not None) and (pagecounter >= quota.HardLimit) :     
    89             datelimit = "DENY" 
    90         elif (quota.HardLimit is None) and (quota.SoftLimit is not None) and (pagecounter >= quota.SoftLimit) : 
    91             datelimit = "DENY" 
    92         else :     
    93             datelimit = "" 
    94              
    95         if entry.LimitBy.lower() == "balance" :     
    96             reached = (((balance <= 0) and "+") or "-") + "B" 
     89                reached = "+B" 
     90            else :     
     91                datelimit = "" 
     92                reached = "-B" 
    9793        else : 
     94            if quota.DateLimit is not None : 
     95                now = DateTime.now() 
     96                datelimit = DateTime.ISO.ParseDateTime(quota.DateLimit) 
     97                if now >= datelimit : 
     98                    datelimit = "DENY" 
     99            elif (quota.HardLimit is not None) and (pagecounter >= quota.HardLimit) :     
     100                datelimit = "DENY" 
     101            elif (quota.HardLimit is None) and (quota.SoftLimit is not None) and (pagecounter >= quota.SoftLimit) : 
     102                datelimit = "DENY" 
     103            else :     
     104                datelimit = "" 
    98105            reached = (((quota.SoftLimit is not None) and (pagecounter >= quota.SoftLimit) and "+") or "-") + "Q" 
    99106             
  • pykota/trunk/pykota/version.py

    r1052 r1056  
    2121# 
    2222 
    23 __version__ = "1.09_unofficial" 
     23__version__ = "1.10_unofficial" 
    2424 
    2525__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""