Index: main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/utils.py
===================================================================
--- main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/utils.py	(revision 18341)
+++ main/kofacustom.unidel/trunk/src/kofacustom/unidel/students/utils.py	(revision 18366)
@@ -523,2 +523,14 @@
     #        return 5, self.GPABoundaries()[5][1]
     #    return
+
+    def constructMatricNumber(self, student):
+        faccode = student.faccode
+        #depcode = student.depcode
+        #certcode = student.certcode
+        if not student.state in (PAID, ) or not student.is_fresh:
+            return _('Matriculation number cannot be set.'), None
+        year = unicode(student.entry_session)[2:]
+        next_integer = grok.getSite()['configuration'].next_matric_integer
+        if next_integer == 0:
+            return _('Matriculation number cannot be set.'), None
+        return None, "%s%s%05d" % (faccode, year, next_integer)
