Changeset 3069 for WAeUP_SRP/fceokene/waeup_custom
- Timestamp:
- 30 Jan 2008, 19:16:38 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/fceokene/waeup_custom/getPaymentsFolderInfo.py
r3026 r3069 14 14 15 15 mtool = context.portal_membership 16 wftool = context.portal_workflow 16 17 member = mtool.getAuthenticatedMember() 17 18 if mtool.isAnonymousUser(): … … 74 75 75 76 info['student_name'] = student_record.name 76 payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)77 sos = context.portal_catalog(container_path=payments_path)78 info['is_so'] = is_so79 77 80 for so in sos:78 for payment_id,payment in context.objectItems(): 81 79 row = {} 82 row['id'] = so.getId83 row['title'] = so.Title84 url = row['url'] = "%s/%s" % (payments_path,so.getId)85 so_doc = context.restrictedTraverse(url,default=None).getContent()86 row['type'] = so.portal_type87 review_state = row['review_state'] = so.review_state88 if so_doc.type_description.startswith('School Fee'):89 row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] in ('cleared_and_validated','returning')80 row['id'] = payment_id 81 row['title'] = payment.Title() 82 url = row['url'] = payment.absolute_url() 83 payment_doc = payment.getContent() 84 row['type'] = payment_doc.portal_type 85 review_state = row['review_state'] = wftool.getInfoFor(payment,'review_state',None) 86 if payment_doc.type_description.startswith('School Fee'): 87 row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated' 90 88 else: 91 row['is_approvable'] = False #is_so and (review_state == "opened")89 row['is_approvable'] = is_so and (review_state == "opened") 92 90 row['is_requeryable'] = False 93 91 #set_trace() 94 row['resp_desc'] = getattr( so_doc,'resp_desc','no response')95 row['trans_ref'] = getattr( so_doc,'order_id','')96 if so_doc.type_description.startswith('School Fee'):97 if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated', 'returning') and \98 hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'):92 row['resp_desc'] = getattr(payment_doc,'resp_desc','no response') 93 row['trans_ref'] = getattr(payment_doc,'order_id','') 94 if payment_doc.type_description.startswith('School Fee'): 95 if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated',) and \ 96 hasattr(payment_doc, 'order_id') and not payment_doc.resp_code) or str(member) in ('admin',): 99 97 row['is_requeryable'] = True 100 row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(), 101 so.getId) 98 row['callback_url'] = "%(url)s/interswitch_cb" % row 102 99 href = '%(query_url)s' % info 103 100 href += '?transRef=%(trans_ref)s' % row … … 105 102 href += '&redirectURL=%(callback_url)s' % row 106 103 row['href'] = href 107 elif so_doc.type_description.startswith('Hostel'):104 elif payment_doc.type_description.startswith('Hostel'): 108 105 if (review_state == 'opened' and \ 109 hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'):106 hasattr(payment_doc, 'order_id') and not payment_doc.resp_code) or str(member) in ('admin','delejason','isouaba'): 110 107 row['is_requeryable'] = True 111 row['callback_url'] = "%s/payments/%s/interswitch_acco_cb" % (student.absolute_url(), 112 so.getId) 108 row['callback_url'] = "%(url)s/interswitch_acco_cb" % row 113 109 href = '%(query_url)s' % info 114 110 href += '?transRef=%(trans_ref)s' % row … … 116 112 href += '&redirectURL=%(callback_url)s' % row 117 113 row['href'] = href 118 if (review_state == "closed") and so_doc.resp_code in ('SC','00','AP','IP',):114 if (review_state == "closed") and payment_doc.resp_code in ('SC','00','AP','IP',): 119 115 row['confirmed'] = 'active' 120 116 else: … … 122 118 row['is_editable'] = is_so and (row['confirmed'] == 'active') 123 119 payments.append(row) 120 # payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id) 121 # sos = context.portal_catalog(container_path=payments_path) 122 # info['is_so'] = is_so 123 124 # for so in sos: 125 # row = {} 126 # row['id'] = so.getId 127 # row['title'] = so.Title 128 # url = row['url'] = "%s/%s" % (payments_path,so.getId) 129 # so_doc = context.restrictedTraverse(url,default=None).getContent() 130 # row['type'] = so.portal_type 131 # review_state = row['review_state'] = so.review_state 132 # if so_doc.type_description.startswith('School Fee'): 133 # row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] in ('cleared_and_validated','returning') 134 # else: 135 # row['is_approvable'] = False # is_so and (review_state == "opened") 136 # row['is_requeryable'] = False 137 # #set_trace() 138 # row['resp_desc'] = getattr(so_doc,'resp_desc','no response') 139 # row['trans_ref'] = getattr(so_doc,'order_id','') 140 # if so_doc.type_description.startswith('School Fee'): 141 # if (review_state == 'opened' and info['review_state'] in ('cleared_and_validated','returning') and \ 142 # hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'): 143 # row['is_requeryable'] = True 144 # row['callback_url'] = "%s/payments/%s/interswitch_cb" % (student.absolute_url(), 145 # so.getId) 146 # href = '%(query_url)s' % info 147 # href += '?transRef=%(trans_ref)s' % row 148 # href += '&prodID=%(prod_id)s' % info 149 # href += '&redirectURL=%(callback_url)s' % row 150 # row['href'] = href 151 # elif so_doc.type_description.startswith('Hostel'): 152 # if (review_state == 'opened' and \ 153 # hasattr(so_doc, 'order_id') and not so_doc.resp_code) or str(member) in ('admin','delejason','isouaba'): 154 # row['is_requeryable'] = True 155 # row['callback_url'] = "%s/payments/%s/interswitch_acco_cb" % (student.absolute_url(), 156 # so.getId) 157 # href = '%(query_url)s' % info 158 # href += '?transRef=%(trans_ref)s' % row 159 # href += '&prodID=%(prod_id)s' % info 160 # href += '&redirectURL=%(callback_url)s' % row 161 # row['href'] = href 162 # if (review_state == "closed") and so_doc.resp_code in ('SC','00','AP','IP',): 163 # row['confirmed'] = 'active' 164 # else: 165 # row['confirmed'] = 'unsuccessful' 166 # row['is_editable'] = is_so and (row['confirmed'] == 'active') 167 # payments.append(row) 124 168 125 169 payments.sort(cmp_id)
Note: See TracChangeset for help on using the changeset viewer.