Changeset 8775
- Timestamp:
- 22 Jun 2012, 16:40:39 (12 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r8753 r8775 261 261 self.assertMatches('...ticket created...', 262 262 self.browser.contents) 263 # In state returning we can't add a new school fee ticket 264 # for the next session because the second instalment is missing ... 265 IWorkflowState(self.student).setState('returning') 266 self.browser.open(self.payments_path + '/addop') 267 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] 268 self.browser.getControl("Create ticket").click() 269 self.assertMatches('...2nd school fee instalment has not yet been paid...', 270 self.browser.contents) 263 # We can't add the 2nd instalment ticket because the 264 # first one has not yet been approved. 271 265 self.browser.open(self.payments_path + '/addop') 272 266 self.browser.getControl(name="form.p_category").value = ['schoolfee_2'] 273 # ... and the first one has not yet been approved.274 267 self.browser.getControl("Create ticket").click() 275 268 self.assertMatches('...1st school fee instalment has not yet been paid...', … … 289 282 p_id = ctrl.options[1] 290 283 self.browser.open(self.payments_path + '/' + p_id + '/approve') 291 # ... and finally add the 1st instalment for the next session. 284 # ... and finally add the 1st instalment for the next session 285 # provided that student is returning. 286 IWorkflowState(self.student).setState('returning') 292 287 self.browser.open(self.payments_path + '/addop') 293 288 self.browser.getControl(name="form.p_category").value = ['schoolfee_1'] -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r8769 r8775 95 95 for key in student['payments'].keys(): 96 96 ticket = student['payments'][key] 97 if ticket.p_category == 'schoolfee_1': 97 if ticket.p_category == 'schoolfee_1' and \ 98 ticket.p_state == 'paid': 98 99 initial_instalment_made = True 99 100 if ticket.p_state == 'paid' and\ 100 ticket.p_category == 'schoolfee_2' and \101 ticket.p_item == p_item and \102 ticket.p_session == p_session-1: # = current session103 payment_allowed = True101 ticket.p_category == 'schoolfee_2' and \ 102 ticket.p_item == p_item and \ 103 ticket.p_session == p_session-1: # = current session 104 payment_allowed = True 104 105 if not initial_instalment_made: 105 106 payment_allowed = True … … 126 127 if not payment_allowed: 127 128 return _('The 1st school fee instalment ' 128 'has not yet been paid.'), None 129 'has not yet been paid or session has ' 130 'not yet been started.'), None 129 131 amount = academic_session.school_fee_base 130 132 if amount in (0.0, None):
Note: See TracChangeset for help on using the changeset viewer.