Changeset 3242
- Timestamp:
- 26 Feb 2008, 22:56:33 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py
r3240 r3242 27 27 pass 28 28 29 30 #import logging31 #logger = logging.getLogger('Skins.getPaymentsFolderInfo')32 29 def cmp_id(a,b): 33 30 s1 = "%(id)s" % a … … 66 63 info['reasons'] = next_info['reasons'] 67 64 65 # begin customization 66 68 67 if review_state == 'cleared_and_validated': 69 68 info['payment_method'] = "online_payment" … … 73 72 info['payment_method'] = "online_payment" 74 73 info['prod_id'] = '83' 74 75 # end customization 75 76 76 77 info['student_name'] = student_record.name … … 92 93 payment.date.strftime("%d/%m/%y %H:%M:%S")) 93 94 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',) 95 96 row['is_approvable'] = is_so and row['is_requeryable'] and payment.category == 'schoolfee' # does not make sense for maitenance 96 97 row['resp_desc'] = payment.resp_desc or 'Payment Process Interrupted' … … 114 115 row['is_editable'] = is_so and (row['confirmed'] == 'active') 115 116 payments.append(row) 116 # for payment_id,payment in context.objectItems():117 # row = {}118 # row['id'] = payment_id119 # row['title'] = payment.Title()120 # url = row['url'] = payment.absolute_url()121 # payment_doc = payment.getContent()122 # row['type'] = payment_doc.portal_type123 # 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'] = False129 # #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'] = True136 # row['callback_url'] = "%(url)s/interswitch_cb" % row137 # href = '%(query_url)s' % info138 # href += '?transRef=%(trans_ref)s' % row139 # href += '&prodID=%(prod_id)s' % info140 # href += '&redirectURL=%(callback_url)s' % row141 # row['href'] = href142 # 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'] = True146 # row['callback_url'] = "%(url)s/interswitch_acco_cb" % row147 # href = '%(query_url)s' % info148 # href += '?transRef=%(trans_ref)s' % row149 # href += '&prodID=%(prod_id)s' % info150 # href += '&redirectURL=%(callback_url)s' % row151 # row['href'] = href152 # 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_so161 162 # for so in sos:163 # row = {}164 # row['id'] = so.getId165 # row['title'] = so.Title166 # url = row['url'] = "%s/%s" % (payments_path,so.getId)167 # so_doc = context.restrictedTraverse(url,default=None).getContent()168 # row['type'] = so.portal_type169 # review_state = row['review_state'] = so.review_state170 # 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'] = False175 # #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'] = True182 # row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(),183 # so.getId)184 # href = '%(query_url)s' % info185 # href += '?transRef=%(trans_ref)s' % row186 # href += '&prodID=%(prod_id)s' % info187 # href += '&redirectURL=%(callback_url)s' % row188 # row['href'] = href189 # 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'] = True193 # row['callback_url'] = "%s/payments/%s/interswitch_acco_cb" % (student.absolute_url(),194 # so.getId)195 # href = '%(query_url)s' % info196 # href += '?transRef=%(trans_ref)s' % row197 # href += '&prodID=%(prod_id)s' % info198 # href += '&redirectURL=%(callback_url)s' % row199 # row['href'] = href200 # 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)206 117 207 118 payments.sort(cmp_id)
Note: See TracChangeset for help on using the changeset viewer.