Index: /WAeUP_SRP/trunk/WAeUPImport.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3840)
+++ /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3841)
@@ -910,4 +910,5 @@
                 line.append(format % d)
                 open(export_file,"a").write('\n'.join(line) +'\n')
+                self.course_results.getExportRemoveAllCourses(student_id = student_id, export = True, remove = True)
                 # end export
                 students_folder.manage_delObjects((student_id),)         
Index: /WAeUP_SRP/trunk/WAeUPTables.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTables.py	(revision 3840)
+++ /WAeUP_SRP/trunk/WAeUPTables.py	(revision 3841)
@@ -1667,4 +1667,34 @@
         return courses
     ###)
+    
+    def getExportRemoveAllCourses(self,student_id,export=False,remove=False): ###(
+        ""
+        query = Eq('student_id',student_id)
+        cr_catalog = self.course_results
+        course_results = cr_catalog.evalAdvancedQuery(query)
+        courses = []
+        fields = self.schema()
+        format = '"%(' + ')s","%('.join(fields) + ')s"'
+        for brain in course_results:
+            d = {}
+            for field in fields:
+                d[field] = getattr(brain,field,'')
+            courses.append(format % d)
+                
+        if export:
+            export_file = "%s/export/course_results_removed.csv" % (i_home)
+            file_handler = open(export_file,"a")
+            headline = ','.join(fields)
+            file_handler.write(headline +'\n')
+            for line in courses: 
+                file_handler.write(line +'\n')
+
+        if remove:
+            for brain in course_results:
+                key = getattr(brain,'key','')
+                cr_catalog.deleteRecord(key)
+        
+        return courses
+    ###)    
 
 InitializeClass(CourseResults)
Index: /WAeUP_SRP/trunk/skins/waeup_aaue/getPaymentsFolderInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_aaue/getPaymentsFolderInfo.py	(revision 3841)
+++ /WAeUP_SRP/trunk/skins/waeup_aaue/getPaymentsFolderInfo.py	(revision 3841)
@@ -0,0 +1,131 @@
+## Script (Python) "getPaymentsFolderInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: getPaymentsFolderInfo.py 2480 2007-10-30 15:23:25Z joachim $
+"""
+Info for the PaymentsFolder
+"""
+from Products.AdvancedQuery import Eq, Between, Le,In
+
+mtool = context.portal_membership
+wftool = context.portal_workflow
+member = mtool.getAuthenticatedMember()
+payments_catalog = context.payments_catalog
+aq_payments = payments_catalog.evalAdvancedQuery
+if mtool.isAnonymousUser():
+    return None
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+def cmp_id(a,b):
+    s1 = "%(id)s" % a
+    s2 = "%(id)s" % b
+    if s1 == s2:
+        return 0
+    if s1 > s2:
+        return 1
+    return -1
+
+import DateTime
+request = context.REQUEST
+#students = context.portal_url.getPortalObject().campus.students
+student_id = context.getStudentId()
+if student_id is None:
+    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+#student = getattr(students,student_id)
+student_record = context.students_catalog.getRecordByKey(student_id)
+
+
+info = {}
+is_so = info['is_so'] = context.isSectionOfficer()
+is_student = info['is_student'] = context.isStudent()
+info['student_name'] = student_record.name
+info['query_url'] = "https://webpay.interswitchng.com/test_paydirect/services/TransactionQueryURL.aspx"
+review_state = info['review_state'] = student_record.review_state
+parttime = student_record.mode and student_record.mode.endswith('_pt')
+fulltime = student_record.mode and student_record.mode.endswith('_ft')
+
+
+session = student_record.session
+next_info = context.getNextInfo(student_record)
+info['next_session'] = next_info['next_session_id']
+info['next_session_str'] = next_info['next_session_str']
+info['payment_method'] = ""
+info['reasons'] = next_info['reasons']
+
+# begin customization
+
+if review_state == 'cleared_and_validated':
+    info['payment_method'] = "online_payment"
+#elif review_state == 'cleared_and_validated' and session == '07':
+#    info['payment_method'] = "sc_payment"
+elif review_state == 'returning' and info['next_session'] != session:
+    info['payment_method'] = "online_payment"
+info['prod_id'] = '119'
+
+# end customization
+
+info['student_name'] = student_record.name
+payments_path = "%s/campus/students/%s/payments" % (context.portal_url(),student_id)
+payments = []
+payment_records = aq_payments(Eq('student_id',student_id)) # & Eq('session_id',student_record.session))
+vocabularies = context.portal_vocabularies
+paid_fees = []
+for payment in payment_records:
+    if payment.status == "paid":
+        paid_fees += "%s_%s" % (payment.category,payment.session_id),
+#info['pf'] = paid_fees
+for payment in payment_records:
+    row = {}
+    row['id'] = payment.key
+    if payment.status == 'invalid':
+        row['title'] = "Invalid Payment, Naira %s, %s" % (payment.amount,
+                                                          payment.date.strftime("%d/%m/%y %H:%M:%S"))
+    else:
+        row['title'] = "%s for Session %s, Naira %s, %s" % (vocabularies.payment_categories.get(payment.category),
+                                                            vocabularies.sessions.get(payment.session_id),
+                                                            payment.amount,
+                                                            payment.date.strftime("%d/%m/%y %H:%M:%S"))
+    oid = payment.order_id
+    onr = oid.rfind('-')+1
+    if onr > 0:
+        start_pos = onr
+    else:
+        start_pos = 6
+    url = row['url'] = "%s/p%s" % (payments_path,oid[start_pos:])
+    row['is_requeryable'] = "%s_%s" % (payment.category,payment.session_id) not in paid_fees and not payment.resp_desc and payment.type == 'online' or str(member) in ('admin',)  # customized too
+    row['is_approvable'] = is_so and row['is_requeryable'] and payment.category == 'schoolfee' # does not make sense for maintenance
+    row['resp_desc'] = payment.resp_desc or 'Payment Process Interrupted'
+    row['trans_ref'] = payment.order_id
+    if row['is_requeryable']:
+        row['callback_url'] = "%(url)s/interswitch_cb" % row
+#        if payment.category == 'schoolfee':
+#            row['callback_url'] = "%(url)s/interswitch_cb" % row
+#        elif payment.category == 'hostel_maintenance':
+#            row['callback_url'] = "%(url)s/interswitch_acco_cb" % row
+#        else:
+        href = '%(query_url)s' % info
+        href += '?transRef=%(trans_ref)s' % row
+        href += '&prodID=%(prod_id)s' % info
+        href += '&redirectURL=%(callback_url)s' % row
+        row['href'] = href
+    if payment.status == 'paid':
+        row['confirmed'] = 'active'
+    else:
+        row['confirmed'] = 'unsuccessful'
+    row['is_editable'] = is_so and (row['confirmed'] == 'active')
+    payments.append(row)
+
+payments.sort(cmp_id)
+info['payments'] = payments
+return info
+
Index: /WAeUP_SRP/trunk/skins/waeup_aaue/getSchoolFee.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_aaue/getSchoolFee.py	(revision 3841)
+++ /WAeUP_SRP/trunk/skins/waeup_aaue/getSchoolFee.py	(revision 3841)
@@ -0,0 +1,56 @@
+## Script (Python) "getSchoolFee"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=brain=None
+##title=
+##
+# $Id: getSchoolFee.py 2534 2007-11-05 06:37:12Z henrik $
+"""
+return SchoolFee
+"""
+
+
+d = {}
+
+if brain.mode == 'ug_sw':  
+    if str(brain.level) == '100':    # both 100 fresh and 100 returning who register for 200
+        d['all'] = 35000
+    else:
+        d['all'] = 30000
+elif brain.mode == 'pg_sw':  
+    d['all'] = 35000
+elif brain.mode == 'dp_pt':  
+    if str(brain.level) in ('100',) and brain.review_state == 'cleared_and_validated':    # only 100 fresh 
+        d['all'] = 40000
+    else:
+        d['all'] = 35000
+elif brain.mode == 'ug_pt':  
+    if str(brain.level) in ('100','200',) and brain.review_state == 'cleared_and_validated':    # only 100 or 200 fresh 
+        d['all'] = 50000
+    else:
+        d['all'] = 45000
+elif brain.mode == 'pg_pt':  
+    if str(brain.level) == '600' and brain.review_state == 'cleared_and_validated':    # only 600 fresh 
+        d['all'] = 60000
+    elif str(brain.level) == '700' and brain.review_state == 'cleared_and_validated':  # only 700 fresh                                             # going to register for 700
+        d['all'] = 75000      
+    elif str(brain.level) == '600' and brain.verdict == 'C':                           # 600 repeaters
+        d['all'] = 55000
+    elif str(brain.level) == '600':                                                    # going to register for 700
+        d['all'] = 75000        
+    else:
+        d['all'] = 65000
+else:
+    d['all'] = 0
+
+d['all'] = 0
+
+next_info = context.getNextInfo(brain)
+next_session_str = next_info['next_session_str']
+d['next_session_id'] = next_info['next_session_id']
+d['description'] = "School Fee for Session %s" % next_session_str
+
+return d
Index: /WAeUP_SRP/trunk/skins/waeup_aaue/interswitch_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_aaue/interswitch_form.pt	(revision 3841)
+++ /WAeUP_SRP/trunk/skins/waeup_aaue/interswitch_form.pt	(revision 3841)
@@ -0,0 +1,46 @@
+<metal:body use-macro="here/main_template/macros/master">
+  <metal:main fill-slot="main"
+              tal:define="info options/info">
+    <h3>Confirm Your Payment Data! </h3>
+    <br />
+    <span tal:condition="not: info/payment_possible">
+      No payment information for your course available.
+    </span>
+    <span tal:condition="info/payment_possible">
+      <form method="post" action="pay_interswitch">
+        <table>
+          <tr>
+            <td width="100px">
+            Payment:</td>
+            <td tal:content="info/type_description"></td>
+          </tr>
+          <tr>
+            <td>
+            Name:
+            </td>
+            <td tal:content="info/pay_bill_to" />
+          </tr>
+          <tr>
+            <td >
+            Amount:
+            </td>
+            <td> Naira <span tal:content="info/amount" /></td>
+          </tr>
+          <tr>
+            <td >
+            Surcharge:
+            </td>
+            <td> Naira <span tal:content="info/surcharge" /></td>
+          </tr>                  
+        </table>
+        <br />
+        <input type="submit" 
+               class="standalone" 
+               name="goto_bank" 
+               value="Confirm" 
+               />
+      </form>
+    </span>
+    </metal:main>
+</metal:body>
+
Index: /WAeUP_SRP/trunk/skins/waeup_aaue/pay_interswitch.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_aaue/pay_interswitch.py	(revision 3841)
+++ /WAeUP_SRP/trunk/skins/waeup_aaue/pay_interswitch.py	(revision 3841)
@@ -0,0 +1,167 @@
+## Script (Python) "pay_online"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: pay_interswitch.py 2619 2007-11-10 17:39:36Z henrik $
+"""
+pay online
+"""
+from urllib import urlencode
+import logging
+logger = logging.getLogger('Skins.pay_interswitch')
+import DateTime
+
+if context.portal_membership.isAnonymousUser():
+    return None
+
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+request = context.REQUEST
+wftool = context.portal_workflow
+students = context.portal_url.getPortalObject().campus.students
+
+
+student_id = context.getStudentId()
+student = getattr(students,student_id)
+
+student_record = context.students_catalog.getRecordByKey(student_id)
+#amount,description = context.getSchoolFee(student_record.faculty,student_record.session,student_record.course)
+info = {}
+info['student'] = student_record
+info['payment_possible'] = False
+info['amount'] = '0'
+info['bank'] = ''
+info['type_description'] = ''
+info['pay_bill_to'] = ''
+fee_dict = context.getSchoolFee(student_record)
+fulltime = student_record.mode.endswith('_ft')
+
+if not fee_dict:
+    return context.interswitch_form(info=info)
+
+info['site_id'] = '119'
+info['currency_id'] = '566'
+pay_item_id = "10900"
+
+#info['type_code'] = sbrain.course  #type_code is redundant and will be removed soon
+info['bank'] = ''
+info['payment_possible'] = True
+info['type_description'] = fee_dict['description']
+info['pay_bill_to'] = student_record.name
+info['student_id'] = student_id
+info['student_name'] = student_record.name
+info['type'] = 'online'
+info['status'] = 'started'
+info['session_id'] = fee_dict['next_session_id']
+info['item'] = student_record.course
+info['category'] = 'schoolfee'
+info['student_email'] = student_record.email
+now = DateTime.DateTime()
+info['date'] = now
+info['pay_ship_to'] = "Adekunle Ajasin University"
+timestamp = "%d" % int(now.timeTime()*1000)
+info['order_id'] = "%s%s" % (student_id[1:],timestamp)
+p_id = "p%s" % timestamp
+
+
+info['surcharge'] = interswitch_amount = '150'
+info['amount'] = amount = fee_dict['all']
+total_amount = 100*int(amount) + 100*int(interswitch_amount)
+
+
+if student_id is None:
+    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+
+if True:
+    info['action'] = "https://webpay.interswitchng.com/test_paydirect/webpay/pay.aspx"
+else:
+    #pass
+    #return None
+    info['action'] = "%s/payments/%s/simulate_callback" % (student.absolute_url(),p_id)
+
+
+if "payments" not in student.objectIds():
+    student.invokeFactory('PaymentsFolder','payments')
+    payments = getattr(student,'payments')
+    d = {}
+    d['Title'] = 'Payments'
+    payments.getContent().edit(mapping=d)
+    wftool.doActionFor(payments,'open')
+else:
+    payments = getattr(student,'payments')
+if request.has_key('epayment'):
+    return context.interswitch_form(info=info)
+
+
+payments.invokeFactory('Payment', p_id)
+payment = getattr(payments,p_id)
+wftool.doActionFor(payment,'open')
+d = {}
+d.update(info)
+payment.getContent().edit(mapping=d)
+
+
+info['callback_url'] = "%s/payments/%s/interswitch_cb?echo=%s" % (student.absolute_url(),
+                                                                  p_id,
+                                                                  p_id)
+
+logger.info('%(student_id)s initiated online school fee payment with order_id %(order_id)s and callback url %(callback_url)s' % info)
+payment_fields = (('product_id','site_id'),
+                  ('site_redirect_url','callback_url'),
+                  ('Currency','currency_id'),
+                  ('cust_id','student_id'),
+                  ('cust_id_desc','type_description'),
+                  ('cust_name','student_name'),
+                  ('txn_ref','order_id'),
+                  ('Amount','amount'),
+                  )
+args = {}
+for arg,field in payment_fields:
+    args[arg] = info[field]
+
+bt_amount = 4000
+
+aaue_amount = amount - bt_amount
+xmldict = {}
+xmldict['detail_ref'] = args['txn_ref']
+xmldict['department'] = student_record.department
+xmldict['faculty'] = student_record.faculty
+xmldict['aaue_amount'] = "%d" % int(100*aaue_amount)
+xmldict['bt_amount'] = "%d" % int(100*bt_amount)
+if student_record.mode.endswith('_pt'):
+    xmldict['aaue_acct'] = ""
+elif student_record.mode.endswith('_sw'):
+    xmldict['aaue_acct'] = ""
+else:
+    xmldict['aaue_acct'] = "0000000000000000"
+
+
+xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="AAUE" department="%(department)s" faculty="%(faculty)s">
+<item_detail item_id="1" item_name="AAUE" item_amt="%(aaue_amount)s" bank_id="89" acct_num="%(aaue_acct)s" />
+<item_detail item_id="2" item_name="BT" item_amt="%(bt_amount)s" bank_id="117" acct_num="6012015294" />
+</item_details>
+</payment_item_detail>""" % xmldict
+
+info['xml_data'] = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
+
+args['Amount'] = "%d" % (total_amount)
+args['site_name'] = "aaue.waeup.org"
+args['cust_name_desc'] = "Student Name"
+args['pay_item_id'] = pay_item_id
+args['pay_item_name'] = "AAUE Tuition Payments"
+args['payment_params'] = 'college_split'
+#args['xml_data'] = ''
+#args['xml_data'] = xmltext   # info['xml_data']can be used instead
+info['args'] = args
+
+return context.goto_interswitch_form(info=info)
+
Index: /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_slip.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_slip.pt	(revision 3840)
+++ /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_slip.pt	(revision 3841)
@@ -26,5 +26,5 @@
                     <tr tal:condition="python:info[sem[1]]">
                         <th />
-                        <th align='center'>ATL</th>  
+                        <th align='center'>Attitude To <br />Learning</th>  
                         <th align='center'>CA 1 <br />Marks</th>
                         <th align='center'>CA 2 <br />Marks</th>    
Index: /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt	(revision 3840)
+++ /WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt	(revision 3841)
@@ -85,5 +85,5 @@
         <th tal:attributes="colspan python: test(show_check_boxes,'2','1')" 
             tal:content="python:sem[1]" />
-        <th align='center'>ATL</th>    
+        <th align='center'>Attitude To Learning</th>    
         <th align='center'>CA 1 <br />Marks</th>
         <th align='center'>CA 2 <br />Marks</th>    
