Ignore:
Timestamp:
8 Jan 2019, 17:56:31 (6 years ago)
Author:
Henrik Bettermann
Message:

Change matric number construction algorithm.

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

    r15176 r15284  
    4141        self.certificate.study_mode ='nd_ft'
    4242        msg, mnumber = utils.setMatricNumber(self.student)
    43         self.assertEqual(self.student.matric_number, 'ESITM/fac1/dep1/04/00001')
     43        self.assertEqual(self.student.matric_number, 'fac1/ND/04/00001')
    4444        self.assertEqual(msg, None)
    4545        # hnd_ft
     
    4747        self.certificate.study_mode ='hnd_ft'
    4848        msg, mnumber = utils.setMatricNumber(self.student)
    49         self.assertEqual(self.student.matric_number, 'ESITM/fac1/dep1/HND/04/00001')
     49        self.assertEqual(self.student.matric_number, 'fac1/HD/04/00001')
    5050        self.assertEqual(msg, None)
    5151        # nd_pt
     
    5353        self.certificate.study_mode ='nd_pt'
    5454        msg, mnumber = utils.setMatricNumber(self.student)
    55         self.assertEqual(self.student.matric_number, 'ESITM/PT-ND/fac1/dep1/04/00001')
     55        self.assertEqual(self.student.matric_number, 'fac1/PT/04/00001')
    5656        self.assertEqual(msg, None)
    5757        return
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py

    r15223 r15284  
    235235    def constructMatricNumber(self, student):
    236236        faccode = student.faccode
    237         depcode = student.depcode
    238         certcode = student.certcode
     237        #depcode = student.depcode
     238        #certcode = student.certcode
    239239        year = unicode(student.entry_session)[2:]
    240240        if not student.state in (PAID, ) or not student.is_fresh:
    241241            return _('Matriculation number cannot be set.'), None
    242242
    243         # ESITM/ENG/MEC/11/5367
     243        # SASND1809001
    244244        if student.current_mode == 'nd_ft':
    245245            next_integer = grok.getSite()['configuration'].next_matric_integer
    246246            if next_integer == 0:
    247247                return _('Matriculation number cannot be set.'), None
    248             return None, "ESITM/%s/%s/%s/%05d" % (
    249                 faccode, depcode, year, next_integer)
    250 
    251         # ESITM/ENG/MEC/HND/11/5367
     248            return None, "%s/ND/%s/%05d" % (faccode, year, next_integer)
     249
     250        # SASNH1809001
    252251        if student.current_mode == 'hnd_ft':
    253252            next_integer = grok.getSite()['configuration'].next_matric_integer_2
    254253            if next_integer == 0:
    255254                return _('Matriculation number cannot be set.'), None
    256             return None, "ESITM/%s/%s/HND/%s/%05d" % (
    257                 faccode, depcode, year, next_integer)
    258 
    259         # ESITM/PT-ND/ENG/MEC/11/5367
    260         if student.current_mode == 'nd_pt':
     255            return None, "%s/HD/%s/%05d" % (faccode, year, next_integer)
     256
     257        # SASPT1809001
     258        if student.current_mode in ('nd_pt', 'hnd_pt'):
    261259            next_integer = grok.getSite()['configuration'].next_matric_integer_3
    262260            if next_integer == 0:
    263261                return _('Matriculation number cannot be set.'), None
    264             return None, "ESITM/PT-ND/%s/%s/%s/%05d" % (
    265                 faccode, depcode, year, next_integer)
    266 
    267         # ???
    268         if student.current_mode == 'hnd_pt':
    269             pass
     262            return None, "%s/PT/%s/%05d" % (faccode, year, next_integer)
    270263
    271264        return _('Matriculation number cannot be set.'), None
Note: See TracChangeset for help on using the changeset viewer.