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 8960)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 8961)
@@ -177,7 +177,16 @@
         self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
         self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-
+        self.assertMatches('...Session configuration object is not...',
+                           self.browser.contents)
+        # Uups, we forgot to add a session configuration for next session
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2005
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.app['configuration']['2005'].school_fee_base = 7777.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
         # If the session configuration doesn't exist an error message will
         # be shown. No other requirement is being checked.
@@ -208,4 +217,9 @@
         utils = getUtility(IStudentsUtils)
 
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2005
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.app['configuration']['2005'].school_fee_base = 7777.0
+
         error, payment = utils.setPaymentDetails('schoolfee_1',self.student)
         self.assertEqual(payment, None)
@@ -220,14 +234,16 @@
         self.assertEqual(error, None)
 
-        # Add penalty fee.
+        # Add penalty fee ...
+        # ... for cleared
         self.app['configuration']['2004'].penalty_ug = 99.0
+        # ... for returning
+        self.app['configuration']['2005'].penalty_ug = 88.0
         error, payment = utils.setPaymentDetails('schoolfee_1',self.student)
         self.assertEqual(payment.amount_auth, 6765.0)
-
         IWorkflowState(self.student).setState('returning')
         error, payment = utils.setPaymentDetails('schoolfee_1',self.student)
         self.assertEqual(payment.p_level, 200)
         self.assertEqual(payment.p_session, 2005)
-        self.assertEqual(payment.amount_auth, 6765.0)
+        self.assertEqual(payment.amount_auth, 7865.0)
         self.assertEqual(payment.p_item, u'CERT1')
         self.assertEqual(error, None)
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 8960)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 8961)
@@ -88,6 +88,12 @@
                 payment_allowed = True
                 amount = academic_session.school_fee_base
-            elif student.state == RETURNING:
-                p_session, p_level = self.getReturningData(student)
+            elif student.state == RETURNING or\
+                (student.is_postgrad and student.state == PAID):
+                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
                 initial_instalment_made = False
                 for key in student['payments'].keys():
@@ -103,4 +109,9 @@
                 if not initial_instalment_made:
                     payment_allowed = True
+                try:
+                    academic_session = grok.getSite()[
+                        'configuration'][str(p_session)]
+                except KeyError:
+                    return _(u'Session configuration object is not available.'), None
                 amount = academic_session.school_fee_base
             else:
