Ignore:
Timestamp:
22 Mar 2016, 06:20:49 (9 years ago)
Author:
Henrik Bettermann
Message:

School fee payments must not be paid twice.

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

    r13780 r13786  
    324324        open(path, 'wb').write(self.browser.contents)
    325325        print "Sample PDF payment_slip.pdf written to %s" % path
     326        # Another school fee payment cannot be added
     327        self.student['payments'][value].approve()
     328        self.browser.open(self.student_path + '/payments')
     329        self.browser.getLink("Add current session payment ticket").click()
     330        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     331        self.browser.getControl("Create ticket").click()
     332        self.assertTrue(
     333            'Another school fee payment for this session has already been made'
     334            in self.browser.contents)
    326335        # Test hostel maintenance payments
    327336        self.browser.open(self.student_path + '/payments')
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13780 r13786  
    263263        if amount in (0.0, None):
    264264            return _(u'Amount could not be determined.'), None
    265 
    266265        # Create ticket.
    267266        for key in student['payments'].keys():
     
    272271               ticket.p_session == p_session:
    273272                  return _('This type of payment has already been made.'), None
     273            # Additional condition in AAUE
     274            if category in ('schoolfee', 'schoolfee_incl', 'schoolfee_1'):
     275                if ticket.p_state == 'paid' and \
     276                   ticket.p_category in ('schoolfee',
     277                                         'schoolfee_incl',
     278                                         'schoolfee_1') and \
     279                   ticket.p_item == p_item and \
     280                   ticket.p_session == p_session:
     281                      return _(
     282                          'Another school fee payment for this '
     283                          'session has already been made.'), None
     284
    274285        if self._isPaymentDisabled(p_session, category, student):
    275286            return _('Payment temporarily disabled.'), None
Note: See TracChangeset for help on using the changeset viewer.