Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py	(revision 13623)
@@ -22,7 +22,7 @@
 from datetime import datetime
 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
-from waeup.kofa.interfaces import IExtFileStore, IObjectHistory
+from waeup.kofa.interfaces import IExtFileStore, IObjectHistory, IKofaUtils
 from waeup.kofa.browser.layout import action, UtilityView
-from waeup.kofa.utils.helpers import get_current_principal
+from waeup.kofa.utils.helpers import get_current_principal, to_timezone
 from waeup.kofa.students.browser import (
     StudentPersonalDisplayFormPage, StudentPersonalManageFormPage,
@@ -31,4 +31,5 @@
     ExportPDFClearanceSlip, StudentBaseManageFormPage,
     StudentBaseDisplayFormPage,
+    StudentBasePDFFormPage,
     StudentBaseEditFormPage, StudentPersonalEditFormPage,
     OnlinePaymentDisplayFormPage, OnlinePaymentAddFormPage,
@@ -314,2 +315,105 @@
     def render(self):
         return
+
+cleared_note = """
+<br /><br /><br />
+<strong>Financially cleared on %s by %s.</strong>
+
+"""
+
+not_cleared_note = """
+<br /><br /><br />
+<strong>Not yet financially cleared.</strong>
+
+"""
+
+class NigeriaExportPDFBursaryClearancePage(UtilityView, grok.View):
+    """Deliver a PDF bursary clearance slip.
+    """
+    grok.context(INigeriaStudent)
+    grok.name('bursary_clearance_slip.pdf')
+    grok.require('waeup.viewStudent')
+    prefix = 'form'
+
+    omit_fields = (
+        'suspended', 'phone',
+        'adm_code', 'suspended_comment',
+        'date_of_birth', 'current_level')
+
+    form_fields = None
+
+    @property
+    def label(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        return translate(_('Bursary Clearance Slip of'),
+            'waeup.kofa', target_language=portal_language) \
+            + ' %s' % self.context.display_fullname
+
+    def _sigsInFooter(self):
+
+        isStudent = getattr(
+            self.request.principal, 'user_type', None) == 'student'
+        if isStudent:
+            return ()
+        return (_('Date, Student Signature'),
+                _('Date, Bursary Signature'),
+                )
+
+    @property
+    def note(self):
+        if self.context.financially_cleared_by:
+            tz = getUtility(IKofaUtils).tzinfo
+            try:
+                timestamp = to_timezone(
+                    self.context.financial_clearance_date, tz).strftime(
+                        "%Y-%m-%d %H:%M:%S")
+            except ValueError:
+                return not_cleared_note
+            return cleared_note % (
+                timestamp, self.context.financially_cleared_by)
+        return not_cleared_note
+
+    @property
+    def tabletitle(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        tabletitle = []
+        tabletitle.append(translate(_('Successful Payments'), 'waeup.kofa',
+            target_language=portal_language))
+        return tabletitle
+
+    def render(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        P_ID = translate(_('Payment Id'), 'waeup.kofa', target_language=portal_language)
+        #CD = translate(_('Creation Date'), 'waeup.kofa', target_language=portal_language)
+        PD = translate(_('Payment Date'), 'waeup.kofa', target_language=portal_language)
+        CAT = translate(_('Payment Category'), 'waeup.kofa', target_language=portal_language)
+        ITEM = translate(_('Payment Item'), 'waeup.kofa', target_language=portal_language)
+        AMT = translate(_('Amount (Naira)'), 'waeup.kofa', target_language=portal_language)
+        SSS = translate(_('Payment Session'), 'waeup.kofa', target_language=portal_language)
+        studentview = StudentBasePDFFormPage(self.context.student,
+            self.request, self.omit_fields)
+        students_utils = getUtility(IStudentsUtils)
+
+        tabledata = []
+        tableheader = []
+        tabledata.append(sorted(
+            [value for value in self.context['payments'].values()
+             if value.p_state == 'paid'], key=lambda value: value.p_id))
+        tableheader.append([(P_ID,'p_id', 3),
+                         #(CD,'creation_date', 3),
+                         (PD,'formatted_p_date', 3),
+                         (CAT,'category', 3),
+                         (ITEM, 'p_item', 3),
+                         (AMT, 'amount_auth', 2),
+                         (SSS, 'p_session', 2),
+                         ])
+        return students_utils.renderPDF(
+            self, 'bursary_clearance_slip.pdf',
+            self.context.student, studentview,
+            tableheader=tableheader,
+            tabledata=tabledata,
+            signatures=None,
+            sigs_in_footer=self._sigsInFooter(),
+            omit_fields=self.omit_fields,
+            note=self.note
+            )
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/export.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/export.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/export.py	(revision 13623)
@@ -85,5 +85,5 @@
         sorted(iface_names(
             INigeriaStudentOnlinePayment, exclude_attribs=False,
-            omit=['display_item']))) + (
+            omit=['display_item','formatted_p_date']))) + (
             'student_id','state','current_session')
 
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/interfaces.py	(revision 13623)
@@ -519,4 +519,6 @@
     """
 
+    formatted_p_date = Attribute("Formatted pyment date")
+
     p_current = schema.Bool(
         title = _(u'Current Session Payment'),
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/payments.py	(revision 13623)
@@ -20,10 +20,13 @@
 """
 import grok
+from datetime import datetime
+from zope.component import getUtility
 from zope.component.interfaces import IFactory
 from zope.interface import implementedBy
+from waeup.kofa.interfaces import IKofaUtils
 from waeup.kofa.students.interfaces import IStudentNavigation
 from waeup.kofa.students.payments import (
     StudentOnlinePayment, StudentOnlinePaymentFactory)
-from waeup.kofa.utils.helpers import attrs_to_fields
+from waeup.kofa.utils.helpers import attrs_to_fields, to_timezone
 from kofacustom.nigeria.students.interfaces import INigeriaStudentOnlinePayment
 
@@ -47,4 +50,18 @@
         return self.__parent__.__parent__
 
+
+    @property
+    def formatted_p_date(self):
+        if isinstance(self.payment_date, datetime):
+            tz = getUtility(IKofaUtils).tzinfo
+            try:
+                timestamp = to_timezone(
+                    self.payment_date, tz).strftime("%Y-%m-%d %H:%M:%S")
+            except ValueError:
+                return None
+            return timestamp
+        else:
+            return None
+
 NigeriaStudentOnlinePayment = attrs_to_fields(NigeriaStudentOnlinePayment,
     omit=['display_item'])
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py	(revision 13623)
@@ -19,4 +19,5 @@
 import shutil
 import tempfile
+from time import time
 from datetime import datetime, timedelta
 from StringIO import StringIO
@@ -35,4 +36,5 @@
 from waeup.kofa.students.batching import StudentProcessor
 from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.browser.tests.test_pdf import samples_dir
 from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
 from kofacustom.nigeria.testing import FunctionalLayer
@@ -417,2 +419,36 @@
             '...2016-01-16 15:50:48 WAT - Financial clearance withdrawn by Carlo Pitter...',
             self.browser.contents)
+
+    def test_bursary_pdf_slip(self):
+        payment1 = createObject(u'waeup.StudentOnlinePayment')
+        timestamp = ("%d" % int(time()*10000))[1:]
+        payment1.p_id = "p%s" % timestamp
+        payment1.p_category = 'schoolfee'
+        payment1.p_item = u'My School Fee'
+        payment1.p_session = 2015
+        payment1.p_level = 100
+        payment1.p_current = True
+        payment1.amount_auth = 23456.9
+        payment1.approve()
+        payment2 = createObject(u'waeup.StudentOnlinePayment')
+        timestamp = ("%d" % int(time()*10000))[1:]
+        payment2.p_id = "p%s" % timestamp
+        payment2.p_category = 'clearance'
+        payment2.p_item = u'My Clearance Fee'
+        payment2.p_session = 2015
+        payment2.p_level = 100
+        payment2.p_current = True
+        payment2.amount_auth = 5678.6
+        payment2.approve()
+        self.student['payments'][payment1.p_id] = payment1
+        self.student['payments'][payment2.p_id] = payment2
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.student_path + '/clear_financially')
+        self.browser.getLink("Download bursary clearance 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(), 'bursary_clearance_slip.pdf')
+        open(path, 'wb').write(self.browser.contents)
+        print "Sample PDF bursary_clearance_slip.pdf written to %s" % path
+        return
Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py	(revision 13622)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py	(revision 13623)
@@ -70,4 +70,12 @@
         return self.view.url(self.view.context, self.target)
 
+class BursaryClearanceSlipActionButton(ManageActionButton):
+    grok.order(12)
+    grok.context(INigeriaStudent)
+    grok.view(NigeriaStudentBaseDisplayFormPage)
+    grok.require('waeup.viewStudent')
+    text = _('Download bursary clearance slip')
+    target = 'bursary_clearance_slip.pdf'
+    icon = 'actionicon_pdf.png'
 
 # Acceptance Letter
