Changeset 7902 for WAeUP_SRP


Ignore:
Timestamp:
17 Mar 2012, 11:49:56 (13 years ago)
Author:
Henrik Bettermann
Message:

Some improvements and repairs.

Location:
WAeUP_SRP/trunk/skins/waeup_uniben
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py

    r7901 r7902  
    5757# begin customization
    5858
    59 if session in ('11','12','13'):
     59info['payment_method'] = ""
     60
     61if review_state in ('cleared_and_validated', 'returning') and session in ('11','12','13'):
    6062    info['payment_method'] = "online_payment"
     63elif review_state in ('cleared_and_validated', 'returning'):
     64    info['payment_method'] = "sc_payment"
    6165else:
    62     info['payment_method'] = "sc_payment"
     66    info['payment_method'] = ""
    6367
    6468info['prod_id'] = '61'
  • WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt

    r7901 r7902  
    5151       
    5252        <metal:block tal:condition="info/is_etranzact_pmt">
    53         <h3>eTranzact Payment Slip</h3>
     53        <h3>eTranzact Payment Slip/Receipt</h3>
    5454        <br />
    5555        <table tal:define="student info/student;
     
    119119        </tr>
    120120        <tr>
    121           <td width="220px">Transaction Id:</td>
     121          <td width="220px">Transaction Code:</td>
    122122          <td><strong><span tal:content="pm/order_id" /></strong></td>
    123123        </tr>
     
    129129          <td width="220px">Response Description:</td>
    130130          <td><span tal:content="pm/resp_desc" /></td>
     131        </tr>
     132        <tr>
     133          <td width="220px">Response Reference:</td>
     134          <td><span tal:content="pm/resp_pay_reference" /></td>
    131135        </tr>
    132136        </table>
  • WAeUP_SRP/trunk/skins/waeup_uniben/tranzact_cb.py

    r7901 r7902  
    9999    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
    100100
    101 pd['resp_desc'] = success_dict['TRANS_DESCR']
     101pd = {}
     102pd['resp_desc'] = success_dict['TRANS_DESCR'].replace('%20',' ')
    102103pd['resp_pay_reference'] = success_dict['RECEIPT_NO']
    103 pd['resp_code'] = '00'
     104pd['resp_code'] = 'ET'
    104105pd['resp_approved_amount'] = success_dict['TRANS_AMOUNT']
     106pd['status'] = 'paid'
    105107
    106108pay_doc.edit(mapping = pd)
     
    116118next_verdict = next_info['next_verdict']
    117119next_previous_verdict = next_info['next_previous_verdict']
    118 if  resp == '00':
    119     if pay_doc.category == 'schoolfee':
    120         if context.getStudentReviewState() == "school_fee_paid":
    121             logger.info('%s paid school_fee in state school_fee_paid' % (student_id))
    122         else:
    123             study_course = getattr(student,'study_course')
    124             try:
    125                 wftool.doActionFor(study_course,'open')
    126             except:
    127                 pass
    128             verdict = s_brain.verdict
    129             if next_previous_verdict == 'N/A':
    130                 next_previous_verdict = ''
    131             study_course.getContent().edit(mapping= {'current_level': next_level_id,
    132                                                      'current_session': next_session_id,
    133                                                      'current_verdict': next_verdict,
    134                                                      'previous_verdict': next_previous_verdict,
    135                                                      })
    136             if next_transition:
    137                 wftool.doActionFor(student,next_transition)
     120if pay_doc.category == 'schoolfee':
     121    if context.getStudentReviewState() == "school_fee_paid":
     122        logger.info('%s paid school_fee in state school_fee_paid' % (student_id))
     123    else:
     124        study_course = getattr(student,'study_course')
     125        try:
     126            wftool.doActionFor(study_course,'open')
     127        except:
     128            pass
     129        verdict = s_brain.verdict
     130        if next_previous_verdict == 'N/A':
     131            next_previous_verdict = ''
     132        study_course.getContent().edit(mapping= {'current_level': next_level_id,
     133                                                 'current_session': next_session_id,
     134                                                 'current_verdict': next_verdict,
     135                                                 'previous_verdict': next_previous_verdict,
     136                                                 })
     137        if next_transition:
     138            wftool.doActionFor(student,next_transition)
    138139
    139140
    140     elif pay_doc.category == 'hostel_maintenance':
     141elif pay_doc.category == 'hostel_maintenance':
    141142
    142         ## callback function for accommodation_catalog method
    143         data={}
    144         data['acco_maint_date'] = pay_doc.date
    145         data['catkey'] =student_id + '|' + pay_doc.session_id
    146         data['acco_maint_fee'] = pay_doc.amount
    147         data['acco_maint_pay_id'] = context.getId()
    148         data['reservation_status'] = 'maintenance_fee_paid'
    149         context.accommodation_catalog.modifyRecord(**data)
     143    ## callback function for accommodation_catalog method
     144    data={}
     145    data['acco_maint_date'] = pay_doc.date
     146    data['catkey'] =student_id + '|' + pay_doc.session_id
     147    data['acco_maint_fee'] = pay_doc.amount
     148    data['acco_maint_pay_id'] = context.getId()
     149    data['reservation_status'] = 'maintenance_fee_paid'
     150    context.accommodation_catalog.modifyRecord(**data)
    150151
    151         ## callback function for accommodation object method (deactivated since March 2011)
    152         #acco_info = context.getAccommodationInfo()
    153         #d = {}
    154         #d['acco_maint_date'] = pay_doc.date
    155         #d['acco_maint_fee'] = pay_doc.amount
    156         #d['acco_maint_pay_id'] = context.getId()
    157         #try:
    158         #    acco_info['acco_doc'].edit(mapping=d)
    159         #except:
    160         #    logger.info('%s requeried payment though maintenance already paid' % student_id)
    161         #try:
    162         #    wftool.doActionFor(acco_info['acco'],'pay_maintenance_fee',dest_container=acco_info['acco'])
    163         #except:
    164         #    logger.info('%s no workflow action pay_maintenance_fee' % student_id)
     152    ## callback function for accommodation object method (deactivated since March 2011)
     153    #acco_info = context.getAccommodationInfo()
     154    #d = {}
     155    #d['acco_maint_date'] = pay_doc.date
     156    #d['acco_maint_fee'] = pay_doc.amount
     157    #d['acco_maint_pay_id'] = context.getId()
     158    #try:
     159    #    acco_info['acco_doc'].edit(mapping=d)
     160    #except:
     161    #    logger.info('%s requeried payment though maintenance already paid' % student_id)
     162    #try:
     163    #    wftool.doActionFor(acco_info['acco'],'pay_maintenance_fee',dest_container=acco_info['acco'])
     164    #except:
     165    #    logger.info('%s no workflow action pay_maintenance_fee' % student_id)
    165166
    166     elif pay_doc.category == 'acceptance':
    167         if context.getStudentReviewState() in ('admitted', 'objection_raised'):
    168             logger.info('%s paid acceptance fee' % (student_id))
    169             current = DateTime.DateTime()
    170             wf = context.portal_workflow
    171             info = context.getClearanceInfo()
    172             wftool.doActionFor(student,'enter_clearance_pin')
    173             context.waeup_tool.changeWorkflowState(info['clear'], 'opened')
    174             context.waeup_tool.changeWorkflowState(info['app'], 'closed')
    175             dc = {}
    176             app_doc = info['app_doc']
    177             #dc['clr_ac_pin'] = pay_doc.order_id
    178             dc['clr_ac_date'] = current
    179             dc['entry_date'] = current
    180             info['clear_doc'].edit(mapping = dc)
    181             if info['penalty']:
    182                 logger.info('%s started late clearance' % (info['id']))
    183             #return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
     167elif pay_doc.category == 'acceptance':
     168    if context.getStudentReviewState() in ('admitted', 'objection_raised'):
     169        logger.info('%s paid acceptance fee' % (student_id))
     170        current = DateTime.DateTime()
     171        wf = context.portal_workflow
     172        info = context.getClearanceInfo()
     173        wftool.doActionFor(student,'enter_clearance_pin')
     174        context.waeup_tool.changeWorkflowState(info['clear'], 'opened')
     175        context.waeup_tool.changeWorkflowState(info['app'], 'closed')
     176        dc = {}
     177        app_doc = info['app_doc']
     178        #dc['clr_ac_pin'] = pay_doc.order_id
     179        dc['clr_ac_date'] = current
     180        dc['entry_date'] = current
     181        info['clear_doc'].edit(mapping = dc)
     182        if info['penalty']:
     183            logger.info('%s started late clearance' % (info['id']))
     184        #return redirect("%s/clearance_edit_form" % info['clear'].absolute_url())
    184185
    185     logger.info('%s received valid callback' % student_id)
    186 
    187 else:
    188     logger.info('%s received unsuccessful callback: %s' % (student_id,pd['resp_desc']))
     186logger.info('%s received valid callback' % student_id)
    189187
    190188#review_state = wftool.getInfoFor(context,'review_state',None)
Note: See TracChangeset for help on using the changeset viewer.