Index: main/waeup.custom/trunk/src/waeup/custom/students/tests.py
===================================================================
--- main/waeup.custom/trunk/src/waeup/custom/students/tests.py	(revision 6950)
+++ main/waeup.custom/trunk/src/waeup/custom/students/tests.py	(revision 7021)
@@ -9,19 +9,12 @@
 
     def test_manage_payments(self):
+        # Add missing configuration data
+        self.app['configuration']['2004'].gown_fee = 150
+        self.app['configuration']['2004'].transfer_fee = 90
+        self.app['configuration']['2004'].clearance_fee = 120
+        self.app['configuration']['2004'].maint_fee = 180
 
         # Managers can add online payment tickets
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.payments_student_path)
-        self.browser.getControl("Add online payment ticket").click()
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Session configuration object is not available...',
-                           self.browser.contents)
-
-        # Set up SessionConfiguration object
-        configuration = SessionConfiguration()
-        configuration.academic_session = 2004
-        configuration.fee_1 = 20000
-        self.app['configuration'].addSessionConfiguration(configuration)
-
         self.browser.open(self.payments_student_path)
         self.browser.getControl("Add online payment ticket").click()
@@ -43,5 +36,6 @@
                            self.browser.contents)
         self.browser.open(self.manage_student_path)
-        self.browser.getControl(name="transition").value = ['pay_first_school_fee']
+        self.browser.getControl(
+            name="transition").value = ['pay_first_school_fee']
         self.browser.getControl("Save").click()
         self.browser.getControl(name="transition").value = ['reset6']
@@ -58,5 +52,10 @@
         self.browser.getControl("Create ticket").click()
         self.browser.open(self.payments_student_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
+        self.browser.getControl(
+            name="form.p_category").value = ['bed_allocation']
+        self.browser.getControl("Create ticket").click()
+        self.browser.open(self.payments_student_path + '/addop')
+        self.browser.getControl(
+            name="form.p_category").value = ['hostel_maintenance']
         self.browser.getControl("Create ticket").click()
         self.browser.open(self.payments_student_path + '/addop')
@@ -70,3 +69,12 @@
                            self.browser.contents)
 
+        # If the session configuration doesn't exist and error message will
+        # be shown
+        del self.app['configuration']['2004']
+        self.browser.open(self.payments_student_path)
+        self.browser.getControl("Add online payment ticket").click()
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...Session configuration object is not...',
+                           self.browser.contents)
 
+
Index: main/waeup.custom/trunk/src/waeup/custom/students/utils.py
===================================================================
--- main/waeup.custom/trunk/src/waeup/custom/students/utils.py	(revision 6950)
+++ main/waeup.custom/trunk/src/waeup/custom/students/utils.py	(revision 7021)
@@ -4,42 +4,42 @@
 
 def getPaymentDetails(category, student):
-
-    surcharge_1 = surcharge_2 = surcharge_3 = 0
-    p_item = u''
-    amount = 0
-    error = u''
-    p_session = student['studycourse'].current_session
-    session = str(p_session)
+    d = {}
+    d['surcharge_1'] = d['surcharge_2'] = d['surcharge_3'] = 0
+    d['p_item'] = u''
+    d['amount'] = 0
+    d['error'] = u''
+    d['p_session'] = student['studycourse'].current_session
+    session = str(d['p_session'])
     try:
         academic_session = getSite()['configuration'][session]
     except KeyError:
-        error = u'Session configuration object is not available.'
-        return (amount, p_item, p_session,
-            surcharge_1, surcharge_2, surcharge_3, error)
+        d['error'] = u'Session configuration object is not available.'
+        return d
     if category == 'transfer':
-        amount = academic_session.transfer
+        d['amount'] = academic_session.transfer_fee
     elif category == 'gown':
-        amount = academic_session.gown
+        d['amount'] = academic_session.gown_fee
+    elif category == 'bed_allocation':
+        d['amount'] = academic_session.booking_fee
     elif category == 'hostel_maintenance':
-        amount = academic_session.hostelmaintenance
+        d['amount'] = academic_session.maint_fee
     elif category == 'clearance':
-        p_item = student['studycourse'].certificate.code
-        amount = academic_session.clearance
+        d['p_item'] = student['studycourse'].certificate.code
+        d['amount'] = academic_session.clearance_fee
     elif category == 'schoolfee':
-        surcharge_1 = academic_session.surcharge_1
-        surcharge_2 = academic_session.surcharge_2
-        amount = getSchoolFee(student, surcharge_1 + surcharge_2)
+        d['surcharge_1'] = academic_session.surcharge_1
+        d['surcharge_2'] = academic_session.surcharge_2
+        d['amount'] = getSchoolFee(student, d['surcharge_1'] + d['surcharge_2'])
         code = student['studycourse'].certificate.code
         #session_string = academic_sessions_vocab.by_value[p_session + 1].title
-        p_item = code
-        p_session += 1
-    if amount ==0:
-        error = u'Amount could not be determined.'
-    return (amount, p_item, p_session,
-        surcharge_1, surcharge_2, surcharge_3, error)
+        d['p_item'] = code
+        d['p_session'] += 1
+    if d['amount'] == 0:
+        d['error'] = u'Amount could not be determined.'
+    return d
 
 def getSchoolFee(student, surcharge):
     study_mode = student['studycourse'].certificate.study_mode
-    entry_mode = student.entry_mode
+    entry_mode = student['studycourse'].entry_mode
     state = student.state
     #lga = student.lga
