Ignore:
Timestamp:
25 Mar 2024, 10:33:29 (9 months ago)
Author:
Henrik Bettermann
Message:

Students can set metric number if acceptance fee has been paid.

Location:
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/tests/test_utils.py

    r17397 r17727  
    3939        # nd_ft
    4040        self.certificate.study_mode ='nd_ft'
     41        msg, mnumber = utils.setMatricNumber(self.student)
     42        self.assertEqual(msg, 'Matriculation number cannot be set.')
     43        error, payment = utils.setPaymentDetails('clearance',self.student)
     44        payment.p_state = 'paid'
     45        self.student['payments']['any_key'] = payment
    4146        msg, mnumber = utils.setMatricNumber(self.student)
    4247        self.assertEqual(self.student.matric_number, 'fac1/ND/04/00001')
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py

    r17704 r17727  
    248248        #depcode = student.depcode
    249249        #certcode = student.certcode
     250        clearance_paid = False
     251        if len(student['payments']):
     252            for ticket in student['payments'].values():
     253                if ticket.p_state == 'paid' and \
     254                    ticket.p_category == 'clearance' and \
     255                    ticket.p_session == student.entry_session:
     256                        clearance_paid = True
     257                        break
     258        if not clearance_paid or not student.is_fresh:
     259            return _('Matriculation number cannot be set.'), None
    250260        year = unicode(student.entry_session)[2:]
    251         if not student.state in (PAID, ) or not student.is_fresh:
    252             return _('Matriculation number cannot be set.'), None
    253 
    254261        # SASND1809001
    255262        if student.current_mode == 'nd_ft':
Note: See TracChangeset for help on using the changeset viewer.