Index: /WAeUP_SRP/trunk/profiles/default/pins.xml
===================================================================
--- /WAeUP_SRP/trunk/profiles/default/pins.xml	(revision 2058)
+++ /WAeUP_SRP/trunk/profiles/default/pins.xml	(revision 2059)
@@ -5,7 +5,11 @@
  <column value="student"/>
  <column value="serial"/>
+ <column value="cost"/>
  <column value="prefix_batch"/>
  <index name="pin" meta_type="FieldIndex">
   <indexed_attr value="pin"/>
+ </index>
+ <index name="cost" meta_type="FieldIndex">
+  <indexed_attr value="cost"/>
  </index>
  <index name="prefix_batch" meta_type="FieldIndex">
Index: /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 2058)
+++ /WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py	(revision 2059)
@@ -78,9 +78,19 @@
 order_id = ds.get('pin_n')
 p_id = "p%s" % order_id
+pin = str(ds.get('pin'))
+try:
+    cost = context.portal_pins(pin="".join(pin.split('-')))[0].cost
+except:
+    cost = "n/a"
+try:
+    x = float(cost)
+except:
+    cost = "n/a"
+    
 if not hasattr(payments,p_id):
     now = DateTime.DateTime()
     info['date'] = now
-    info['amount'] = "n/a"
-    pin = info['order_id'] = "%s" % (ds.get('pin'))
+    info['amount'] = cost
+    pin = info['order_id'] = "%s" % (pin)
     info['type_code'] = "%s" % pin
     info['type_description'] = 'School Fee for Session %s' % next_session_str
Index: /WAeUP_SRP/trunk/skins/waeup_student/getMemberInfo.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/getMemberInfo.py	(revision 2058)
+++ /WAeUP_SRP/trunk/skins/waeup_student/getMemberInfo.py	(revision 2059)
@@ -21,6 +21,4 @@
 member_id = str(member)
 path_info = request.get('PATH_INFO').split('/')
-##from Products.zdb import set_trace
-##set_trace()
 if mtool.isAnonymousUser():
     return None
Index: /WAeUP_SRP/trunk/skins/waeup_student/mail_password_form.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/mail_password_form.pt	(revision 2058)
+++ /WAeUP_SRP/trunk/skins/waeup_student/mail_password_form.pt	(revision 2059)
@@ -76,5 +76,6 @@
       </form>
       </span>
-      <form action="mail_next_student" method="post" class="group">
+      <form action="mail_next_student" method="post" class="group"
+            tal:attributes="action string:${context/absolute_url}/mail_next_student">
          <input type="submit" class="context" value="Next Student Id" />
          <input name="student_id" type="text" size="8">
Index: /WAeUP_SRP/trunk/skins/waeup_student/student_view.pt
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/student_view.pt	(revision 2058)
+++ /WAeUP_SRP/trunk/skins/waeup_student/student_view.pt	(revision 2059)
@@ -108,5 +108,6 @@
                           'ehioaiks','despej','shinakale','igadoghe','benamechi','edafeohwo')">
       <br />
-      <form action="mail_password_form" method="post" class="group">
+      <form action="mail_password_form" method="post" class="group"
+            tal:attributes="action string:${context/absolute_url}/mail_password_form">
          <input type="submit" class="context" value="Send Email with Authentication Data" />
       </form>
Index: /WAeUP_SRP/trunk/skins/waeup_utilities/ti_167_resolve.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_utilities/ti_167_resolve.py	(revision 2059)
+++ /WAeUP_SRP/trunk/skins/waeup_utilities/ti_167_resolve.py	(revision 2059)
@@ -0,0 +1,65 @@
+## Script (Python) "ti_167_resolve"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+import logging
+logger = logging.getLogger('Skins.ti_167_resolve')
+from Products.AdvancedQuery import Eq, Between, Le,In,MatchGlob
+aq_pins = context.portal_pins.evalAdvancedQuery
+aq_portal = context.portal_catalog_real.evalAdvancedQuery
+
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+students = context.portal_url.getPortalObject().campus.students
+
+#from string import Template
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n\r" % s)
+
+batches = context.portal_catalog(portal_type = "ScratchCardBatch")
+logger.info("starting to insert cost property into pins-catatlog")
+batch_cost = {}
+for batch in batches:
+    prefix_batch = ''.join(batch.getId.split('_'))
+    cost = batch.getObject().getContent().cost
+    batch_cost[prefix_batch] = cost
+    # query = Eq('prefix_batch',prefix_batch)
+    # pins = aq_pins(query)
+    # for pin in pins:
+    #     context.portal_pins.modifyRecord(pin=pin.pin,cost=cost)
+# logger.info("finished to insert cost property into pins-catatlog")
+query = Eq('portal_type',"Payment")
+payments = aq_portal(query)
+count = 0
+no_cost = 0
+for payment in payments:
+    if payment.Title.find('n/a') > -1:
+        #set_trace()
+        payment_doc = payment.getObject().getContent()
+        prefix_batch = ''.join(str(payment_doc.order_id).split('-')[:2])
+        if batch_cost.has_key(prefix_batch):
+            count += 1
+            payment_doc.edit(mapping = {'amount': 
+                                        batch_cost[prefix_batch]})
+        else:
+            rwrite("cost %s:%s not found" % (prefix_batch,payment_doc.order_id))
+            no_cost +=1
+logger.info("updated %d payment amounts, %d costs not found" % (count,no_cost))
+
+    
