Index: WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py	(revision 2450)
+++ WAeUP_SRP/base/skins/waeup_epayment/pay_by_sc.py	(revision 2451)
@@ -34,7 +34,18 @@
 student = getattr(students,student_id)
 s_brain = context.students_catalog(id=student_id)[0]
-session = s_brain.session
-next_session, next_session_str = context.getNextSessionId(session)
-validate = request.has_key("cpsdocument_create_button")
+next_info = context.getNextInfo(s_brain)
+next_session_id = next_info['next_session_id'] 
+next_session_str = next_info['next_session_str']
+next_level_id = next_info['next_level_id'] 
+next_transition = next_info['next_transition'] 
+study_course = getattr(student,'study_course')
+study_course.getContent().edit(mapping= {'current_level': next_level_id,
+                                         'current_session': next_session_id,})
+if next_transition:
+    wftool.doActionFor(student,next_transition)
+
+# session = s_brain.session
+# next_session, next_session_str = context.getNextSessionId(session)
+# validate = request.has_key("cpsdocument_create_button")
 res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
                       schema_id= 'payment',
Index: WAeUP_SRP/base/skins/waeup_student/add_course_result.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/add_course_result.py	(revision 2450)
+++ WAeUP_SRP/base/skins/waeup_student/add_course_result.py	(revision 2451)
@@ -71,5 +71,6 @@
 d['student_id'] = student_id = context.getStudentId()
 d['level_id'] = level_id = context.getId()
-d['session_id'] = context.session
+session_id = context.getLevelSession(context.getContent(),student_id,level_id)
+d['session_id'] = session_id
 d['key'] = "%s|%s|%s" % (student_id,level_id,course_id)
 
Index: WAeUP_SRP/base/skins/waeup_student/getLevelSession.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/getLevelSession.py	(revision 2450)
+++ WAeUP_SRP/base/skins/waeup_student/getLevelSession.py	(revision 2451)
@@ -12,4 +12,6 @@
 return fixed session_id from level
 """
+import logging
+logger = logging.getLogger('Skins.getLevelSession')
 session_id = level_doc.session
 changed = False
Index: WAeUP_SRP/base/skins/waeup_student/getNextInfo.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/getNextInfo.py	(revision 2451)
+++ WAeUP_SRP/base/skins/waeup_student/getNextInfo.py	(revision 2451)
@@ -0,0 +1,29 @@
+## Script (Python) "getSessionId"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=student_brain
+##title=
+##
+# $Id$
+"""
+return the students next info
+"""
+info = {}
+info['next_transition'] = None
+session_id = student_brain.session
+if int(session_id) > int(context.getSessionId()[3:4]) -2:
+    info['next_transition'] = "pay_school_fee"
+
+if student_brain.review_state == "returning":
+    session_id info['next_session_id'] = "%02d" % int(session_id) + 1
+info['next_session_str'] = context.session_voc(session_id)
+next_level_id = student_brain.level
+if student_brain.review_state not in ('cleared_and_validated',)
+    next_level_id = "%s" % (int(next_level_id) + 100)
+info['next_level_id'] = next_level_id
+
+
+return info
Index: WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py	(revision 2450)
+++ WAeUP_SRP/base/skins/waeup_student/getStudyLevelInfo.py	(revision 2451)
@@ -32,5 +32,4 @@
 course_results = context.course_results
 request = context.REQUEST
-#session = request.SESSION
 response = request.RESPONSE
 import logging
@@ -110,3 +109,2 @@
 
 return info
-
Index: WAeUP_SRP/base/skins/waeup_student/refresh_level.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_student/refresh_level.py	(revision 2450)
+++ WAeUP_SRP/base/skins/waeup_student/refresh_level.py	(revision 2451)
