Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml	(revision 1282)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml	(revision 1283)
@@ -4,5 +4,5 @@
  <property name="layout_edit_method"></property>
  <property name="layout_view_method"></property>
- <property name="style_prefix">layout_waeup_</property>
+ <property name="style_prefix">layout_application_</property>
  <property name="flexible_widgets"/>
  <property name="validate_values_expr"></property>
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1282)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py	(revision 1283)
@@ -24,4 +24,5 @@
 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 = {}
@@ -34,5 +35,4 @@
         d['title'] = "no Title"
     payments.append(d)
-#from Products.zdb import set_trace;set_trace()
 info = {}
 is_so = info['is_so'] = context.isSectionOfficer()
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1282)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1283)
@@ -22,14 +22,24 @@
 student_id = context.getStudentId()
 if student_id is None:
-    return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
+    return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
 
 student = getattr(students,student_id)
 sbrain = context.students_catalog(id=student_id)[0]
 amount,description = context.getSchoolFee(sbrain.faculty)
-validate = request.has_key("cpsdocument_edit_button")
+res = context.portal_catalog(portal_type="Certificate",
+                                     id = sbrain.course)
+if not res:
+    logger.info('"%s","certificate not found", "%s"' % (student_id,course))
+    prefix = ""
+else:    
+    prefix = res[0].getObject().getContent().school_fee_code
+    if not prefix or prefix == 'none':
+        prefix = res[0].getPath().split('/')[-4]
+
+validate = request.has_key("cpsdocument_create_button")
 res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
                       schema_id= 'epayment',
                       context=context,
-                      mapping=validate and REQUEST,
+                      mapping=validate and request,
                       ob={},
                       layout_mode="create",
@@ -61,17 +71,22 @@
 else:
     payments = getattr(student,'payments')
+#from Products.zdb import set_trace; set_trace()
 info = {}
-order_id = info['order_id'] = ds.get('payment_id')
+order_id = ds.get('pin_n')
 p_id = "p%s" % order_id
 now = DateTime.DateTime()
 info['date'] = now
-info['type_code'] = "schoolfee_%s"
-info['type_code'] = 'description'
-info['amount'] = amount
+info['amount'] = "n/a" 
+pin = info['order_id'] = ds.get('pin')
+info['type_code'] = "schoolfee_%s" % pin
+info['type_description'] = 'Schoolfee SC %s' % pin
 payments.invokeFactory('Payment', p_id)
 payment = getattr(payments,p_id)
-#from Products.zdb import set_trace;set_trace()
+wftool = context.portal_workflow
+wftool.doActionFor(payment,'open')
 payment.getContent().edit(mapping=info)
-url = "%s/payments/%s" % (student.absolute_url(),p_id)
+wftool.doActionFor(payment,'close')
+wftool.doActionFor(student,'enter_school_fee_pin')
+url = "%s/payments" % (student.absolute_url())
 request.RESPONSE.redirect(url)
 
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_index.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 1282)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_index.py	(revision 1283)
@@ -26,4 +26,6 @@
     elif context.portal_type == 'StudentClearance':
         return context.clearance_view()
+    elif context.portal_type == 'PaymentsFolder':
+        return context.payments_view()
     elif context.portal_type == 'Student':
         return redirect("%s/student_view" % context.absolute_url())
