Changeset 10181 for main/waeup.aaua
- Timestamp:
- 16 May 2013, 04:42:47 (11 years ago)
- Location:
- main/waeup.aaua/trunk/src/waeup/aaua/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaua/trunk/src/waeup/aaua/students/tests/test_browser.py
r10180 r10181 157 157 error, payment = utils.setPaymentDetails('schoolfee_1',self.student) 158 158 self.assertEqual(payment.amount_auth, 80.0) 159 error, payment = utils.setPaymentDetails('schoolfee_2',self.student)160 self.assertEqual(payment.amount_auth, 120.0)161 159 IWorkflowState(self.student).setState('cleared') 162 160 error, payment = utils.setPaymentDetails('schoolfee_1',self.student) 163 161 self.assertEqual(payment.amount_auth, 40.0) 162 163 # schoolfee_2 payment is state-independent 164 self.student['studycourse'].entry_session = 2003 165 error, payment = utils.setPaymentDetails('schoolfee_2',self.student) 166 self.assertEqual(payment.amount_auth, 120.0) 167 self.student['studycourse'].entry_session = 2004 164 168 error, payment = utils.setPaymentDetails('schoolfee_2',self.student) 165 169 self.assertEqual(payment.amount_auth, 60.0) -
main/waeup.aaua/trunk/src/waeup/aaua/students/utils.py
r10180 r10181 50 50 return _(u'Session configuration object is not available.'), None 51 51 # Determine fee. 52 if category in ('schoolfee', 'schoolfee_1', 'schoolfee_2'):53 try:54 certificate = student['studycourse'].certificate55 p_item = certificate.code56 except (AttributeError, TypeError):57 return _('Study course data are incomplete.'), None58 ratio = getattr(certificate, 'ratio', 0.0)59 if ratio is None:60 ratio = 0.052 try: 53 certificate = student['studycourse'].certificate 54 p_item = certificate.code 55 except (AttributeError, TypeError): 56 return _('Study course data are incomplete.'), None 57 ratio = getattr(certificate, 'ratio', 0.0) 58 if ratio is None: 59 ratio = 0.0 60 if category in ('schoolfee', 'schoolfee_1'): 61 61 if category == 'schoolfee' and ratio > 0: 62 62 return _('Payment by instalments required.'), None 63 if category in ('schoolfee_1', 'schoolfee_2')and ratio == 0:63 if category =='schoolfee_1' and ratio == 0: 64 64 return _('Payment by instalments not allowed.'), None 65 65 if student.state == CLEARED: … … 68 68 elif category == 'schoolfee_1': 69 69 amount = getattr(certificate, 'school_fee_1', 0.0) * ratio 70 elif category == 'schoolfee_2':71 amount = getattr(certificate, 'school_fee_1', 0.0) * (1- ratio)72 70 elif student.state == RETURNING: 73 71 # In case of returning school fee payment the … … 87 85 if student['studycourse'].entry_session in (2005, 2006, 2007): 88 86 amount -= 20000.0 89 elif category == 'schoolfee_2' and ratio:90 amount = getattr(certificate, 'school_fee_2', 0.0) * (1- ratio)91 87 elif student.is_postgrad and student.state == PAID: 92 88 # Returning postgraduate students also pay for the … … 103 99 elif category == 'schoolfee_1': 104 100 amount = getattr(certificate, 'school_fee_2', 0.0) * ratio 105 elif category == 'schoolfee_2' and ratio: 106 amount = getattr(certificate, 'school_fee_2', 0.0) * (1- ratio) 101 elif category == 'schoolfee_2': 102 if ratio == 0: 103 return _('Payment by instalments not allowed.'), None 104 if student['studycourse'].entry_session == student.current_session: 105 amount = getattr(certificate, 'school_fee_1', 0.0) * (1- ratio) 106 else: 107 amount = getattr(certificate, 'school_fee_2', 0.0) * (1- ratio) 107 108 if amount in (0.0, None): 108 109 return _('Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.