Changeset 13512
- Timestamp:
- 30 Nov 2015, 14:56:37 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r13438 r13512 218 218 xmldict['joint_venture_amt'] = 100 * joint_venture_amt 219 219 xmldict['aaue_share_amt'] = 100 * aaue_share_amt 220 if self.context.p_category == 'schoolfee_incl':220 if self.context.p_category in ('schoolfee_incl', 'schoolfee_1'): 221 221 # Schoolfee including additional fees 222 222 xmldict['student_union_due_amt'] = 100 * student_union_due_amt -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r13489 r13512 144 144 academic_session = None 145 145 text = '\n\n The Amount Authorized is inclusive of: ' 146 if self.context.p_category == 'schoolfee_incl' and academic_session: 146 if self.context.p_category in ('schoolfee_incl', 'schoolfee_1') \ 147 and academic_session: 147 148 welfare_fee = gateway_net_amt(academic_session.welfare_fee) 148 149 union_fee = gateway_net_amt(academic_session.union_fee) -
main/waeup.aaue/trunk/src/waeup/aaue/students/payments.py
r13400 r13512 49 49 def redeemTicket(self): 50 50 student = self.student 51 if self.p_category .startswith('schoolfee'):51 if self.p_category in ('schoolfee', 'schoolfee_incl', 'schoolfee_1') : 52 52 # Bypass activation code creation if next session 53 53 # can be started directly. -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13489 r13512 178 178 self.assertMatches('...ticket created...', 179 179 self.browser.contents) 180 181 def deactivated_test_for_instalment_payments(self): 180 return 181 182 def test_for_instalment_payments(self): 183 self.student['studycourse'].certificate.school_fee_1 = 6666.0 184 self.app['configuration']['2004'].union_fee = 1250.0 185 self.app['configuration']['2004'].welfare_fee = 750.0 186 self.student.nationality = u'NG' 182 187 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 183 self.browser.open(self.payments_path)184 188 self.browser.open(self.payments_path + '/addop') 185 189 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 186 190 self.browser.getControl("Create ticket").click() 187 self.assertMatches('...ticket created...', 188 self.browser.contents) 191 self.assertTrue( 192 'Wrong state. Only students in state \'cleared\' are allowed to pay by instalments' 193 in self.browser.contents) 194 IWorkflowState(self.student).setState('cleared') 195 self.browser.open(self.payments_path + '/addop') 196 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 197 self.browser.getControl("Create ticket").click() 198 self.assertTrue('ticket created' in self.browser.contents) 189 199 # We can't add the 2nd instalment ticket because the 190 200 # first one has not yet been approved. 191 self.browser.open(self.payments_path + '/addop')192 self.browser.getControl(name="form.p_category").value = ['schoolfee_2']193 self.browser.getControl("Create ticket").click()194 self.assertMatches('...1st school fee instalment has not yet been paid...',195 self.browser.contents)201 #self.browser.open(self.payments_path + '/addop') 202 #self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] 203 #self.browser.getControl("Create ticket").click() 204 #self.assertMatches('...1st school fee instalment has not yet been paid...', 205 # self.browser.contents) 196 206 # Ok, then we approve the first instalment ... 197 207 self.browser.open(self.payments_path) … … 203 213 self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] 204 214 self.browser.getControl("Create ticket").click() 205 self.assertMatches('...ticket created...', 206 self.browser.contents) 215 self.assertTrue('ticket created' in self.browser.contents) 207 216 # ... approve the second instalment ... 208 217 ctrl = self.browser.getControl(name='val_id') 209 218 p_id = ctrl.options[1] 210 219 self.browser.open(self.payments_path + '/' + p_id + '/approve') 211 # ... and finally add the 1st instalment for the next session 212 # provided that student is returning. 213 IWorkflowState(self.student).setState('returning') 214 self.browser.open(self.payments_path + '/addop') 215 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 216 self.browser.getControl("Create ticket").click() 217 self.assertMatches('...Session configuration object is not...', 218 self.browser.contents) 219 # Uups, we forgot to add a session configuration for next session 220 configuration = createObject('waeup.SessionConfiguration') 221 configuration.academic_session = 2005 222 self.app['configuration'].addSessionConfiguration(configuration) 223 self.app['configuration']['2005'].school_base = 7777.0 224 self.browser.open(self.payments_path + '/addop') 225 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 226 self.browser.getControl("Create ticket").click() 227 self.assertMatches('...ticket created...', 228 self.browser.contents) 229 # If the session configuration doesn't exist an error message will 230 # be shown. No other requirement is being checked. 231 del self.app['configuration']['2004'] 232 self.browser.open(self.payments_path) 233 self.browser.getLink("Add current session payment ticket").click() 234 self.browser.getControl("Create ticket").click() 235 self.assertMatches('...Session configuration object is not...', 236 self.browser.contents) 220 self.assertEqual(self.student['payments'].values()[0].p_category, 'schoolfee_1') 221 self.assertEqual(self.student['payments'].values()[1].p_category, 'schoolfee_2') 222 # 6666/2 + 1250 + 750 - 500 223 self.assertEqual(self.student['payments'].values()[0].amount_auth, 4833.0) 224 # 6666/2 225 self.assertEqual(self.student['payments'].values()[1].amount_auth, 3333.0) 226 return 237 227 238 228 def test_manage_payments_bypass_ac_creation(self): -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13506 r13512 178 178 except (AttributeError, TypeError): 179 179 return _('Study course data are incomplete.'), None 180 if student.state == CLEARED :180 if student.state == CLEARED or category == 'schoolfee_2': 181 181 if student.is_foreigner: 182 182 amount = getattr(certificate, 'school_fee_3', 0.0) 183 183 else: 184 184 amount = getattr(certificate, 'school_fee_1', 0.0) 185 # Cut school fee by 50% 186 if category in ('schoolfee_1', 'schoolfee_2'): 187 amount = amount / 2 188 elif category == 'schoolfee_1': 189 return _("Wrong state. Only students in state 'cleared' " 190 "are allowed to pay by instalments."), None 185 191 elif student.state == RETURNING: 186 192 if not student.father_name: … … 204 210 return _(u'Amount could not be determined.'), None 205 211 # Add Student Union Fee and Welfare Assurance 206 if category == 'schoolfee_incl':212 if category in ('schoolfee_incl', 'schoolfee_1'): 207 213 amount += gateway_net_amt(academic_session.welfare_fee) + \ 208 214 gateway_net_amt(academic_session.union_fee) -
main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
r13498 r13512 29 29 PAYMENT_CATEGORIES = { 30 30 'schoolfee': 'School Fee', 31 'schoolfee_1': 'School Fee 1st instalment',32 'schoolfee_2': 'School Fee 2nd instalment',31 'schoolfee_1': 'School Fee Plus (1st instalment)', 32 'schoolfee_2': 'School Fee (2nd instalment)', 33 33 'schoolfee_incl': 'School Fee Plus', 34 34 'clearance': 'Acceptance Fee', … … 49 49 SELECTABLE_PAYMENT_CATEGORIES = { 50 50 'schoolfee': 'School Fee without additional fees', 51 #'schoolfee_1': 'School Fee 1st instalment',52 #'schoolfee_2': 'School Fee 2nd instalment',51 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', 52 'schoolfee_2': 'School Fee (2nd instalment)', 53 53 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', 54 54 'clearance': 'Acceptance Fee without additional fees',
Note: See TracChangeset for help on using the changeset viewer.