Index: /WAeUP_SRP/trunk/skins/waeup_uniben/custom.css.dtml
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_uniben/custom.css.dtml	(revision 7900)
+++ /WAeUP_SRP/trunk/skins/waeup_uniben/custom.css.dtml	(revision 7900)
@@ -0,0 +1,103 @@
+<dtml-with stylesheet_properties>
+
+table.registration td {
+  white-space: nowrap;
+  background-color: transparent;
+  color: #333333;
+}
+
+table.registration td.active{
+  white-space: nowrap;
+  color: #33FF00;
+  font-weight: bold;
+}
+
+table.registration td a {
+  white-space: nowrap;
+  color: #333333;
+}
+
+table.registration td a:visited {
+  white-space: nowrap;
+  color: #333333;
+}
+
+table.registration td a:hover {
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+table.registration td.active a {
+  white-space: nowrap;  
+  color: #33FF00;
+}
+
+table.registration td.active a:visited {
+  white-space: nowrap;  
+  color: #33FF00;
+}
+
+table.registration td.active a:hover {
+  text-decoration: underline;
+  white-space: nowrap;  
+}
+
+table.registration td.stopped{
+  white-space: nowrap;
+  color: red;
+  font-weight: bold;
+}
+
+table.registration td.stopped a {
+  white-space: nowrap;  
+  color: red;
+}
+
+table.registration td.stopped a:visited {
+  white-space: nowrap;  
+  color: red;
+}
+
+table.registration td.stopped a:hover {
+  text-decoration: underline;
+  white-space: nowrap;  
+}
+
+table.registration td.unsuccessful{
+  white-space: nowrap;
+  color: #333333;
+  text-decoration:line-through; 
+  font-weight: bold;
+}
+
+table.registration td.unsuccessful a {
+  white-space: nowrap;  
+  color: #333333;
+  text-decoration:line-through; 
+}
+
+table.registration td.unsuccessful a:visited {
+  white-space: nowrap;  
+  color: #333333;
+  text-decoration:line-through; 
+}
+
+table.registration td.unsuccessful a:hover {
+  color: #333333;
+  text-decoration: underline; 
+  white-space: nowrap;  
+}
+
+<dtml-comment>
+For the Boolean Widget
+</dtml-comment>
+fieldset.widget {
+  border: none;
+  margin: 0;
+  padding: 0;
+  padding-bottom: 0.5em;
+}
+
+
+</dtml-with>
+            
Index: /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py	(revision 7900)
+++ /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentInfo.py	(revision 7900)
@@ -0,0 +1,48 @@
+## Script (Python) "getPaymentInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+return Info about the current Student
+"""
+import logging
+logger = logging.getLogger('Skins.getStudentBaseInfo')
+from DateTime import DateTime
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+info = context.waeup_tool.getAccessInfo(context)
+student_id = info['student_id']
+if student_id is None:
+    return None
+
+
+
+res = context.students_catalog(id = student_id)
+if len(res) != 1:
+    return None
+sbrain = res[0]
+info['id'] = student_id
+info['student'] = context.getFormattedStudentEntry(sbrain)
+payment = context.getContent()
+info['payment_doc'] = payment
+info['is_online_pmt'] = io = payment.resp_code in ('0','00','AP','IP',)
+info['is_request_pmt'] = ir = payment.resp_code in ('RP',)
+info['is_scratchcard_pmt'] = isc =  payment.resp_code == 'SC'
+info['is_interrupted'] = ii = payment.resp_code == ''
+info['unknown_code'] = not (io or isc or ii or ir)
+info['resp_code'] = payment.resp_code
+info['resp_desc'] = payment.resp_desc
+#info['entry_mode'] = sbrain.entry_mode
+
+
+return info
Index: /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py	(revision 7900)
+++ /WAeUP_SRP/trunk/skins/waeup_uniben/getPaymentsFolderInfo.py	(revision 7900)
@@ -0,0 +1,142 @@
+## Script (Python) "getPaymentsFolderInfo"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+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
+
+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/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
+
+# special handling of 06 DPA students (ticket 658)
+if review_state == 'cleared_and_validated' and session in ('06') and student_record.course == 'DPA':
+    info['payment_method'] = "sc_payment"
+# special handling of 06 payments for testing purposes     
+elif review_state == 'cleared_and_validated' and session in ('06'):
+    info['payment_method'] = "online_payment"
+elif review_state == 'returning' and info['next_session'] == '06':
+    info['payment_method'] = "both_payments"
+elif review_state == 'cleared_and_validated' and session not in ('07','08'):
+    info['payment_method'] = "both_payments"
+elif review_state == 'cleared_and_validated' and session in ('07','08'):
+    info['payment_method'] = "sc_payment"
+elif review_state == 'returning' and info['next_session'] != session:
+    info['payment_method'] = "sc_payment"
+
+
+
+info['prod_id'] = '61'
+
+gown_records = aq_payments(Eq('student_id',student_id)  & Eq('category','gown'))
+try:
+    level = int(student_record.level)
+    end_level = int(student_record.end_level)
+    if level >= end_level and not gown_records:
+        info['gown'] = True
+except:
+    pass
+
+# 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
+    row['sort_param'] = payment.date
+    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 payment.type == 'online' or str(member) in ('admin',)
+    row['is_approvable'] = is_so and row['is_requeryable'] and payment.category == 'schoolfee' # does not make sense for maitenance
+    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=lambda x,y: cmp(x['sort_param'],y['sort_param']))
+info['payments'] = payments
+return info
Index: /WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt	(revision 7900)
+++ /WAeUP_SRP/trunk/skins/waeup_uniben/payment_receipt.pt	(revision 7900)
@@ -0,0 +1,147 @@
+<metal:body use-macro="here/slip_template/macros/master">
+    <metal:main fill-slot="main"
+                tal:define="info context/getPaymentInfo;">
+      <span tal:condition="python: not info">
+        <span tal:content="here/illegal_view" />
+      </span>
+      
+      <span tal:condition="python: info">
+        <metal:block tal:condition="info/is_online_pmt">
+        <h3>Online Payment Receipt</h3>
+        <br />
+        <table tal:define="student info/student">
+        <tr>
+          <td width="220px">Name:</td> 
+          <td><span tal:content="student/name" /></td>
+        </tr>
+        <tr>
+          <td>Student Id:</td>
+          <td tal:content="student/id" />
+        </tr>        
+        <tr>
+          <td>Registration Number:</td>
+          <td tal:content="student/jamb_reg_no" />
+        </tr>           
+        <tr>
+          <td>Matriculation Number:</td>
+          <td tal:content="student/matric_no" />
+        </tr>           
+        <tr>
+          <td>Current Study Level:</td>
+          <td tal:content="python:context.portal_vocabularies.student_levels.get(student['level'])" />
+        </tr>
+        <tr>
+          <td>Certificate Id:</td>
+          <td tal:content="student/course" />
+        </tr>
+        <tr>
+          <td>Faculty:</td>
+          <td tal:content="student/faculty" />
+        </tr>        
+        <tr>
+          <td>Department:</td>
+          <td tal:content="student/department" />
+        </tr>        
+        </table>                 
+        <span tal:omit-tag=""
+              tal:content="structure python: info['payment_doc'].render(layout_mode='view')" 
+              />
+        </metal:block>
+        
+        
+        
+        
+        <metal:block tal:condition="info/is_scratchcard_pmt">            
+        <h3>Scratch Card Payment Receipt</h3>
+        <br />
+        <table tal:define="student info/student;
+                           pm nocall: info/payment_doc">
+        
+        <tr>
+          <td width="220px">Name:</td> 
+          <td><span tal:content="student/name" /></td>
+        </tr>
+        <tr>
+          <td>Student Id:</td>
+          <td tal:content="student/id" />
+        </tr>        
+        <tr>
+          <td>Registration Number:</td>
+          <td tal:content="student/jamb_reg_no" />
+        </tr> 
+        <tr>
+          <td>Matriculation Number:</td>
+          <td tal:content="student/matric_no" />
+        </tr>                   
+        <tr>
+          <td>Certificate Id:</td>
+          <td tal:content="student/course" />
+        </tr>
+        <tr>
+          <td>Faculty:</td>
+          <td tal:content="student/faculty" />
+        </tr>        
+        <tr>
+          <td>Department:</td>
+          <td tal:content="student/department" />
+        </tr>             
+
+
+        <tr>
+          <td width="220px">Payment Status:</td> 
+          <td><span tal:content="python:context.portal_vocabularies.payment_status.get(pm.status)" /></td>
+        </tr>   
+        <tr>
+          <td width="220px">Access Code:</td> 
+          <td><span tal:content="pm/order_id" /></td>
+        </tr>     
+        <tr>
+          <td width="220px">Payment Type:</td> 
+          
+          <td><span tal:content="python:context.portal_vocabularies.payment_types.get(pm.type)" /></td>
+        </tr>   
+        <tr>
+          <td width="220px">Payment Category:</td> 
+          <td><span tal:content="python:context.portal_vocabularies.payment_categories.get(pm.category)" /></td>
+        </tr>   
+        <tr>
+          <td width="220px">Payment Item:</td> 
+          <td><span tal:content="pm/item" /></td>
+        </tr>       
+        <tr>
+          <td width="220px">Session:</td> 
+          <td><span tal:content="python:context.portal_vocabularies.sessions.get(pm.session_id)" /></td>
+        </tr>                   
+     
+        <tr>        
+          <td width="220px">Transaction Date:</td> 
+          <td><span tal:content='python:pm.date.strftime("%d/%m/%y %H:%M:%S")' /></td>
+        </tr>       
+        <tr>
+          <td width="220px">Amount (Naira):</td> 
+          <td><span tal:content="pm/amount" /></td>
+        </tr>   
+        <tr>
+          <td width="220px">Response Code:</td> 
+          <td><span tal:content="pm/resp_code" /></td>
+        </tr>         
+        <tr>
+          <td width="220px">Response Description:</td> 
+          <td><span tal:content="pm/resp_desc" /></td>
+        </tr>              
+        </table>
+        </metal:block>
+
+        <metal:block tal:condition="info/is_interrupted">            
+        <h3>Payment Process Interrupted!</h3>
+        <br />        
+        </metal:block>
+        
+        <metal:block tal:condition="info/unknown_code">
+        <h3>Response from Bank: "<span tal:content="info/resp_desc" />"</h3>
+        <br />        
+        </metal:block>
+
+      </span>
+    </metal:main>
+</metal:body>
Index: /WAeUP_SRP/trunk/skins/waeup_uniben/payments_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_uniben/payments_view.pt	(revision 7900)
+++ /WAeUP_SRP/trunk/skins/waeup_uniben/payments_view.pt	(revision 7900)
@@ -0,0 +1,122 @@
+<metal:body use-macro="here/main_template/macros/master">
+  <metal:main fill-slot="main"
+              tal:define="info context/getPaymentsFolderInfo;">
+    <span tal:condition="not: info">
+      <span tal:content="here/illegal_view" />
+    </span>
+    <span tal:condition="info" tal:omit-tag="">
+      <span tal:define= " rows info/payments;
+      review_state info/review_state;
+      is_student info/is_student;
+      s_name info/student_name;"
+      >
+        <a href=""
+           tal:attributes="href string:${context/aq_parent/absolute_url}">
+          <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
+          Up one level
+        </a>
+        <h3> 
+          <span tal:condition="not:is_student" tal:omit-tag="">
+            <span tal:content="s_name" />:</span>
+          <span tal:condition="is_student" tal:omit-tag="">My</span> Payments
+        </h3>
+        <br />
+        <table class="registration" width="100%">
+          <tr>
+            <th>Description, Amount, Date</th>
+            <th>Response</th>
+            <th>Transaction Code</th>
+          </tr>
+          <tr tal:repeat="row rows"
+              tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
+            <td style="white-space:normal" tal:attributes="class string:${row/confirmed}">
+              <a style="white-space:normal"  target="slip" href="" 
+                 tal:attributes="href string:${row/url}/payment_receipt"
+                 onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+                <strong tal:content="row/title" /></a> 
+            </td>
+            <td style="white-space:normal" tal:content="row/resp_desc" />
+            <td tal:content="row/trans_ref" />
+            <td>
+              <a tal:condition="row/is_approvable"
+                 tal:attributes="href string:${row/url}/approve_epayment;
+                 onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );"
+                 >
+                [approve]
+              </a>             
+            </td>
+            <td>
+              <a tal:condition="row/is_requeryable"
+                 tal:attributes="href row/href;
+                 onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure?'), );"
+                 >
+                [requery]
+              </a>             
+            </td>
+            <td>
+              <a tal:condition="row/is_editable"
+                href="edit" tal:attributes="href string:${row/url}/external_edit_form"
+                target="edit"
+                onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')"
+                >
+                [edit]
+              </a>             
+            </td>            
+          </tr>
+        </table>
+        <br />
+        <div>
+          <form tal:condition="python: info.get('payment_method') in ('online_payment','both_payments')" 
+                tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
+            <input type="submit" name="epayment" 
+                   class="context" 
+                   value="Pay"
+                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Cash Card"
+                   />
+          </form>  
+          <form tal:condition="python: info.get('payment_method') in ('first_instalment',)" 
+                tal:attributes="action string: ${context/absolute_url}/pay_interswitch" method="post" class="group">
+            <input type="submit" name="epayment" 
+                   class="context" 
+                   value="Pay"
+                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Cash Card (First Instalment)"
+                   />
+          </form>  
+          <form tal:condition="python: info.get('payment_method') in ('second_instalment',)" 
+                tal:attributes="action string: ${context/absolute_url}/pay_interswitch2" method="post" class="group">
+            <input type="submit" name="epayment" 
+                   class="context" 
+                   value="Pay"
+                   tal:attributes="value string:Initiate School Fee Payment by Cash Card (Second Instalment)"
+                   />
+          </form>                       
+          <form tal:condition="python: info.get('payment_method') in ('sc_payment','both_payments')" 
+                tal:attributes="action string: ${context/absolute_url}/pay_by_sc" method="post" class="group">
+            <input type="hidden" name="paid_session" 
+                   tal:attributes="value info/next_session"
+                   />
+            <input type="submit" name="epayment" 
+                   class="context" 
+                   value="Pay"
+                   tal:attributes="value string:Initiate ${info/next_session_str} School Fee Payment by Scratch Card"
+                   />
+          </form>    
+          
+          <form tal:condition="info/gown|nothing" 
+                tal:attributes="action string: ${context/absolute_url}/request_gown" method="post" class="group">
+            <input type="submit" name="epayment" 
+                   class="context" 
+                   value="Initiate Gown Hiring" 
+                   />
+          </form>            
+          
+                
+          <div tal:condition="info/reasons">
+            <font color="red" tal:content="info/reasons"></font>
+            <br /><br />
+          </div>
+        </div>        
+      </span>
+    </span>
+  </metal:main>
+</metal:body>
