Index: WAeUP_SRP/trunk/profiles/default/actions.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/actions.xml	(revision 1426)
+++ WAeUP_SRP/trunk/profiles/default/actions.xml	(revision 1427)
@@ -200,6 +200,6 @@
      url_expr="string:${portal_url}/register_courses" visible="False"/>
   <action title="Request Transfer" action_id="request_transfer" category="student"
-     condition_expr="python: here.isStudent() and here.getStudentWorkflowInfo()['cr']" url_expr="string:${portal_url}/request_transfer"
-     visible="True"/>     
+     condition_expr="python: here.isStudent() and here.getStudentWorkflowInfo()['tr']" url_expr="string:${portal_url}/request_transfer"
+     visible="True"/>
 
  </action-provider>
Index: WAeUP_SRP/trunk/skins/waeup_epayment/approve_epayment.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/approve_epayment.py	(revision 1427)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/approve_epayment.py	(revision 1427)
@@ -0,0 +1,46 @@
+## Script (Python) "epayment_cb"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: aprove_epayment.py 1425 2007-02-15 17:52:01Z joachim $
+"""
+payment callback
+"""
+import logging
+logger = logging.getLogger('EPayment.Approve')
+import DateTime
+if context.portal_membership.isAnonymousUser():
+    return None
+
+request = context.REQUEST
+students = context.portal_url.getPortalObject().campus.students
+wftool = context.portal_workflow
+mtool = context.portal_membership
+is_anon = mtool.isAnonymousUser()
+member = mtool.getAuthenticatedMember()
+student_id = context.getStudentId()
+is_so = context.isSectionOfficer()
+if student_id is None or not is_so:
+    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+
+student = getattr(students,student_id)
+
+pd = {}
+#from Products.zdb import set_trace;set_trace()
+doc = context.getContent()
+review_state = wftool.getInfoFor(context,'review_state',None)
+if review_state != "opened":
+    return "not opened %s" % review_state
+pd['resp_code'] = 'AP'
+pd['resp_desc'] = 'Payment approved by %s, %s' % (member,DateTime.DateTime())
+doc.edit(mapping=pd)
+if doc.type_description.startswith('School Fee'):
+    wftool.doActionFor(student,'pay_school_fee')
+logger.info('"%s", "approved epayment for","%s""' % (member,student_id))
+wftool.doActionFor(context,'close')
+return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_epayment/aprove_epayment.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/aprove_epayment.py	(revision 1426)
+++ 	(revision )
@@ -1,44 +1,0 @@
-## Script (Python) "epayment_cb"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id$
-"""
-payment callback
-"""
-import logging
-logger = logging.getLogger('EPayment')
-import DateTime
-if context.portal_membership.isAnonymousUser():
-    return None
-
-request = context.REQUEST
-students = context.portal_url.getPortalObject().campus.students
-wftool = context.portal_workflow
-mtool = context.portal_membership
-is_anon = mtool.isAnonymousUser()
-member = mtool.getAuthenticatedMember()
-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)
-
-pd = {}
-#from Products.zdb import set_trace;set_trace()
-doc = context.getContent()
-review_state = wftool.getInfoFor(context,'review_state',None)
-if review_state != "opened":
-    return "not open %s" % review_state
-pd['resp_code'] = 'internal by %s' % member
-pd['resp_desc'] = '%s %s' % (member,DateTime.DateTime())
-doc.edit(mapping=pd)
-wftool.doActionFor(student,'pay_school_fee')
-logger.info('"%s", "approved EPayment for","%s""' % (member,student_id))
-wftool.doActionFor(context,'close')
-return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_epayment/callback.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/callback.pt	(revision 1426)
+++ 	(revision )
@@ -1,11 +1,0 @@
-<metal:html>
-  <metal:body use-macro="here/main_template/macros/master">
-    <metal:main fill-slot="main">
-      x_RespCode: <span tal:replace="request/x_RespCode|nothing" /><br />
-      x_RespDesc: <span tal:replace="request/x_RespDesc|nothing" /><br />
-      x_RespPayRef: <span tal:replace="request/x_RespPayRef|nothing" /><br />
-      x_CardNum: <span tal:replace="request/x_CardNum|nothing" /><br />
-      x_ApprAmt: <span tal:replace="request/x_ApprAmt|nothing" /><br />
-    </metal:main>
-  </metal:body>
-</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_epayment/callback.pt_not_used
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/callback.pt_not_used	(revision 1427)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/callback.pt_not_used	(revision 1427)
@@ -0,0 +1,11 @@
+<metal:html>
+  <metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main">
+      x_RespCode: <span tal:replace="request/x_RespCode|nothing" /><br />
+      x_RespDesc: <span tal:replace="request/x_RespDesc|nothing" /><br />
+      x_RespPayRef: <span tal:replace="request/x_RespPayRef|nothing" /><br />
+      x_CardNum: <span tal:replace="request/x_CardNum|nothing" /><br />
+      x_ApprAmt: <span tal:replace="request/x_ApprAmt|nothing" /><br />
+    </metal:main>
+  </metal:body>
+</metal:html>
Index: WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1426)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1427)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('EPayment.')
+logger = logging.getLogger('EPayment.Info')
 import DateTime
 request = context.REQUEST
@@ -23,19 +23,40 @@
 #student = getattr(students,student_id)
 s_brain = context.students_catalog(id = student_id)[0]
+
 payments = []
 #from Products.zdb import set_trace;set_trace()
-for o_id in context.objectIds():
-    d = {}
-    d['id'] = o_id
-    res = context.portal_catalog(id=o_id)
-    if res:
-        title = res[0].Title
-        d['title'] = title or o_id
-    else:
-        d['title'] = "no Title"
-    payments.append(d)
+
 info = {}
 is_so = info['is_so'] = context.isSectionOfficer()
+
+res = context.portal_catalog(portal_type='Student',id = student_id)
+if res:
+    info['review_state'] = res[0].review_state
+
 info['student_name'] = s_brain.name
+payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)
+sos = context.portal_catalog(container_path=payments_path)
+info['is_so'] = is_so
+
+for so in sos:
+
+    row = {}
+    row['id'] = so.getId
+    row['title'] = so.Title
+    url = row['url'] = "%s/%s" % (payments_path,so.getId)
+    so_object = context.restrictedTraverse(url,default=None).getContent()
+    row['type'] = so.portal_type
+    review_state = row['review_state'] = so.review_state
+    if so_object.type_description.startswith('School Fee'):
+        row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated'
+    else:
+        row['is_approvable'] = is_so and (review_state == "opened")
+    if (review_state == "closed") and so_object.resp_code in ('SC','00','AP',):
+        row['confirmed'] = 'active'
+    else:
+        row['confirmed'] = ''
+    payments.append(row)
+    
+
 info['payments'] = payments
 return info
Index: WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt	(revision 1426)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/payment_receipt.pt	(revision 1427)
@@ -8,5 +8,5 @@
       <span tal:condition="info">
       
-        <metal:block tal:condition="python:info_doc['doc'].resp_code=='00'">            
+        <metal:block tal:condition="python:info_doc['doc'].resp_code in ('00','AP',)">            
         <h3>Online Payment Receipt</h3>
         <br />
@@ -106,5 +106,5 @@
         </metal:block>
         
-        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','')">            
+        <metal:block tal:condition="python:info_doc['doc'].resp_code not in ('SC','00','AP','')">            
         <h3>Response from Bank: "<span tal:content="python:info_doc['doc'].resp_desc" />"</h3>
         <br />        
Index: WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt	(revision 1426)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt	(revision 1427)
@@ -24,12 +24,22 @@
                               review_state context/getStudentReviewState">
 
-        <table class="contentListing" width="100%">
+        <table class="registration" width="100%">
           <tr tal:repeat="row rows"
               tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
-            <td>
+            
+            <td tal:attributes="class string:${row/confirmed}">
               <a target="slip" href="" tal:attributes="href string:${context/absolute_url}/${row/id}/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 tal:attributes="class string:${row/confirmed}">
+            <a tal:condition="python:row['is_approvable']"
+               tal:attributes="href string:${context/absolute_url}/${row/id}/approve_epayment;
+                               onclick python:'return window.confirm(\'%s\')' %(cpsmcat('Are you sure? You will not be able to undo the approval.'), );
+                               ">
+                [approve payment]
+            </a>             
+            </td>
+                        
           </tr>
         </table>
Index: WAeUP_SRP/trunk/skins/waeup_epayment/simulate_callback.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_epayment/simulate_callback.py	(revision 1426)
+++ WAeUP_SRP/trunk/skins/waeup_epayment/simulate_callback.py	(revision 1427)
@@ -8,5 +8,5 @@
 current = DateTime.DateTime()
 pr = context.portal_registration
-logger = logging.getLogger('Returning')
+logger = logging.getLogger('EPayment.Simulate')
 validate = REQUEST.has_key("cpsdocument_edit_button")
 
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentWorkflowInfo.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentWorkflowInfo.py	(revision 1426)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentWorkflowInfo.py	(revision 1427)
@@ -33,4 +33,4 @@
                                            'courses_validated',
                                            )
-
+info['tr'] = review_state in  ('returning',)
 return info
