Changeset 15344 for main/kofacustom.edopoly
- Timestamp:
- 6 Mar 2019, 21:21:38 (6 years ago)
- Location:
- main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/tests/test_utils.py
r15284 r15344 36 36 site['configuration'].next_matric_integer_2 = 1 37 37 site['configuration'].next_matric_integer_3 = 1 38 site['configuration'].next_matric_integer_4 = 139 38 self.student.matric_number = None 40 39 # nd_ft … … 42 41 msg, mnumber = utils.setMatricNumber(self.student) 43 42 self.assertEqual(self.student.matric_number, 'fac1/ND/04/00001') 43 self.assertEqual(site['configuration'].next_matric_integer, 2) 44 44 self.assertEqual(msg, None) 45 45 # hnd_ft … … 48 48 msg, mnumber = utils.setMatricNumber(self.student) 49 49 self.assertEqual(self.student.matric_number, 'fac1/HD/04/00001') 50 self.assertEqual(site['configuration'].next_matric_integer_2, 2) 50 51 self.assertEqual(msg, None) 51 52 # nd_pt … … 54 55 msg, mnumber = utils.setMatricNumber(self.student) 55 56 self.assertEqual(self.student.matric_number, 'fac1/PT/04/00001') 57 self.assertEqual(site['configuration'].next_matric_integer_3, 2) 56 58 self.assertEqual(msg, None) 57 59 return -
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py
r15301 r15344 93 93 req_payments_titles = 'ICT and Logbook' 94 94 if len(student['payments']): 95 # All ND and HND part time do not pay LOGBOOK95 # All ND and HND part time do not pay for LOGBOOK 96 96 if student.current_mode.endswith('_pt'): 97 97 req_payments = ('ict_entre',) 98 98 req_payments_titles = 'ICT' 99 # HND2 full time do not pay for SIWES 100 #elif student.current_mode == 'hnd_ft' and student.state == RETURNING: 101 # req_payments = ('ict_entre', 'logbook_combo') 102 # req_payments_titles = 'ICT and Logbook' 103 # HND1 full time do not pay both LOGBOOK 104 elif student.current_mode == 'hnd_ft' and student.state == CLEARED: 99 # HND1 and HND2 full time do not pay for LOGBOOK 100 elif student.current_mode == 'hnd_ft' and student.state in ( 101 CLEARED, RETURNING): 105 102 req_payments = ('ict_entre',) 106 103 req_payments_titles = 'ICT' 107 # ND2 FULL TIME Do not pay LOGBOOK104 # ND2 FULL TIME do not pay LOGBOOK 108 105 elif student.current_mode == 'nd_ft' and student.state == RETURNING: 109 106 req_payments = ('ict_entre',) 110 107 req_payments_titles = 'ICT' 111 # ND1 full time do not pay SIWES112 #elif student.current_mode == 'nd_ft' and student.state == CLEARED:113 # req_payments = ('ict_entre', 'logbook_combo')114 # req_payments_titles = 'ICT and Logbook'115 108 num = 0 116 109 for ticket in student['payments'].values(): … … 265 258 return _('Matriculation number cannot be set.'), None 266 259 260 261 def increaseMatricInteger(self, student): 262 """Increase counter for matric numbers. 263 """ 264 if student.current_mode == 'nd_ft': 265 grok.getSite()['configuration'].next_matric_integer += 1 266 return 267 elif student.current_mode == 'hnd_ft': 268 grok.getSite()['configuration'].next_matric_integer_2 += 1 269 return 270 elif student.current_mode in ('nd_pt', 'hnd_pt'): 271 grok.getSite()['configuration'].next_matric_integer_3 += 1 272 return 273 return 274 267 275 def getAccommodationDetails(self, student): 268 276 """Determine the accommodation data of a student.
Note: See TracChangeset for help on using the changeset viewer.