Changeset 2461


Ignore:
Timestamp:
28 Oct 2007, 16:47:34 (17 years ago)
Author:
joachim
Message:

include reasons if payment is not possible

Location:
WAeUP_SRP/base/skins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_epayment/getPaymentsFolderInfo.py

    r2459 r2461  
    5454parttime = s_brain.mode.endswith('_pt')
    5555fulltime = s_brain.mode.endswith('_ft')
    56 online_payment = False
    57 sc_payment = False
    5856
    5957#if review_state == 'cleared_and_validated' or (parttime and review_state == 'returning'):
     
    6260#    sc_payment = True
    6361
    64 info['online_payment'] = online_payment
    65 info['sc_payment'] = sc_payment
    66 info['prod_id'] = '61'
    6762session = s_brain.session
    6863next_info = context.getNextInfo(s_brain)
    6964info['next_session'] = next_info['next_session_id']
    7065info['next_session_str'] = next_info['next_session_str']
     66info['payment_method'] = "done"
     67if next_info['next_transition'] is None and next_info['reasons']:
     68    info['payment_method'] = "not_possible"
     69    info['reasons'] = next_info['reasons']
     70elif review_state == 'cleared_and_validated':
     71    info['payment_method'] = "online_payment"
     72elif review_state == 'returning' and info['next_session'] != session:
     73    info['payment_method'] = "sc_payment"
    7174
    72 if review_state == 'cleared_and_validated':
    73     online_payment = True
    74 elif review_state == 'returning' and info['next_session'] != session:
    75     sc_payment = True
     75info['prod_id'] = '61'
     76
    7677
    7778info['student_name'] = s_brain.name
  • WAeUP_SRP/base/skins/waeup_epayment/payments_view.pt

    r2153 r2461  
    5757        <br />
    5858        <div>
    59           <form tal:condition="info/online_payment"
     59          <form tal:condition="python: info.get('payment_method') == 'online_payment'"
    6060                tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
    6161            <input type="submit" name="epayment"
     
    6464                   />
    6565          </form> 
    66           <form tal:condition="info/sc_payment"
     66          <form tal:condition="python: info.get('payment_method') == 'sc_payment'"
    6767                tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
    6868            <input type="hidden" name="paid_session"
     
    7575                   />
    7676          </form>         
     77          <div tal:condition="python: info.get('payment_method') == 'not_possible'">
     78            You are not able to pay your schoolfee because: <br />
     79            <ul>
     80              <li tal:repeat="reason info/reasons" />
     81            </ul>
     82          </div>
    7783        </div>       
    7884      </span>
     
    8086  </metal:main>
    8187</metal:body>
    82  
  • WAeUP_SRP/base/skins/waeup_student/getNextInfo.py

    r2459 r2461  
    1818level_id = student_brain.level
    1919review_state = student_brain.review_state
    20 verdict = student_brain.verdict
     20info['verdict'] = student_brain.verdict
    2121info['next_transition'] = None
    2222info['next_session_id'] = next_session_id = session_id
    2323info['next_level_id'] = next_level_id = level_id
    24 
     24reasons = []
     25verdicts_voc = context.portal_vocabularies.verdicts
    2526if review_state == 'cleared_and_validated':
    2627    info['next_transition'] = "pay_school_fee"
     
    3233        if verdict not in ('A','B',):
    3334            info['next_level_id'] = level_id
    34 
     35            if not verdict:
     36                reasons += "There is no verdict."
     37            else:
     38                reasons += "Your are not a %s" % verdicts_voc.get('A')
     39                reasons += "or not a %s" % verdicts_voc.get('B')
     40        else:
     41            info['next_transition'] = "pay_school_fee"
     42info['reasons'] = reasons
    3543info['next_session_str'] = context.sessions_voc(next_session_id)
    3644
Note: See TracChangeset for help on using the changeset viewer.