Changeset 16899 for main/waeup.fceokene/trunk/src/waeup
- Timestamp:
- 22 Mar 2022, 12:46:49 (3 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py
r16365 r16899 129 129 self.assertMatches('...ticket created...', 130 130 self.browser.contents) 131 self.certificate.study_mode = 'nce_sw'132 self.browser.open(self.payments_path + '/addop')133 self.browser.getControl(name="form.p_category").value = ['third_semester']134 self.browser.getControl("Create ticket").click()135 self.assertMatches('...could not be determined...',136 self.browser.contents)137 self.certificate.study_mode = 'nce_ft'138 self.browser.open(self.payments_path + '/addop')139 self.browser.getControl(name="form.p_category").value = ['third_semester']140 self.student['studycourse'].current_level = 300141 self.browser.getControl("Create ticket").click()142 self.assertMatches('...Make NCE 3 school fee payment first...', self.browser.contents)131 #self.certificate.study_mode = 'nce_sw' 132 #self.browser.open(self.payments_path + '/addop') 133 #self.browser.getControl(name="form.p_category").value = ['third_semester'] 134 #self.browser.getControl("Create ticket").click() 135 #self.assertMatches('...could not be determined...', 136 # self.browser.contents) 137 #self.certificate.study_mode = 'nce_ft' 138 #self.browser.open(self.payments_path + '/addop') 139 #self.browser.getControl(name="form.p_category").value = ['third_semester'] 140 #self.student['studycourse'].current_level = 300 141 #self.browser.getControl("Create ticket").click() 142 #self.assertMatches('...Amount could not be determined...', self.browser.contents) 143 143 self.browser.open(self.payments_path + '/addop') 144 144 self.browser.getControl( … … 290 290 self.assertEqual(error, None) 291 291 292 error, payment = utils.setPaymentDetails('third_semester',self.student)293 self.assertEqual(error, u'Amount could not be determined.')294 self.student['studycourse'].current_level = 300295 error, payment = utils.setPaymentDetails('third_semester',self.student)296 self.assertEqual(error, u'Make NCE 3 school fee payment first.')297 payment = createObject('waeup.StudentOnlinePayment')298 payment.p_category = u'schoolfee'299 payment.p_session = self.student.current_session300 payment.p_item = u'My Certificate'301 payment.p_id = u'anyid'302 self.student['payments']['anykey'] = payment303 payment.p_state = 'paid'304 payment.p_level = 300305 error, payment = utils.setPaymentDetails('third_semester',self.student)306 self.assertEqual(payment.p_level, 300)307 self.assertEqual(payment.p_session, 2004)308 self.assertEqual(payment.amount_auth, 7938)309 self.assertEqual(payment.p_item, u'')310 self.assertEqual(error, None)292 #error, payment = utils.setPaymentDetails('third_semester',self.student) 293 #self.assertEqual(error, u'Amount could not be determined.') 294 #self.student['studycourse'].current_level = 300 295 #error, payment = utils.setPaymentDetails('third_semester',self.student) 296 #self.assertEqual(error, u'Amount could not be determined.') 297 #payment = createObject('waeup.StudentOnlinePayment') 298 #payment.p_category = u'schoolfee' 299 #payment.p_session = self.student.current_session 300 #payment.p_item = u'My Certificate' 301 #payment.p_id = u'anyid' 302 #self.student['payments']['anykey'] = payment 303 #payment.p_state = 'paid' 304 #payment.p_level = 300 305 #error, payment = utils.setPaymentDetails('third_semester',self.student) 306 #self.assertEqual(payment.p_level, 300) 307 #self.assertEqual(payment.p_session, 2004) 308 #self.assertEqual(payment.amount_auth, 7938) 309 #self.assertEqual(payment.p_item, u'') 310 #self.assertEqual(error, None) 311 311 312 312 self.certificate.study_mode = u'nce_sw' 313 313 error, payment = utils.setPaymentDetails('hostel_maintenance',self.student) 314 self.assertEqual(payment.p_level, 300)314 self.assertEqual(payment.p_level, 100) 315 315 self.assertEqual(payment.p_session, 2004) 316 316 self.assertEqual(payment.amount_auth, 547.5) # 62.5% * 876 … … 319 319 320 320 error, payment = utils.setPaymentDetails('bed_allocation',self.student) 321 self.assertEqual(payment.p_level, 300)321 self.assertEqual(payment.p_level, 100) 322 322 self.assertEqual(payment.p_session, 2004) 323 323 self.assertEqual(payment.amount_auth, 150) -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py
r16891 r16899 72 72 return new_session, new_level 73 73 74 def _nce3PaymentMade(self, student, p_level):75 if len(student['payments']):76 for ticket in student['payments'].values():77 if ticket.p_state in ('paid', 'scholarship', 'waived') and \78 ticket.p_level == p_level and \79 ticket.p_category == 'schoolfee':80 return True81 return False74 #def _nce3PaymentMade(self, student, p_level): 75 # if len(student['payments']): 76 # for ticket in student['payments'].values(): 77 # if ticket.p_state in ('paid', 'scholarship', 'waived') and \ 78 # ticket.p_level == p_level and \ 79 # ticket.p_category == 'schoolfee': 80 # return True 81 # return False 82 82 83 83 def setPaymentDetails(self, category, student, … … 126 126 if student.state not in (ADMITTED, CLEARANCE, REQUESTED, CLEARED): 127 127 return _(u'Acceptance Fee payments not allowed.'), None 128 elif category == 'third_semester' and student.current_mode == 'nce_ft' \ 129 and p_level in (300, 310, 320, 400, 410, 420): 130 if not self._nce3PaymentMade(student, p_level): 131 return _(u'Make NCE 3 school fee payment first.'), None 132 if student.depcode in ARTS: 133 amount = 7688.0 134 else: 135 amount = 7938.0 136 no_additional_courses = 0 137 courses_level = student['studycourse'].get(str(p_level)) 138 if courses_level and len(courses_level)> 6: 139 no_additional_courses = len(courses_level)-6 140 amount += 2000.0 * no_additional_courses 128 #elif category == 'third_semester' and student.current_mode == 'nce_ft' \ 129 # and p_level in (300, 310, 320, 400, 410, 420): 130 # #if not self._nce3PaymentMade(student, p_level): 131 # # return _(u'Make NCE 3 school fee payment first.'), None 132 # no_additional_courses = 0 133 # courses_level = student['studycourse'].get(str(p_level)) 134 # if courses_level and len(courses_level)> 6: 135 # no_additional_courses = len(courses_level)-6 136 # amount = 2000.0 * no_additional_courses 141 137 elif category.startswith('schoolfee'): 142 138 if category == 'schoolfee_pde1': … … 145 141 if student.state != CLEARED: 146 142 return _('You are not a fresh student.'), None 143 if category == 'schoolfee_third': 144 if not student.current_mode == 'nce_ft' \ 145 or not p_level in (300, 310, 320, 400, 410, 420): 146 return _('You are not an NCE 3 student.'), None 147 147 p_item = student.certcode 148 148 if not p_item: … … 211 211 else: 212 212 amount = 25000 213 # NCE III third semester 214 elif category == 'schoolfee_third': 215 amount = 7000 213 216 # NCE III 214 217 elif student.current_level in (200, 210, 220): -
main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py
r16891 r16899 88 88 'schoolfee': 'School Fee', 89 89 'schoolfee_pde1': 'School Fee 1st instalment (new PDE students only)', 90 'schoolfee_third': 'NCE Third Semester Fee (6 courses)', 90 91 'clearance': 'Acceptance Fee', 91 92 'bed_allocation': 'Bed Allocation Fee', 92 93 'hostel_maintenance': 'Hostel Maintenance Fee', 93 94 'application': 'Application Fee', 94 'third_semester': 'NCE Third Semester Fee (fee depends on the number of courses registered)', 95 'third_semester': 'NCE Third Semester Fee (additional courses)', 96 } 97 98 SELECTABLE_PAYMENT_CATEGORIES = { 99 'schoolfee': 'School Fee', 100 'schoolfee_pde1': 'School Fee 1st instalment (new PDE students only)', 101 'schoolfee_third': 'NCE Third Semester Fee (6 courses)', 102 'clearance': 'Acceptance Fee', 103 'bed_allocation': 'Bed Allocation Fee', 104 'hostel_maintenance': 'Hostel Maintenance Fee', 105 'application': 'Application Fee', 106 #'third_semester': 'NCE Third Semester Fee (additional courses)', 95 107 } 96 108 … … 101 113 } 102 114 115 BALANCE_PAYMENT_CATEGORIES = { 116 'schoolfee': 'School Fee', 117 'third_semester': 'NCE Third Semester Fee (N2000 per additional course)', 118 } 119 103 120 def selectable_payment_categories(self, student): 104 return self. PAYMENT_CATEGORIES121 return self.SELECTABLE_PAYMENT_CATEGORIES 105 122 106 123 VERDICTS_DICT = {
Note: See TracChangeset for help on using the changeset viewer.