Ignore:
Timestamp:
1 Dec 2008, 12:21:08 (16 years ago)
Author:
Henrik Bettermann
Message:

fix accommodation payment futminna

Location:
WAeUP_SRP/trunk/skins/waeup_futminna
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_futminna/getAccommodationInfo.py

    r3788 r3795  
    5858# customize from here
    5959
    60 
    61 new_states = ('cleared_and_validated',
    62               'school_fee_paid',
    63               'courses_registered',
    64               'courses_validated',
    65               )
    66 
    67 new = student_record.entry_session == session[0]
    68 arrived = student_record.session == session[0]
    69 
    70 level = None
    71 end_level = None
    72 previous = None
    73 
    7460try:
    7561    level = int(student_record.level)
    7662except:
    7763    logger.info('%s has invalid level %s' % (student_id,student_record.level))
    78 try:
    79     end_level = int(student_record.end_level)
    80 except:
    81     logger.info('%s has invalid end_level %s' % (student_id,student_record.end_level))
    82 try:
    83     previous = int(student_record.session) == int(session[0]) - 1
    84 except:
    85     logger.info('%s has invalid session %s' % (student_id,student_record.session))
     64    info['acco'] = None
     65    info['booking_allowed'] = False
     66    info['student_status'] = ''
     67    return info   
    8668
    87 if level is None or end_level is None or student_record.review_state == 'deactivated':
    88     pass
    89 elif arrived:
    90     if new:
    91         booking_allowed = student_record.review_state in new_states
    92     else:
    93         #booking_allowed = not (level % 100)
    94         booking_allowed = True
    95 elif previous:
    96     booking_allowed = not student_record.verdict in ('I',)
    97 
    98 info['booking_allowed'] = booking_allowed
    99 if not booking_allowed:
     69if review_state in ('cleared_and_validated','school_fee_paid','courses_registered', 'courses_validated',) and student_record.session == session[0]:
     70    info['booking_allowed'] = True
     71    info['online_payment'] = True
     72else:
    10073    info['acco'] = None
     74    info['booking_allowed'] = False
    10175    info['student_status'] = ''
    10276    return info
     
    10680info['acco'] = acco
    10781info['acco_id'] = acco_id
    108 bt = 're'
     82
    10983info['maintenance_paid'] = False
    11084if acco is not None:
     
    11286    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    11387    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    114 
    11588d = {}
    11689d['sex'] = 'male'
     90d['bt'] = 'all'
    11791if student_record.sex:
    11892    d['sex'] = 'female'
     93
    11994info['sex']=d['sex']
    120 d['bt'] = 'all'
    12195student_status = "%(sex)s_%(bt)s" % d
    12296info['student_status'] = student_status
Note: See TracChangeset for help on using the changeset viewer.