Changeset 13403 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 7 Nov 2015, 06:16:00 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r13400 r13403 49 49 50 50 51 def school(student):51 def contr_agreement(student): 52 52 if student.current_mode == 'found' or student.current_mode.endswith('_pt'): 53 return ' pt'54 return ' regular'53 return 'first' 54 return 'second' 55 55 56 56 class CustomInterswitchPageApplicant(InterswitchPageApplicant): … … 141 141 self.redirect(self.url(self.context, '@@index')) 142 142 return 143 if school(student) == 'pt':143 if contr_agreement(student) == 'first': 144 144 self.product_id = PRODUCT_ID_PT 145 145 else: … … 180 180 # Schoolfee 181 181 if self.context.p_category.startswith('schoolfee'): 182 if school(student) == 'pt':183 # PT schoolfee settings182 if contr_agreement(student) == 'first': 183 # First agreement 184 184 provider_amt = 1900.0 185 185 joint_venture_amt = 1100.0 … … 194 194 self.pay_item_id = '105' 195 195 else: 196 # REGULAR schoolfee settings196 # Second agreement 197 197 provider_amt = 1500.0 198 198 joint_venture_amt = 1000.0 … … 249 249 # Clearance 250 250 elif self.context.p_category.startswith('clearance'): 251 if school(student) == 'pt':252 # PT clearance settings251 if contr_agreement(student) == 'first': 252 # First agreement 253 253 if student.current_mode == 'found': 254 254 self.pay_item_id = '102' … … 258 258 xmldict['institution_bank_id'] = '117' 259 259 else: 260 # REGULAR clearance settings260 # Second agreement 261 261 self.pay_item_id = '102' 262 262 xmldict['institution_acct'] = '1010827641' 263 263 xmldict['institution_bank_id'] = '117' 264 265 264 266 265 if self.context.p_category == 'clearance_incl': … … 294 293 </payment_item_detail>""" % xmldict 295 294 296 # Union Due 295 # Union Dues 297 296 elif self.context.p_category == 'union': 298 297 self.pay_item_id = '103' … … 307 306 </payment_item_detail>""" % xmldict 308 307 309 # Lapel 308 # Lapel/File 310 309 elif self.context.p_category == 'lapel': 311 310 self.pay_item_id = '104' … … 320 319 </payment_item_detail>""" % xmldict 321 320 322 # Welfare 321 # Welfare Assurance 323 322 elif self.context.p_category == 'welfare': 324 323 self.pay_item_id = '105' … … 359 358 </payment_item_detail>""" % xmldict 360 359 361 # Medical 360 # Medical Acceptance 362 361 elif self.context.p_category == 'medical': 363 362 self.pay_item_id = '108' … … 423 422 @property 424 423 def product_id(self): 425 if school(self.context.student) == 'pt':424 if contr_agreement(self.context.student) == 'first': 426 425 return PRODUCT_ID_PT 427 426 return PRODUCT_ID_REGULAR -
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
r13402 r13403 139 139 in self.browser.contents) 140 140 self.assertTrue( 141 'item_name="School Fee plus Students\' Union and Welfare Assurance Fees" '141 'item_name="School Fee plus" ' 142 142 'item_amt="4600000" bank_id="7" ' 143 143 'acct_num="1014847058"' in self.browser.contents) … … 213 213 in self.browser.contents) 214 214 self.assertTrue( 215 'item_name="Acceptance Fee plus Matric Gown and Lapel/File Fees" '215 'item_name="Acceptance Fee plus" ' 216 216 'item_amt="4000000" bank_id="117" ' 217 217 'acct_num="1014066976"' in self.browser.contents) -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13374 r13403 296 296 297 297 def test_student_payments(self): 298 self.certificate.study_mode = 'ug_ft' 299 self.student['studycourse'].entry_session = 2013 300 self.student['studycourse'].certificate.school_fee_1 = 50250.0 301 self.app['configuration']['2004'].union_fee = 1000.0 302 self.app['configuration']['2004'].welfare_fee = 500.0 303 self.student.nationality = u'NG' 298 304 # Login 299 IWorkflowState(self.student).setState(' returning')305 IWorkflowState(self.student).setState('cleared') 300 306 self.browser.open(self.login_path) 301 307 self.browser.getControl(name="form.login").value = self.student_id … … 303 309 self.browser.getControl("Login").click() 304 310 self.browser.open(self.student_path + '/payments') 305 self.assertTrue( 306 'Add current session payment ticket' in self.browser.contents) 307 self.assertFalse( 308 'Add previous session payment ticket' in self.browser.contents) 311 self.browser.getLink("Add current session payment ticket").click() 312 self.browser.getControl(name="form.p_category").value = ['schoolfee_incl'] 313 self.browser.getControl("Create ticket").click() 314 self.assertTrue('ticket created' in self.browser.contents) 315 ctrl = self.browser.getControl(name='val_id') 316 value = ctrl.options[0] 317 self.browser.getLink(value).click() 318 self.assertTrue('Amount Authorized' in self.browser.contents) 319 self.assertEqual(self.student['payments'][value].amount_auth, 51750.0) 320 self.browser.open(self.browser.url + '/payment_slip.pdf') 321 self.assertEqual(self.browser.headers['Status'], '200 Ok') 322 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 323 path = os.path.join(samples_dir(), 'payment_slip.pdf') 324 open(path, 'wb').write(self.browser.contents) 325 print "Sample PDF payment_slip.pdf written to %s" % path 309 326 return 310 327 -
main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
r13402 r13403 31 31 'schoolfee_1': 'School Fee 1st instalment', 32 32 'schoolfee_2': 'School Fee 2nd instalment', 33 'schoolfee_incl': 'School Fee plus Students\' Union and Welfare Assurance Fees',33 'schoolfee_incl': 'School Fee plus', 34 34 'clearance': 'Acceptance Fee', 35 'clearance_incl': 'Acceptance Fee plus Matric Gown and Lapel/File Fees',35 'clearance_incl': 'Acceptance Fee plus', 36 36 'hostel_maintenance': 'Hostel Maintenance Fee', 37 37 'application': 'Application Fee', … … 50 50 51 51 SELECTABLE_PAYMENT_CATEGORIES = { 52 'schoolfee': 'School Fee ',52 'schoolfee': 'School Fee without additional fees', 53 53 #'schoolfee_1': 'School Fee 1st instalment', 54 54 #'schoolfee_2': 'School Fee 2nd instalment', 55 'schoolfee_incl': 'School Fee plus Students\' Union and Welfare Assurance Fees',56 'clearance': 'Acceptance Fee ',57 'clearance_incl': 'Acceptance Fee plus Matric Gown and Lapel/File Fees',55 'schoolfee_incl': 'School Fee plus Students\' Union and Welfare Assurance fees', 56 'clearance': 'Acceptance Fee without additional fees', 57 'clearance_incl': 'Acceptance Fee plus Matric Gown and Lapel/File fees', 58 58 'hostel_maintenance': 'Hostel Maintenance Fee', 59 59 'application': 'Application Fee',
Note: See TracChangeset for help on using the changeset viewer.