Index: main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 8988)
+++ main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py	(revision 9006)
@@ -33,4 +33,7 @@
     INigeriaUGApplicant, INigeriaPGApplicant,
     INigeriaApplicantOnlinePayment,
+    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
+    INigeriaApplicantUpdateByRegNo,
+    IPUTMEApplicantEdit,
     UG_OMIT_DISPLAY_FIELDS,
     UG_OMIT_PDF_FIELDS,
Index: main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 8988)
+++ main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py	(revision 9006)
@@ -49,4 +49,5 @@
         self.browser.open(self.payments_path)
         IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
Index: main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 8988)
+++ main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 9006)
@@ -86,4 +86,5 @@
                            self.browser.contents)
         IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl("Create ticket").click()
@@ -190,4 +191,27 @@
         return
 
+    def test_set_returning_data(self):
+        # Student is in level 100, session 2004 with verdict A
+        utils = getUtility(IStudentsUtils)
+
+        utils.setReturningData(self.student)
+        self.assertEqual(self.student['studycourse'].current_session, 2005)
+        self.assertEqual(self.student['studycourse'].current_level, 200)
+
+        self.student['studycourse'].current_session = 2004
+        self.student['studycourse'].current_level = 100
+        self.student['studycourse'].current_verdict = 'C'
+        utils.setReturningData(self.student)
+        self.assertEqual(self.student['studycourse'].current_session, 2005)
+        self.assertEqual(self.student['studycourse'].current_level, 110)
+
+        self.student['studycourse'].current_session = 2004
+        self.student['studycourse'].current_level = 100
+        self.student['studycourse'].current_verdict = 'D'
+        utils.setReturningData(self.student)
+        self.assertEqual(self.student['studycourse'].current_session, 2005)
+        self.assertEqual(self.student['studycourse'].current_level, 100)
+        return
+
     def test_set_payment_details(self):
         self.app['configuration']['2004'].gown_fee = 150.0
@@ -206,4 +230,5 @@
 
         IWorkflowState(self.student).setState('cleared')
+        self.student.nationality = u'NG'
         error, payment = utils.setPaymentDetails('schoolfee',self.student)
         self.assertEqual(payment.p_level, 100)
@@ -229,4 +254,34 @@
         self.assertEqual(error, None)
 
+        self.student.is_staff = True
+        error, payment = utils.setPaymentDetails('schoolfee',self.student)
+        self.assertEqual(payment.p_level, 200)
+        self.assertEqual(payment.p_session, 2005)
+        self.assertEqual(payment.amount_auth, 10088.0)
+        self.assertEqual(payment.p_item, u'CERT1')
+        self.assertEqual(error, None)
+
+        IWorkflowState(self.student).setState('cleared')
+        self.student.is_staff = False
+        self.student.nationality = u'DE'
+        self.certificate.school_fee_3 = 60000.0
+        error, payment = utils.setPaymentDetails('schoolfee',self.student)
+        self.assertEqual(payment.p_level, 100)
+        self.assertEqual(payment.p_session, 2004)
+        self.assertEqual(payment.amount_auth, 60099.0)
+        self.assertEqual(payment.p_item, u'CERT1')
+        self.assertEqual(error, None)
+
+        IWorkflowState(self.student).setState('returning')
+        self.student.is_staff = False
+        self.student.nationality = u'DE'
+        self.certificate.school_fee_4 = 20000.0
+        error, payment = utils.setPaymentDetails('schoolfee',self.student)
+        self.assertEqual(payment.p_level, 200)
+        self.assertEqual(payment.p_session, 2005)
+        self.assertEqual(payment.amount_auth, 20088.0)
+        self.assertEqual(payment.p_item, u'CERT1')
+        self.assertEqual(error, None)
+
         error, payment = utils.setPaymentDetails('clearance',self.student)
         self.assertEqual(payment.p_level, 100)
Index: main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 8988)
+++ main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 9006)
@@ -90,5 +90,8 @@
                 return _('Study course data are incomplete.'), None
             if student.state == CLEARED:
-                amount = getattr(certificate, 'school_fee_1', 0.0)
+                if student.is_foreigner:
+                    amount = getattr(certificate, 'school_fee_3', 0.0)
+                else:
+                    amount = getattr(certificate, 'school_fee_1', 0.0)
             elif student.state == RETURNING:
                 # In case of returning school fee payment the payment session
@@ -96,5 +99,8 @@
                 # has paid for.
                 p_session, p_level = self.getReturningData(student)
-                amount = getattr(certificate, 'school_fee_2', 0.0)
+                if student.is_foreigner:
+                    amount = getattr(certificate, 'school_fee_4', 0.0)
+                else:
+                    amount = getattr(certificate, 'school_fee_2', 0.0)
                 try:
                     academic_session = grok.getSite()[
@@ -106,5 +112,8 @@
                 # but their level always remains the same.
                 p_session += 1
-                amount = getattr(certificate, 'school_fee_2', 0.0)
+                if student.is_foreigner:
+                    amount = getattr(certificate, 'school_fee_4', 0.0)
+                else:
+                    amount = getattr(certificate, 'school_fee_2', 0.0)
                 try:
                     academic_session = grok.getSite()[
@@ -112,4 +121,7 @@
                 except KeyError:
                     return _(u'Session configuration object is not available.'), None
+            # Give 50% school fee discount to staff members.
+            if student.is_staff:
+                amount /= 2
         if amount in (0.0, None):
             return _(u'Amount could not be determined.'), None
