Changeset 13777 for main/waeup.uniben/trunk/src/waeup/uniben
- Timestamp:
- 11 Mar 2016, 14:21:02 (9 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r13756 r13777 633 633 self.assertEqual(error, None) 634 634 635 self.certificate.study_mode = 'ug_ft' 635 636 error, payment = utils.setPaymentDetails('bed_allocation', 636 637 self.student, None, None) … … 645 646 self.assertEqual(payment.amount_auth, 650.0) # plus 500 student union 646 647 self.assertEqual(payment.p_item, u'regular_male_fr') 648 self.assertEqual(error, None) 649 650 self.certificate.study_mode = 'pg_ft' 651 error, payment = utils.setPaymentDetails('bed_allocation', 652 self.student, None, None) 653 self.assertEqual(payment.p_level, 100) 654 self.assertEqual(payment.p_session, 2004) 655 self.assertEqual(payment.amount_auth, 150.0) 656 self.assertEqual(payment.p_item, u'pg_male_all') 647 657 self.assertEqual(error, None) 648 658 -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r13757 r13777 65 65 else: 66 66 return _("Outside booking period.") 67 if student.current_mode != 'ug_ft':67 if not student.is_postgrad and student.current_mode != 'ug_ft': 68 68 return _("Only undergraduate full-time students are eligible to book accommodation.") 69 69 bt = acc_details.get('bt') … … 77 77 'match accommodation session.') 78 78 stage = bt.split('_')[2] 79 if stage != 'fr' and not student[79 if not student.is_postgrad and stage != 'fr' and not student[ 80 80 'studycourse'].previous_verdict in ('A', 'B', 'F', 'J', 'C', 'Z'): 81 81 return _("Your are not eligible to book accommodation.") … … 104 104 if None in (entry_session, current_level, certificate): 105 105 return d 106 end_level = certificate.end_level107 if current_level == 10:108 bt = 'pr'109 elif entry_session == grok.getSite()['hostels'].accommodation_session:110 bt = 'fr'111 elif current_level >= end_level:112 bt = 'fi'113 else:114 bt = 're'115 106 if student.sex == 'f': 116 107 sex = 'female' 117 108 else: 118 109 sex = 'male' 119 special_handling = 'regular' 120 if student.faccode in ('MED', 'DEN'): 121 special_handling = 'clinical' 122 elif student.certcode in ('BARTMAS', 'BARTTHR', 'BARTFAA', 123 'BAEDFAA', 'BSCEDECHED'): 124 special_handling = 'ekenwan' 110 if student.is_postgrad: 111 bt = 'all' 112 special_handling = 'pg' 113 else: 114 end_level = certificate.end_level 115 if current_level == 10: 116 bt = 'pr' 117 elif entry_session == grok.getSite()['hostels'].accommodation_session: 118 bt = 'fr' 119 elif current_level >= end_level: 120 bt = 'fi' 121 else: 122 bt = 're' 123 special_handling = 'regular' 124 if student.faccode in ('MED', 'DEN'): 125 special_handling = 'clinical' 126 elif student.certcode in ('BARTMAS', 'BARTTHR', 'BARTFAA', 127 'BAEDFAA', 'BSCEDECHED'): 128 special_handling = 'ekenwan' 125 129 d['bt'] = u'%s_%s_%s' % (special_handling,sex,bt) 126 130 return d … … 194 198 amount = academic_session.booking_fee 195 199 # Add student union dues 196 stage = self.getAccommodationDetails(student)['bt'] 197 stage = stage.split('_')[2] 198 ##################################################### 199 #if stage == 'fi': 200 # return _('Payment temporarily disabled.'), None 201 ##################################################### 202 if stage == 'fr': 203 amount += 500.0 204 elif stage in ('fi', 're') and student[ 205 'studycourse'].previous_verdict in ('A', 'B', 'F', 'J', 'C', 'Z'): 206 amount += 300.0 207 else: 208 amount = 0.0 200 if not student.is_postgrad: 201 stage = self.getAccommodationDetails(student)['bt'] 202 stage = stage.split('_')[2] 203 if stage == 'fr': 204 amount += 500.0 205 elif stage in ('fi', 're') and student[ 206 'studycourse'].previous_verdict in ('A', 'B', 'F', 'J', 'C', 'Z'): 207 amount += 300.0 208 else: 209 amount = 0.0 209 210 elif category == 'hostel_maintenance': 210 211 amount = 0.0
Note: See TracChangeset for help on using the changeset viewer.