Index: main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 13368)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 13374)
@@ -124,5 +124,4 @@
         self.assertMatches('...Amount could not be determined...',
                            self.browser.contents)
-        self.app['configuration']['2004'].school_fee_1 = 6666.0
         #self.browser.getControl(name="form.p_category").value = ['schoolfee']
         # Accepotance fee must be paid first
@@ -136,4 +135,6 @@
         cpt_value = ctrl.options[0]
         # School fee payment ticket can be added ...
+        self.student['studycourse'].certificate.school_fee_1 = 6666.0
+        self.student.nationality = u'NG'
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['schoolfee']
@@ -235,5 +236,6 @@
 
     def test_manage_payments_bypass_ac_creation(self):
-        self.app['configuration']['2004'].school_fee_1 = 6666.0
+        self.student['studycourse'].certificate.school_fee_1 = 6666.0
+        self.student.nationality = u'NG'
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.browser.open(self.payments_path)
Index: main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py	(revision 13368)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py	(revision 13374)
@@ -52,5 +52,7 @@
         self.app['configuration']['2004'].clearance_fee = 1234.0
         self.app['configuration']['2004'].clearance_fee_fp = 3456.0
-        self.app['configuration']['2004'].school_fee_1 = 6666.0
+        self.student['studycourse'].certificate.school_fee_1 = 6666.0
+        self.student['studycourse'].certificate.school_fee_2 = 7777.0
+        self.student.nationality = u'NG'
         utils = getUtility(IStudentsUtils)
 
@@ -58,5 +60,4 @@
         configuration.academic_session = 2005
         self.app['configuration'].addSessionConfiguration(configuration)
-        self.app['configuration']['2005'].school_fee_2 = 7777.0
 
         error, payment = utils.setPaymentDetails('schoolfee',self.student)
Index: main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
===================================================================
--- main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 13368)
+++ main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 13374)
@@ -121,4 +121,16 @@
         elif category == 'hostel_maintenance':
             amount = academic_session.maint_fee
+        elif category == 'welfare':
+            amount = academic_session.welfare_fee
+        elif category == 'union':
+            amount = academic_session.union_fee
+        elif category == 'lapel':
+            amount = academic_session.lapel_fee
+        elif category == 'matric_gown':
+            amount = academic_session.matric_gown_fee
+        elif category == 'concessional':
+            amount = academic_session.concession_fee
+        elif category == 'medical':
+            amount = academic_session.medical_fee
         elif category == 'clearance':
             if student.faccode == 'FP':
@@ -136,19 +148,13 @@
                 return _('Study course data are incomplete.'), None
             if student.state == CLEARED:
-                if student.faccode == 'FP':
-                    amount = academic_session.school_fee_3
+                if student.is_foreigner:
+                    amount = getattr(certificate, 'school_fee_3', 0.0)
                 else:
-                    amount = academic_session.school_fee_1
-            elif student.state == RETURNING or\
-                (student.is_postgrad and student.state == PAID):
-                academic_session = self._getSessionConfiguration(p_session)
-                if academic_session == None:
-                    return _(u'Session configuration object is not available.'), None
-                if student.state == RETURNING:
-                    p_session, p_level = self.getReturningData(student)
-                else:
-                    # Returning postgraduate students also pay for the 
-                    # next session but their level always remains the same.
-                    p_session += 1
+                    amount = getattr(certificate, 'school_fee_1', 0.0)
+            elif student.state == RETURNING:
+                # In case of returning school fee payment the payment session
+                # and level contain the values of the session the student
+                # has paid for.
+                p_session, p_level = self.getReturningData(student)
                 try:
                     academic_session = grok.getSite()[
@@ -156,5 +162,8 @@
                 except KeyError:
                     return _(u'Session configuration object is not available.'), None
-                amount = academic_session.school_fee_2
+                if student.is_foreigner:
+                    amount = getattr(certificate, 'school_fee_4', 0.0)
+                else:
+                    amount = getattr(certificate, 'school_fee_2', 0.0)
             else:
                 return _('Wrong state.'), None
