Index: /WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1757)
+++ /WAeUP_SRP/trunk/WAeUPTool.py	(revision 1758)
@@ -740,5 +740,7 @@
                 d['sex'] = dict.get('sex') == 'F'
             sub_doc.edit(mapping = d)
-            self.portal_workflow.doActionFor(sub_obj,f2t[pt]['wf_state'],dest_container=sub_obj)
+            new_state = f2t[pt]['wf_state']
+            if new_state != "remain":
+                self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
         wfaction = 'return'
         self.portal_workflow.doActionFor(student_obj,wfaction)
Index: /WAeUP_SRP/trunk/skins/waeup_default/getNextSessionId.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/getNextSessionId.py	(revision 1758)
+++ /WAeUP_SRP/trunk/skins/waeup_default/getNextSessionId.py	(revision 1758)
@@ -0,0 +1,21 @@
+## Script (Python) "getSessionId"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=session
+##title=
+##
+# $Id$
+"""
+return the next Session Id 
+"""
+if session != context.getSessionId():
+    ns = int(session) + 1
+else:
+    ns = int(session)
+ns = "%02d" % ns
+ns_str = context.portal_vocabularies.sessions.get(ns)
+
+return ns,ns_str
Index: /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py	(revision 1758)
@@ -15,6 +15,4 @@
 except:
     return 'unknown'
-##if len(key) != 2:
-##    return 'unknown'
 if y < 90:
     cent = 2000
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1758)
@@ -39,7 +39,9 @@
 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
+#res = context.portal_catalog(portal_type='Student',id = student_id)
+#res = context.students_catalog(id = student_id)
+info['review_state'] = s_brain.review_state
+session = s_brain.session
+info['next_session'], info['next_session_str'] = context.getNextSessionId(session)
 
 info['student_name'] = s_brain.name
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1758)
@@ -16,4 +16,9 @@
 logger = logging.getLogger('Skins.pay_by_sc')
 import DateTime
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
 
 if context.portal_membership.isAnonymousUser():
@@ -28,7 +33,8 @@
 
 student = getattr(students,student_id)
-sbrain = context.students_catalog(id=student_id)[0]
-amount,description = context.getSchoolFee(sbrain.faculty)
-
+s_brain = context.students_catalog(id=student_id)[0]
+session = s_brain.session
+next_session, next_session_str = context.getNextSessionId(session)
+amount,description = context.getSchoolFee(s_brain.faculty)
 validate = request.has_key("cpsdocument_create_button")
 res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
@@ -46,4 +52,5 @@
                                  psm = psm,
                                  mode = 'edit',
+                                 next_session_str = next_session_str,
                                  ds = ds,
                                  )
@@ -52,4 +59,5 @@
                                  psm = None,
                                  mode = 'edit',
+                                 next_session_str = next_session_str,
                                  ds = ds,
                                  )
@@ -73,7 +81,7 @@
     info['date'] = now
     info['amount'] = "n/a"
-    pin = info['order_id'] = ds.get('pin')
+    pin = info['order_id'] = "%s__%s" % (ds.get('pin'),next_session)
     info['type_code'] = "%s" % pin
-    info['type_description'] = 'School Fee for Session 2006/2007'
+    info['type_description'] = 'School Fee for Session %s' % next_session_str
     info['resp_code'] = "SC"
     info['resp_desc'] = "SC Payment Successful"
@@ -84,5 +92,13 @@
     payment.getContent().edit(mapping=info)
     wftool.doActionFor(payment,'close')
-    wftool.doActionFor(student,'pay_school_fee')
+    if next_session == context.getSessionId(): 
+        wftool.doActionFor(student,'pay_school_fee')
+    else:
+        study_course = getattr(student,'study_course')
+        wftool.doActionFor(study_course,'open')
+        study_course_doc = study_course.getContent()
+        next_level = "%s" % (int(s_brain.level) + 100)
+        study_course_doc.edit(mapping= {'current_level': next_level,
+                                        'current_session': next_session,})
     logger.info('%s paid school fee by scratch card' % student_id)
 else:
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc_form.pt	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc_form.pt	(revision 1758)
@@ -13,5 +13,5 @@
       </metal:block>
       <metal:block fill-slot="main">
-        <h3>Pay Your 2006/2007 School Fee by Scratch Card!</h3>
+        <h3>Pay Your <span tal:replace="options/next_session_str" /> School Fee by Scratch Card!</h3>
         <br />
         <div tal:replace="structure rendered_main" />
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/payments_view.pt	(revision 1758)
@@ -69,7 +69,12 @@
         <form tal:condition="python:review_state == 'returning'" 
               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 School Fee by Scratch Card" 
+                value="Pay School Fee by Scratch Card"
+                tal:attributes="value string:Pay ${info/next_session_str} School Fee by Scratch Card"
                 />
         </form>          
Index: /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py	(revision 1757)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py	(revision 1758)
@@ -16,4 +16,9 @@
     return None
 
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
 import logging
 logger = logging.getLogger('Skins.getSchoolFeePrefix')
@@ -23,4 +28,5 @@
 res = context.portal_catalog(portal_type="Certificate",
                                      id = sbrain.course)
+#set_trace()
 if not res:
     logger.info('%s, certificate %s not found' % (student_id,course))
