Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6875)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 6876)
@@ -43,4 +43,5 @@
 from waeup.sirp.students.studylevel import StudentStudyLevel, CourseTicket
 from waeup.sirp.students.vocabularies import StudyLevelSource
+from waeup.sirp.students.utils import getPaymentDetails
 from waeup.sirp.browser.resources import toggleall
 from waeup.sirp.payments.interfaces import IOnlinePayment
@@ -865,9 +866,19 @@
     @grok.action('Create ticket')
     def createTicket(self, **data):
-        payment = createObject(u'waeup.OnlinePayment')
+        payment = createObject(u'waeup.StudentOnlinePayment')
         self.applyData(payment, **data)
         timestamp = "%d" % int(time()*1000)
         #order_id = "%s%s" % (student_id[1:],timestamp)
         payment.p_id = "p%s" % timestamp
+        (payment.amount_auth,
+            payment.p_item,
+            payment.surcharge_1,
+            payment.surcharge_2,
+            payment.surcharge_3)  = getPaymentDetails(
+            data['p_category'],self.context.__parent__)
+        if payment.amount_auth == 0:
+            self.flash('Payment amount could not be determined.')
+            self.redirect(self.url(self.context, u'@@manage'))
+            return
         self.context[payment.p_id] = payment
         self.flash('Payment ticket created.')
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6875)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6876)
@@ -620,2 +620,9 @@
         self.assertEqual(self.student.state, 'courses registered')
         return
+
+    def test_manage_access(self):
+        # Managers can add online payment tickets
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_student_path)
+        self.browser.getLink("Manage").click()
+        self.browser.getControl("Add online payment ticket").click()
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 6875)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py	(revision 6876)
@@ -3,4 +3,5 @@
 
 from random import SystemRandom as r
+from waeup.sirp.students.vocabularies import academic_sessions_vocab
 
 def generate_student_id(students,letter):
@@ -19,2 +20,61 @@
     student['studycourse'].previous_verdict = verdict
     return
+
+def getPaymentDetails(category, student):
+    #import pdb; pdb.set_trace()
+    session_string = academic_sessions_vocab.by_value[
+        student['studycourse'].current_session].title
+    surcharge_1 = surcharge_2 = surcharge_3 = 0
+    if category == 'transfer':
+        amount = 500
+        item = u'Session %s' % session_string
+    elif category == 'gown':
+        amount = 500
+        item = u'Session %s' % session_string
+    elif category == 'hostel_maintenance':
+        amount = 300
+        item = u'Session %s' % session_string
+    elif category == 'schoolfee':
+        surcharge_1 = 1500 # BT amount
+        surcharge_2 = 300 # Interswitch amount
+        amount = getSchoolFee(student, surcharge_1 + surcharge_2)
+        item = u'Session %s' % session_string
+    return amount, item, surcharge_1, surcharge_2, surcharge_3
+
+# To be moved to the FUTMinna customization package
+def getSchoolFee(student, surcharge):
+    study_mode = student['studycourse'].certificate.study_mode
+    entry_mode = student.entry_mode
+    state = student.state
+    #lga = student.lga
+    lga = 'nothing'
+    current_level = student['studycourse'].current_level
+    CLEARED = 'cleared'
+
+    if study_mode.endswith('_ft'):
+        # fresh remedial
+        if current_level == 0 and state == CLEARED:
+            if entry_mode == 'rmd_ft':
+                return 80200 - surcharge
+            else:
+                return 74200 - surcharge
+        # fresh
+        elif state == CLEARED:
+            if study_mode == 'jm_ft':
+                return 72700 - surcharge
+            elif lga == 'foreigner':
+                return 131500 - surcharge
+            else:
+                return 41500 - surcharge
+        # returning
+        elif state == 'returning':
+            if study_mode == 'jm_ft':
+                return 32500 - surcharge
+            elif lga == 'foreigner':
+                return 109500 - surcharge
+            else:
+                return 19500 - surcharge
+        else:
+            return 0
+    else:
+        return 0
