Project

General

Profile

Revision 297

fixed payment date bug (possibly)

View differences:

tooltron.py
245 245
      aug20 = datetime.date(today.year, 8, 20) # Fall semester
246 246
      may21 = datetime.date(today.year, 5, 21) # summer
247 247
      jan1  = datetime.date(today.year, 1,  1) # Spring semester
248

  
249
      lastAug20 = datetime.date(today.year-1, 8, 20)
250
      lastMay21 = datetime.date(today.year-1, 5, 21)
248 251
      # if they don't fall after those two, its fall
249 252

  
250 253
      if today > aug20:
251 254
         print "its fall semester!"
252 255
         #its fall, so they must have paid after may21 (either full year of half) to be paid
253
         qry3 = "SELECT civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + may21.strftime('%m/%d/%Y') + "', '%m/%d/%Y') ,  \
256
         qry3 = "SELECT civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + lastMay21.strftime('%m/%d/%Y') + "', '%m/%d/%Y') ,  \
254 257
                 DATE_FORMAT(civicrm_value_roboclub_info_2.date_paid_10, '%M %d %Y') \
255 258
                 FROM civicrm_value_roboclub_info_2 \
256 259
                 WHERE civicrm_value_roboclub_info_2.card_number_1 = " + cardnum + ";"
......
258 261
      elif today > may21:
259 262
         print "its summer!"
260 263
         #its summer, so they need to have paid either full year since aug20 or one semester since jan 1
261
         qry3 = "SELECT (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + aug20.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
264
         qry3 = "SELECT (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + lastAug20.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
262 265
                         civicrm_value_roboclub_info_2.amount_paid_11 = 25) OR \
263 266
                        (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + jan1.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
264 267
                         civicrm_value_roboclub_info_2.amount_paid_11 = 15) , \
......
268 271
      else:
269 272
         print "its spring!"
270 273
         #its spring, so they must have either paid full after aug20 or one semester since jan 1 (this is the same as summer)
271
         qry3 = "SELECT (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + may21.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
274
         qry3 = "SELECT (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + lastMay21.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
272 275
                         civicrm_value_roboclub_info_2.amount_paid_11 = 25) OR \
273 276
                        (civicrm_value_roboclub_info_2.date_paid_10 >= STR_TO_DATE('" + jan1.strftime('%m/%d/%Y') + "', '%m/%d/%Y') AND \
274 277
                         civicrm_value_roboclub_info_2.amount_paid_11 = 15) , \
......
287 290
            logMessage(user + " has not paid since " + result[0][1] + ", revoking access!")
288 291
         else:
289 292
            logMessage(user + " has not paid, revoking access!")
290
            #acl = [] #TODO: uncomment!
293
            acl = []
291 294

  
292 295

  
293 296
      toolName = reverseTool(key)

Also available in: Unified diff