Changeset 8596 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 2 Jun 2012, 07:24:14 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8556 r8596 1270 1270 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1271 1271 self.browser.open(self.payments_path) 1272 IWorkflowState(self.student).setState('cleared') 1272 1273 self.browser.getControl("Add online payment ticket").click() 1273 1274 self.browser.getControl(name="form.p_category").value = ['schoolfee'] … … 1280 1281 self.assertMatches('...Amount Authorized...', 1281 1282 self.browser.contents) 1283 self.assertEqual(self.student['payments'][value].amount_auth, 40000.0) 1282 1284 payment_url = self.browser.url 1283 1285 … … 1455 1457 self.assertMatches('...Amount Authorized...', 1456 1458 self.browser.contents) 1457 self.assertEqual(self.student['payments'][value].amount_auth, 40000.0)1459 self.assertEqual(self.student['payments'][value].amount_auth, 20000.0) 1458 1460 # Payment session and will be calculated as defined 1459 1461 # in w.k.students.utils because we set changed the state -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r8595 r8596 37 37 from zope.formlib.form import setUpEditWidgets 38 38 39 from waeup.kofa.interfaces import IExtFileStore, IKofaUtils, RETURNING, PAID 39 from waeup.kofa.interfaces import ( 40 IExtFileStore, IKofaUtils, RETURNING, PAID, CLEARED) 40 41 from waeup.kofa.interfaces import MessageFactory as _ 41 42 from waeup.kofa.students.interfaces import IStudentsUtils … … 272 273 if category == 'schoolfee': 273 274 try: 274 amount = getattr( 275 student['studycourse'].certificate,'school_fee_1') 276 p_item = student['studycourse'].certificate.code 275 certificate = student['studycourse'].certificate 276 p_item = certificate.code 277 277 except (AttributeError, TypeError): 278 278 return _('Study course data are incomplete.'), None 279 if student.state == RETURNING: 279 if student.state == CLEARED: 280 amount = getattr(certificate, 'school_fee_1', 0.0) 281 elif student.state == RETURNING: 280 282 # In case of returning school fee payment the payment session 281 283 # and level contain the values of the session the student 282 284 # has paid for. 283 285 p_session, p_level = self.getReturningData(student) 286 amount = getattr(certificate, 'school_fee_2', 0.0) 284 287 elif student.is_postgrad and student.state == PAID: 285 288 # Returning postgraduate students also pay for the next session 286 289 # but their level always remains the same. 287 290 p_session += 1 288 amount = getattr( 289 student['studycourse'].certificate,'school_fee_2') 291 amount = getattr(certificate, 'school_fee_2', 0.0) 290 292 elif category == 'clearance': 291 293 p_item = student['studycourse'].certificate.code
Note: See TracChangeset for help on using the changeset viewer.