Changeset 8268 for main/waeup.kofa/trunk/src
- Timestamp:
- 25 Apr 2012, 06:02:54 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8262 r8268 1077 1077 pay_details = students_utils.getPaymentDetails( 1078 1078 p_category,student) 1079 except AttributeError:1079 except (AttributeError, TypeError): 1080 1080 self.flash( 1081 1081 _('Study course data are incomplete.')) … … 1104 1104 payment.p_item = p_item 1105 1105 payment.p_session = p_session 1106 payment.p_level = pay_details['p_level'] 1106 1107 payment.amount_auth = pay_details['amount'] 1107 1108 payment = self._fillCustomFields(payment, pay_details) -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r8245 r8268 502 502 """ 503 503 504 IStudentOnlinePayment['p_session'].order = IStudentOnlinePayment[ 505 'p_item'].order 504 p_level = schema.Int( 505 title = _(u'Payment Level'), 506 required = False, 507 readonly = True, 508 ) 509 510 IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[ 511 'p_session'].order 506 512 507 513 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8264 r8268 1424 1424 self.assertMatches('...Amount Authorized...', 1425 1425 self.browser.contents) 1426 # Payment session and level have been calculated as defined 1427 # in w.k.students.utils 1428 self.assertEqual(self.student['payments'][value].p_session, 2005) 1429 self.assertEqual(self.student['payments'][value].p_level, 200) 1426 1430 1427 1431 # Students can open the callback view which simulates a valid callback -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r8261 r8268 227 227 grok.implements(IStudentsUtils) 228 228 229 def getReturningData(self, student): 230 """ This method defines what happens after school fee payment 231 depending on the student's senate verdict. 232 233 In the base configuration current level is always increased 234 by 100 no matter which verdict has been assigned. 235 """ 236 new_level = student['studycourse'].current_level + 100 237 new_session = student['studycourse'].current_session + 1 238 return new_session, new_level 239 229 240 def setReturningData(self, student): 230 241 """ This method defines what happens after school fee payment 231 depending on the student's senate verdict. 242 depending on the student's senate verdict. It folllows 243 the same algorithm as getReturningData but it also sets the new 244 values 232 245 233 246 In the base configuration current level is always increased 234 247 by 100 no matter which verdict has been assigned. 235 248 """ 236 student['studycourse'].current_level += 100 237 student['studycourse'].current_session += 1 249 new_session, new_level = self.getReturningData(student) 250 student['studycourse'].current_level = new_level 251 student['studycourse'].current_session = new_session 238 252 verdict = student['studycourse'].current_verdict 239 253 student['studycourse'].current_verdict = '0' … … 250 264 d['error'] = u'' 251 265 d['p_session'] = student['studycourse'].current_session 266 d['p_level'] = student['studycourse'].current_level 252 267 session = str(d['p_session']) 253 268 try: … … 259 274 d['amount'] = academic_session.school_fee_base 260 275 d['p_item'] = student['studycourse'].certificate.code 276 # In case of school fee payment the payment session and level 277 # contain the values of the session the student has paid for 278 d['p_session'], d['p_level'] = self.getReturningData(student) 261 279 elif category == 'clearance': 262 280 d['p_item'] = student['studycourse'].certificate.code
Note: See TracChangeset for help on using the changeset viewer.