Changeset 3795 for WAeUP_SRP/trunk


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

fix accommodation payment futminna

Location:
WAeUP_SRP/trunk/skins
Files:
1 added
3 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
  • WAeUP_SRP/trunk/skins/waeup_student/accommodation_edit_form.pt

    r2891 r3795  
    4141 
    4242           <ul tal:condition="not: maintenance_online" tal:omit-tag="">
    43              <li>Buy a Hostel Maintainance Scratch Card
     43             <li>Buy a Hostel Maintenance Scratch Card
    4444               (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for
    4545               <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li>
  • WAeUP_SRP/trunk/skins/waeup_utilities/changeRegState.py

    r2961 r3795  
    2929
    3030request = context.REQUEST
    31 students = context.portal_url.getPortalObject().campus.students
     31#students = context.portal_url.getPortalObject().campus.students
    3232wftool = context.portal_workflow
    3333student_id = context.getStudentId()
     34context_doc = context
    3435if student_id is None:
    3536    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    36 
    37 student = getattr(students,student_id)
     37#student = getattr(students,student_id)
     38#context_doc = student
    3839try:
    39     wftool.doActionFor(student,transition)
     40    wftool.doActionFor(context_doc,transition)
    4041    logger.info('%s executed transition %s for %s' % (member,transition,student_id))
    4142except:
Note: See TracChangeset for help on using the changeset viewer.