Changeset 8306 for main/waeup.uniben/trunk/src/waeup/uniben/students
- Timestamp:
- 29 Apr 2012, 06:26:08 (13 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
r8294 r8306 166 166 ticket = self.student['payments'].items()[0][1] 167 167 ticket.p_state = 'paid' 168 IWorkflowState(self.student).setState('returning')169 168 self.browser.open(self.payments_path + '/addop') 170 169 self.browser.getControl("Create ticket").click() … … 206 205 self.assertMatches('...ticket created...', 207 206 self.browser.contents) 208 self.certificate.study_mode = 'ug_pt'209 207 self.browser.open(self.payments_path + '/addop') 210 208 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 211 209 self.browser.getControl("Create ticket").click() 210 self.assertMatches('...ticket created...', 211 self.browser.contents) 212 # In state returning we can add a new school fee ticket since 213 # p_session and p_level is different 214 IWorkflowState(self.student).setState('returning') 215 self.browser.open(self.payments_path + '/addop') 216 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 217 self.browser.getControl("Create ticket").click() 218 self.assertMatches('...ticket created...', 219 self.browser.contents) 220 IWorkflowState(self.student).setState('admitted') 221 self.browser.open(self.payments_path + '/addop') 222 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 223 self.browser.getControl("Create ticket").click() 212 224 self.assertMatches('...Amount could not be determined...', 213 225 self.browser.contents) 214 226 215 # If the session configuration doesn't exist an derror message will216 # be shown 227 # If the session configuration doesn't exist an error message will 228 # be shown. No other requirement is being checked. 217 229 del self.app['configuration']['2004'] 218 230 self.browser.open(self.payments_path) -
main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
r8294 r8306 17 17 ## 18 18 import grok 19 from waeup.kofa.interfaces import CLEARED, RETURNING 19 20 from waeup.kofa.students.workflow import CLEARED, RETURNING 20 21 from waeup.kofa.students.utils import StudentsUtils … … 24 25 25 26 def get_school_fee(student): 26 study_mode = student['studycourse'].certificate.study_mode27 entry_mode = student['studycourse'].entry_mode28 27 state = student.state 29 #lga = student.lga 30 lga = 'nothing' 31 current_level = student['studycourse'].current_level 32 33 if study_mode.endswith('_ft'): 34 # fresh 35 if state == CLEARED: 36 return 40000.0 37 # returning 38 elif state == RETURNING: 39 return 20000.0 40 else: 41 return 0.0 42 else: 43 return 0.0 28 fee = None 29 if state == CLEARED: 30 fee = getattr(student['studycourse'].certificate,'school_fee_1') 31 elif state == RETURNING: 32 fee = getattr(student['studycourse'].certificate,'school_fee_2') 33 if fee is not None: 34 return fee 35 return 0.0 44 36 45 37 def actions_after_student_payment(student, payment, view): … … 90 82 91 83 def getPaymentDetails(self, category, student): 92 d = {}93 d ['p_item'] = u''94 d ['amount'] = 0.095 d ['error'] = u''96 d ['p_session'] = student['studycourse'].current_session97 session = str(d ['p_session'])98 d ['p_level'] = student['studycourse'].current_level84 details = {} 85 details['p_item'] = u'' 86 details['amount'] = 0.0 87 details['error'] = u'' 88 details['p_session'] = student['studycourse'].current_session 89 session = str(details['p_session']) 90 details['p_level'] = student['studycourse'].current_level 99 91 try: 100 92 academic_session = grok.getSite()['configuration'][session] 101 93 except KeyError: 102 d ['error'] = _(u'Session configuration object is not available.')103 return d 94 details['error'] = _(u'Session configuration object is not available.') 95 return details 104 96 if category == 'transfer': 105 d ['amount'] = academic_session.transfer_fee97 details['amount'] = academic_session.transfer_fee 106 98 elif category == 'gown': 107 d ['amount'] = academic_session.gown_fee99 details['amount'] = academic_session.gown_fee 108 100 elif category == 'bed_allocation': 109 d ['amount'] = academic_session.booking_fee101 details['amount'] = academic_session.booking_fee 110 102 elif category == 'hostel_maintenance': 111 d ['amount'] = academic_session.maint_fee103 details['amount'] = academic_session.maint_fee 112 104 elif category == 'clearance': 113 d ['p_item'] = student['studycourse'].certificate.code114 if d ['p_item'] in ('BEDCET', 'BIOEDCET', 'CHMEDCET', 'ISEDCET',105 details['p_item'] = student['studycourse'].certificate.code 106 if details['p_item'] in ('BEDCET', 'BIOEDCET', 'CHMEDCET', 'ISEDCET', 115 107 'MTHEDCET', 'PHYEDCET', 'ITECET', 'AGREDCET', 'HEEDCET'): 116 d ['amount'] = 17250.0108 details['amount'] = 17250.0 117 109 else: 118 d ['amount'] = 34250.0110 details['amount'] = 34250.0 119 111 elif category == 'schoolfee': 120 d ['amount'] = get_school_fee(student)112 details['amount'] = get_school_fee(student) 121 113 code = student['studycourse'].certificate.code 122 d['p_item'] = code 123 # In case of school fee payment the payment session and level 124 # contain the values of the session the student has paid for 125 d['p_session'], d['p_level'] = self.getReturningData(student) 126 if d['amount'] == 0.0: 127 d['error'] = _(u'Amount could not be determined.') 128 return d 114 details['p_item'] = code 115 if student.state == RETURNING: 116 # In case of returning school fee payment the payment session 117 # and level contain the values of the session the student 118 # has paid for. 119 details['p_session'], details['p_level'] = self.getReturningData(student) 120 if details['amount'] == 0.0: 121 details['error'] = _(u'Amount could not be determined.') 122 return details 129 123 130 124 VERDICTS_DICT = {
Note: See TracChangeset for help on using the changeset viewer.