Changeset 13771 for main/waeup.uniben/trunk/src/waeup
- Timestamp:
- 9 Mar 2016, 10:05:00 (9 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/interswitch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
r13765 r13771 37 37 PROVIDER_ITEM_NAME = 'BT Education' 38 38 INSTITUTION_NAME = 'Uniben' 39 INSTITUTION_ACCT = '2017506430' 40 INSTITUTION_BANK_ID = '8' 39 41 CURRENCY = '566' 40 42 GATEWAY_AMT = 150.0 … … 74 76 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 75 77 # Institution data 76 xmldict['institution_acct'] = '000000000000'77 xmldict['institution_bank_id'] = '00'78 xmldict['institution_acct'] = INSTITUTION_ACCT 79 xmldict['institution_bank_id'] = INSTITUTION_BANK_ID 78 80 xmldict['institution_amt'] = '0.0' 79 81 provider_amt = 0.0 … … 84 86 if student.current_mode.endswith('_ft'): 85 87 self.pay_item_id = '5700' 86 if student.current_mode in ('ug_ft','de_ft','ume_ft'):87 xmldict['institution_acct'] = '2017506430'88 xmldict['institution_bank_id'] = '8'89 elif student.current_mode in ('dp_ft','dp_pt','ct_pt','ct_ft'):90 xmldict['institution_acct'] = '0058653774'91 xmldict['institution_bank_id'] = '72'92 elif student.current_mode in ('pg_ft'):93 xmldict['institution_acct'] = '6230033428'94 xmldict['institution_bank_id'] = '51'95 88 elif student.current_mode.endswith('_pt'): 96 89 self.pay_item_id = '5701' 97 if student.current_mode in ('ug_pt','de_pt'):98 xmldict['institution_acct'] = '0122009929'99 xmldict['institution_bank_id'] = '16'100 elif student.current_mode in ('pg_pt', 'special_pg_pt'):101 xmldict['institution_acct'] = '4150033274'102 xmldict['institution_bank_id'] = '51'103 90 elif student.faccode == 'JUPEB': 104 91 self.pay_item_id = '5718' 105 xmldict['institution_acct'] = '0231462068'106 xmldict['institution_bank_id'] = '16'107 92 elif self.context.p_category == 'clearance': 108 93 self.pay_item_id = '5702' 109 94 provider_amt = 1500.0 110 if student.faccode == 'FCETA':111 xmldict['institution_acct'] = '5210007943'112 xmldict['institution_bank_id'] = '51'113 else:114 xmldict['institution_bank_id'] = '10'115 xmldict['institution_acct'] = '0031716047'116 95 elif self.context.p_category == 'gown': 117 96 self.pay_item_id = '5704' 118 xmldict['institution_bank_id'] = '16'119 xmldict['institution_acct'] = '0122011401'120 97 elif self.context.p_category.startswith('bed_allocation'): 121 98 self.pay_item_id = '5716' 122 students_utils = getUtility(IStudentsUtils)123 stage = students_utils.getAccommodationDetails(student)['bt']124 stage = stage.split('_')[2]125 if stage == 'fr':126 union_dues = 500.0127 else:128 union_dues = 300.0129 xmldict['institution_bank_id'] = '129'130 xmldict['institution_acct'] = '0014419432'131 xmldict['union_dues'] = 100 * union_dues132 99 elif self.context.p_category.startswith('hostel_maintenance'): 133 100 self.pay_item_id = '5705' 134 xmldict['institution_bank_id'] = '129'135 xmldict['institution_acct'] = '0014419432'136 101 137 102 xmldict['provider_amt'] = 100 * provider_amt … … 141 106 self.context.amount_auth - provider_amt - GATEWAY_AMT) 142 107 143 if self.context.p_category == 'bed_allocation': 144 xmldict['institution_amt'] = 100 * ( 145 self.context.amount_auth - GATEWAY_AMT - union_dues) 108 if provider_amt == 0: 146 109 xmltext = """<payment_item_detail> 147 110 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> 148 111 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 149 <item_detail item_id="2" item_name="UNION DUES" item_amt="%(union_dues)d" bank_id="31" acct_num="0005986952" />150 </item_details>151 </payment_item_detail>""" % xmldict152 elif provider_amt == 0:153 xmltext = """<payment_item_detail>154 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">155 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />156 </item_details>157 </payment_item_detail>""" % xmldict158 elif self.context.p_category == 'schoolfee' and \159 student.current_mode == 'ug_ft':160 xmldict['institution_amt'] = 100 * (161 self.context.amount_auth - provider_amt - GATEWAY_AMT - 3000)162 xmltext = """<payment_item_detail>163 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">164 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />165 <item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />166 <item_detail item_id="3" item_name="T-SHIP" item_amt="200000" bank_id="72" acct_num="0061647254" />167 <item_detail item_id="4" item_name="MTN-NET LIBRARY" item_amt="100000" bank_id="8" acct_num="20177722298" />168 112 </item_details> 169 113 </payment_item_detail>""" % xmldict … … 199 143 xmldict = {} 200 144 provider_amt = 400.0 201 if self.applicant.applicant_id[:3] in ('pga', 'pgd'): # CERHI 202 xmldict['institution_acct'] = '1014312532' 203 xmldict['institution_bank_id'] = '117' 204 elif self.applicant.applicant_id.startswith('pg'): 205 xmldict['institution_acct'] = '0031716030' 206 xmldict['institution_bank_id'] = '10' 207 elif self.applicant.applicant_id.startswith('dp'): 208 xmldict['institution_acct'] = '9201805071' 209 xmldict['institution_bank_id'] = '17' 210 elif self.applicant.applicant_id.startswith('pt'): 211 xmldict['institution_acct'] = '9201805071' 212 xmldict['institution_bank_id'] = '17' 213 elif self.applicant.applicant_id.startswith('pre'): 214 xmldict['institution_acct'] = '0025186411' 215 xmldict['institution_bank_id'] = '129' 216 elif self.applicant.applicant_id.startswith('cbt'): 217 xmldict['institution_acct'] = '5030058259' 218 xmldict['institution_bank_id'] = '51' 145 if self.applicant.applicant_id.startswith('cbt'): 219 146 provider_amt = 200.0 220 elif self.applicant.applicant_id.startswith('afak'): 221 xmldict['institution_acct'] = '1014446565' 222 xmldict['institution_bank_id'] = '117' 223 else: 224 xmldict['institution_acct'] = '1014326805' 225 xmldict['institution_bank_id'] = '117' 147 xmldict['institution_acct'] = INSTITUTION_ACCT 148 xmldict['institution_bank_id'] = INSTITUTION_BANK_ID 226 149 xmldict['detail_ref'] = self.context.p_id 227 150 xmldict['provider_amt'] = 100 * provider_amt … … 229 152 xmldict['provider_bank_id'] = PROVIDER_BANK_ID 230 153 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 231 xmldict['institution_amt'] = 100 * (self.context.amount_auth - provider_amt - GATEWAY_AMT) 154 xmldict['institution_amt'] = 100 * ( 155 self.context.amount_auth - provider_amt - GATEWAY_AMT) 232 156 xmldict['institution_item_name'] = self.context.p_category 233 157 xmldict['institution_name'] = INSTITUTION_NAME -
main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
r13251 r13771 95 95 in self.browser.contents) 96 96 self.assertTrue( 97 'item_name="School Fee" item_amt="3 535000" bank_id="8" acct_num="2017506430"'97 'item_name="School Fee" item_amt="3835000" bank_id="8" acct_num="2017506430"' 98 98 in self.browser.contents) 99 99 self.assertTrue( 100 100 'item_name="BT Education" item_amt="150000" bank_id="117" acct_num="1010764827"' 101 in self.browser.contents)102 self.assertTrue(103 'item_name="T-SHIP" item_amt="200000" bank_id="72" acct_num="0061647254"'104 in self.browser.contents)105 self.assertTrue(106 'item_name="MTN-NET LIBRARY" item_amt="100000" bank_id="8" acct_num="20177722298"'107 101 in self.browser.contents) 108 102 … … 144 138 in self.browser.contents) 145 139 self.assertTrue( 146 'item_name="School Fee" item_amt="1835000" bank_id=" 16" acct_num="0122009929"'140 'item_name="School Fee" item_amt="1835000" bank_id="8" acct_num="2017506430"' 147 141 in self.browser.contents) 148 142 self.assertTrue( … … 202 196 in self.browser.contents) 203 197 self.assertTrue( 204 '<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id=" 16" acct_num="0122011401" />'198 '<item_detail item_id="1" item_name="Gown Hire Fee" item_amt="8400" bank_id="8" acct_num="2017506430" />' 205 199 in self.browser.contents) 206 200 self.assertFalse( … … 298 292 in self.browser.contents) 299 293 self.assertTrue( 300 'item_name="School Fee" item_amt="5000" bank_id=" 16" acct_num="0122009929"'294 'item_name="School Fee" item_amt="5000" bank_id="8" acct_num="2017506430"' 301 295 in self.browser.contents) 302 296 self.assertFalse(
Note: See TracChangeset for help on using the changeset viewer.