Index: /WAeUP_SRP/trunk/profiles/default/layouts.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 1273)
+++ /WAeUP_SRP/trunk/profiles/default/layouts.xml	(revision 1274)
@@ -11,4 +11,5 @@
  <object name="members" meta_type="CPS Layout"/>
  <object name="members_search" meta_type="CPS Layout"/>
+ <object name="payment" meta_type="CPS Layout"/>
  <object name="student" meta_type="CPS Layout"/>
  <object name="scratch_card_batch" meta_type="CPS Layout"/>
@@ -27,7 +28,7 @@
  <object name="student_personal_fe" meta_type="CPS Layout"/>
  <object name="student_password" meta_type="CPS Layout"/>
- <object name="payment" meta_type="CPS Layout"/>
  <object name="student_pume" meta_type="CPS Layout"/>
  <object name="student_pume_fe" meta_type="CPS Layout"/>
+ <object name="student_schoolfee" meta_type="CPS Layout"/>
  <object name="student_search" meta_type="CPS Layout"/>
  <object name="student_study_level" meta_type="CPS Layout"/>
Index: /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml	(revision 1274)
+++ /WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml	(revision 1274)
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<object name="student_schoolfee" meta_type="CPS Layout">
+ <property name="layout_create_method"></property>
+ <property name="layout_edit_method"></property>
+ <property name="layout_view_method"></property>
+ <property name="style_prefix">layout_waeup_</property>
+ <property name="flexible_widgets"/>
+ <property name="validate_values_expr"></property>
+ <property name="label"></property>
+ <property name="label_edit"></property>
+ <property name="is_i18n">False</property>
+ <widget name="pin" meta_type="Scratchcard Pin Widget">
+  <property name="title">Schoolfee Scratchcard</property>
+  <property name="fields">
+   <element value="payment_id"/>
+  </property>
+  <property name="label">Scratchcard</property>
+  <property name="label_edit">Scratchcard</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="prefix">@getSchoolFeePrefix</property>
+ </widget>
+ <table>
+  <row>
+   <cell name="pin"/>
+  </row>
+ </table>
+</object>
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1274)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 1274)
@@ -0,0 +1,77 @@
+## Script (Python) "pay_by_sc"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+pay online
+"""
+import logging
+from urllib import urlencode
+logger = logging.getLogger('EPayment.')
+import DateTime
+lt = context.portal_layouts
+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)
+sbrain = context.students_catalog(id=student_id)[0]
+amount,description = context.getSchoolFee(sbrain.faculty)
+validate = request.has_key("cpsdocument_edit_button")
+res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
+                      schema_id= 'epayment',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob={},
+                      layout_mode="create",
+                      formaction = "pay_by_sc",
+                      button = 'Pay'
+                      )
+if psm == 'invalid':
+    psm = 'Please correct your errors!'
+    return context.pay_by_sc_form(rendered = res,
+                                 psm = psm,
+                                 mode = 'edit',
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.pay_by_sc_form(rendered = res,
+                                 psm = None,
+                                 mode = 'edit',
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    pass
+if "payments" not in student.objectIds():
+    student.invokeFactory('PaymentsFolder','payments')
+    payments = getattr(student,'payments')
+    d = {}
+    d['Title'] = 'Payments'
+    payments.getContent().edit(mapping=d)
+    wftool.doActionFor(payments,'open')
+else:
+    payments = getattr(student,'payments')
+info = {}
+order_id = info['order_id'] = ds.get('payment_id')
+p_id = "p%s" % order_id
+now = DateTime.DateTime()
+info['date'] = now
+info['type_code'] = "schoolfee_%s"
+info['type_code'] = 'description'
+info['amount'] = amount
+payments.invokeFactory('Payment', p_id)
+payment = getattr(payments,p_id)
+#from Products.zdb import set_trace;set_trace()
+payment.getContent().edit(mapping=info)
+url = "%s/payments/%s" % (student.absolute_url(),p_id)
+request.RESPONSE.redirect(url)
+
Index: /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py	(revision 1274)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getSchoolFeePrefix.py	(revision 1274)
@@ -0,0 +1,25 @@
+## Script (Python) "getMaintenancePrefix"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id:getMaintenancePrefix.py 486 2006-09-06 10:09:39Z joachim $
+"""
+return the Prefix for Schoolfee
+"""
+student_id = context.getStudentId()
+sbrain = context.students_catalog(id=student_id)[0]
+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]
+return prefix
Index: /WAeUP_SRP/trunk/skins/waeup_student/pay_by_sc_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/pay_by_sc_form.pt	(revision 1274)
+++ /WAeUP_SRP/trunk/skins/waeup_student/pay_by_sc_form.pt	(revision 1274)
@@ -0,0 +1,23 @@
+<tal:block define="rendered_main options/rendered;
+           portal_status_message options/psm;
+           data_storage options/ds;
+           edition python:1;"
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/content_lib_master/macros/master">
+      <metal:block fill-slot="header"
+                   tal:define="creation creation|nothing;
+                   edition edition|nothing;
+                   metadata metadata|nothing"
+                   >
+      </metal:block>
+      <metal:block fill-slot="main">
+        <h3>Pay Your 2005/2006 Schoolfee with Scratchcart!</h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
