Changeset 3242


Ignore:
Timestamp:
26 Feb 2008, 22:56:33 (17 years ago)
Author:
Henrik Bettermann
Message:

more adjustments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py

    r3240 r3242  
    2727        pass
    2828
    29 
    30 #import logging
    31 #logger = logging.getLogger('Skins.getPaymentsFolderInfo')
    3229def cmp_id(a,b):
    3330    s1 = "%(id)s" % a
     
    6663info['reasons'] = next_info['reasons']
    6764
     65# begin customization
     66
    6867if review_state == 'cleared_and_validated':
    6968    info['payment_method'] = "online_payment"
     
    7372    info['payment_method'] = "online_payment"
    7473info['prod_id'] = '83'
     74
     75# end customization
    7576
    7677info['student_name'] = student_record.name
     
    9293                                                        payment.date.strftime("%d/%m/%y %H:%M:%S"))
    9394    url = row['url'] = "%s/p%s" % (payments_path,payment.order_id[6:])
    94     row['is_requeryable'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees or str(member) in ('admin',)
     95    row['is_requeryable'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees and payment.type == 'online' or str(member) in ('admin',)
    9596    row['is_approvable'] = is_so and row['is_requeryable'] and payment.category == 'schoolfee' # does not make sense for maitenance
    9697    row['resp_desc'] = payment.resp_desc or 'Payment Process Interrupted'
     
    114115    row['is_editable'] = is_so and (row['confirmed'] == 'active')
    115116    payments.append(row)
    116 # for payment_id,payment in context.objectItems():
    117 #     row = {}
    118 #     row['id'] = payment_id
    119 #     row['title'] = payment.Title()
    120 #     url = row['url'] = payment.absolute_url()
    121 #     payment_doc = payment.getContent()
    122 #     row['type'] = payment_doc.portal_type
    123 #     review_state = row['review_state'] = wftool.getInfoFor(payment,'review_state',None)
    124 #     if payment_doc.type_description.startswith('School Fee'):
    125 #         row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated'
    126 #     else:
    127 #         row['is_approvable'] = is_so and (review_state == "opened")
    128 #     row['is_requeryable'] = False
    129 #     #set_trace()
    130 #     row['resp_desc'] = getattr(payment_doc,'resp_desc','no response')
    131 #     row['trans_ref'] = getattr(payment_doc,'order_id','')
    132 #     if payment_doc.type_description.startswith('School Fee'):
    133 #         if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated',) and \
    134 #             hasattr(payment_doc, 'order_id') and not payment_doc.resp_code) or str(member) in ('admin',):
    135 #             row['is_requeryable'] = True
    136 #             row['callback_url'] = "%(url)s/interswitch_cb" % row
    137 #             href = '%(query_url)s' % info
    138 #             href += '?transRef=%(trans_ref)s' % row
    139 #             href += '&prodID=%(prod_id)s' % info
    140 #             href += '&redirectURL=%(callback_url)s' % row
    141 #             row['href'] = href
    142 #     elif payment_doc.type_description.startswith('Hostel'):
    143 #         if (review_state == 'opened' and \
    144 #             hasattr(payment_doc, 'order_id') and not payment_doc.resp_code) or str(member) in ('admin','delejason','isouaba'):
    145 #             row['is_requeryable'] = True
    146 #             row['callback_url'] = "%(url)s/interswitch_acco_cb" % row
    147 #             href = '%(query_url)s' % info
    148 #             href += '?transRef=%(trans_ref)s' % row
    149 #             href += '&prodID=%(prod_id)s' % info
    150 #             href += '&redirectURL=%(callback_url)s' % row
    151 #             row['href'] = href
    152 #     if (review_state == "closed") and payment_doc.resp_code in ('SC','00','AP','IP',):
    153 #         row['confirmed'] = 'active'
    154 #     else:
    155 #         row['confirmed'] = 'unsuccessful'
    156 #     row['is_editable'] = is_so and (row['confirmed'] == 'active')
    157 #     payments.append(row)
    158 # payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)
    159 # sos = context.portal_catalog(container_path=payments_path)
    160 # info['is_so'] = is_so
    161 
    162 # for so in sos:
    163 #     row = {}
    164 #     row['id'] = so.getId
    165 #     row['title'] = so.Title
    166 #     url = row['url'] = "%s/%s" % (payments_path,so.getId)
    167 #     so_doc = context.restrictedTraverse(url,default=None).getContent()
    168 #     row['type'] = so.portal_type
    169 #     review_state = row['review_state'] = so.review_state
    170 #     if so_doc.type_description.startswith('School Fee'):
    171 #         row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] in ('cleared_and_validated','returning')
    172 #     else:
    173 #         row['is_approvable'] = False    # is_so and (review_state == "opened")
    174 #     row['is_requeryable'] = False
    175 #     #set_trace()
    176 #     row['resp_desc'] = getattr(so_doc,'resp_desc','no response')
    177 #     row['trans_ref'] = getattr(so_doc,'order_id','')
    178 #     if so_doc.type_description.startswith('School Fee'):
    179 #         if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated','returning') and \
    180 #                                   hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'):
    181 #             row['is_requeryable'] = True
    182 #             row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(),
    183 #                                                             so.getId)
    184 #             href = '%(query_url)s' % info
    185 #             href += '?transRef=%(trans_ref)s' % row
    186 #             href += '&prodID=%(prod_id)s' % info
    187 #             href += '&redirectURL=%(callback_url)s' % row
    188 #             row['href'] = href
    189 #     elif so_doc.type_description.startswith('Hostel'):
    190 #         if (review_state == 'opened' and \
    191 #                                   hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'):
    192 #             row['is_requeryable'] = True
    193 #             row['callback_url'] = "%s/payments/%s/interswitch_acco_cb" % (student.absolute_url(),
    194 #                                                             so.getId)
    195 #             href = '%(query_url)s' % info
    196 #             href += '?transRef=%(trans_ref)s' % row
    197 #             href += '&prodID=%(prod_id)s' % info
    198 #             href += '&redirectURL=%(callback_url)s' % row
    199 #             row['href'] = href
    200 #     if (review_state == "closed") and so_doc.resp_code in ('SC','00','AP','IP',):
    201 #         row['confirmed'] = 'active'
    202 #     else:
    203 #         row['confirmed'] = 'unsuccessful'
    204 #     row['is_editable'] = is_so and (row['confirmed'] == 'active')
    205 #     payments.append(row)
    206117
    207118payments.sort(cmp_id)
Note: See TracChangeset for help on using the changeset viewer.