Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py	(revision 10691)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py	(revision 10692)
@@ -20,12 +20,13 @@
 from zope.component import getUtility
 from hurry.workflow.interfaces import IWorkflowInfo
-from waeup.kofa.interfaces import ADMITTED
+from waeup.kofa.interfaces import ADMITTED, IKofaUtils
 from waeup.kofa.browser.layout import UtilityView
 from waeup.kofa.students.interfaces import IStudentsUtils
 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
 from waeup.kofa.students.browser import (
-    StartClearancePage, BedTicketAddPage, ExportPDFAdmissionSlipPage)
+    StartClearancePage, BedTicketAddPage, ExportPDFAdmissionSlipPage,
+    StudentBasePDFFormPage)
 from waeup.kwarapoly.students.interfaces import (
-    ICustomStudent, ICustomStudentBase)
+    ICustomStudent, ICustomStudentBase, ICustomStudentStudyLevel)
 from waeup.kwarapoly.interfaces import MessageFactory as _
 from waeup.kofa.students.workflow import (
@@ -37,4 +38,5 @@
     NigeriaExportPDFPaymentSlipPage,
     NigeriaStudentClearanceEditFormPage,
+    NigeriaExportPDFCourseRegistrationSlipPage,
     )
 
@@ -129,2 +131,77 @@
             self.context.student, omit_fields=self.omit_fields,
             pre_text=pre_text, post_text=post_text)
+
+# copied from waeup.aaue
+class CustomExportPDFCourseRegistrationSlipPage(
+    NigeriaExportPDFCourseRegistrationSlipPage):
+    """Deliver a PDF slip of the context.
+    """
+    grok.context(ICustomStudentStudyLevel)
+    form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit(
+        'level_session', 'level_verdict',
+        'validated_by', 'validation_date', 'gpa')
+
+    omit_fields = ('password', 'suspended', 'suspended_comment',
+        'phone', 'adm_code', 'sex', 'email', 'date_of_birth',
+        'department', 'current_mode')
+
+    @property
+    def title(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        return translate(_('Credits Registered'), 'waeup.kofa',
+            target_language=portal_language)
+
+    def _signatures(self):
+        return (
+            [('I have selected the course on the advise of my Head of '
+             'Department. <br>', _('Student\'s Signature'), '<br>')],
+            [('This student has satisfied the department\'s requirements. '
+             'I recommend to approve the course registration. <br>',
+             _('Head of Department\'s Signature'), '<br>')],
+            [('' , _('Principal Assistant Registrar\'s Signature'), '<br>')],
+            [('', _('Director\'s Signature'))]
+            )
+
+    def render(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        Sem = translate('Sem.', 'waeup.kofa', target_language=portal_language)
+        Code = translate('Code', 'waeup.kofa', target_language=portal_language)
+        Title = translate('Title', 'waeup.kofa', target_language=portal_language)
+        Cred = translate('Cred.', 'waeup.kofa', target_language=portal_language)
+        Score = translate('Score', 'waeup.kofa', target_language=portal_language)
+        Grade = translate('Grade', 'waeup.kofa', target_language=portal_language)
+        Signature = translate(_('HOD\'s Signature'), 'waeup.kwarapoly',
+            target_language=portal_language)
+        studentview = StudentBasePDFFormPage(self.context.student,
+            self.request, self.omit_fields)
+        students_utils = getUtility(IStudentsUtils)
+
+        tabledata = []
+        tableheader = []
+        contenttitle = []
+        for i in range(1,7):
+            tabledata.append(sorted(
+                [value for value in self.context.values() if value.semester == i],
+                key=lambda value: str(value.semester) + value.code))
+            tableheader.append([(Code,'code', 2.0),
+                               (Title,'title', 7),
+                               (Cred, 'credits', 1.5),
+                               (Score, 'score', 1.4),
+                               (Grade, 'grade', 1.4),
+                               (Signature, 'dummy', 3),
+                               ])
+        if len(self.label.split('\n')) == 3:
+            topMargin = 1.9
+        elif len(self.label.split('\n')) == 2:
+            topMargin = 1.7
+        else:
+            topMargin = 1.5
+        return students_utils.renderPDF(
+            self, 'course_registration_slip.pdf',
+            self.context.student, studentview,
+            tableheader=tableheader,
+            tabledata=tabledata,
+            signatures=self._signatures(),
+            topMargin=topMargin,
+            omit_fields=self.omit_fields
+            )
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 10691)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 10692)
@@ -32,4 +32,5 @@
 from waeup.kofa.interfaces import (
     IExtFileStore, IFileStoreNameChooser)
+from waeup.kofa.browser.tests.test_pdf import samples_dir
 from waeup.kofa.students.interfaces import IStudentsUtils
 from waeup.kwarapoly.testing import FunctionalLayer
@@ -348,5 +349,4 @@
 
     def test_pdf_slips(self):
-        IWorkflowState(self.student).setState('school fee paid')
         # Login
         self.browser.open(self.login_path)
@@ -354,4 +354,6 @@
         self.browser.getControl(name="form.password").value = 'spwd'
         self.browser.getControl("Login").click()
+        # admission slip
+        IWorkflowState(self.student).setState('school fee paid')
         self.browser.open(self.student_path)
         self.browser.getLink("Download admission letter").click()
@@ -359,4 +361,7 @@
         self.assertEqual(self.browser.headers['Content-Type'],
                          'application/pdf')
+        path = os.path.join(samples_dir(), 'admission_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF admission_slip_slip.pdf written to %s" % path
         self.browser.open(self.student_path)
         self.assertRaises(
@@ -364,5 +369,5 @@
         self.browser.open(self.student_path, 'admission_notification.pdf')
         self.assertFalse('Not allowed' in self.browser.contents)
-
+        # admission notification
         IWorkflowState(self.student).setState('cleared')
         self.browser.open(self.student_path)
@@ -371,4 +376,7 @@
         self.assertEqual(self.browser.headers['Content-Type'],
                          'application/pdf')
+        path = os.path.join(samples_dir(), 'admission_notification.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF admission_notification.pdf written to %s" % path
         self.browser.open(self.student_path)
         self.assertRaises(
@@ -377,2 +385,25 @@
         self.assertFalse('Not allowed' in self.browser.contents)
         return
+
+    def test_course_registration_pdf_slip(self):
+        # Student cant login if their password is not set
+        IWorkflowState(self.student).setState('school fee paid')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.student_id
+        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl("Login").click()
+        self.browser.getLink("Study Course").click()
+        self.browser.getLink("Add course list").click()
+        self.assertMatches('...Add current level 100 (Year 1)...',
+                           self.browser.contents)
+        self.browser.getControl("Create course list now").click()
+        # A level with one course ticket was created
+        self.browser.getLink("100").click()
+        self.browser.getLink("Download course registration slip").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'],
+                         'application/pdf')
+        path = os.path.join(samples_dir(), 'course_registration_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF course_registration_slip.pdf written to %s" % path
+        return
