Index: WAeUP_SRP/trunk/doc/srp_documentation.mm
===================================================================
--- WAeUP_SRP/trunk/doc/srp_documentation.mm	(revision 1529)
+++ WAeUP_SRP/trunk/doc/srp_documentation.mm	(revision 1530)
@@ -2,10 +2,10 @@
 <!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->
 <node CREATED="1170079518946" ID="Freemind_Link_650524897" MODIFIED="1172489583516" TEXT="WAeUP Documentation">
-<node CREATED="1172489553062" FOLDED="true" ID="Freemind_Link_1276207160" MODIFIED="1172489556316" POSITION="right" TEXT="Glossary">
+<node CREATED="1172489553062" ID="Freemind_Link_1276207160" MODIFIED="1172489556316" POSITION="right" TEXT="Glossary">
 <node CREATED="1172588742298" ID="Freemind_Link_495359346" LINK="../profiles/default/schemas.xml" MODIFIED="1173007237566" TEXT="Field Names (Attributes)"/>
 <node CREATED="1172588782286" ID="Freemind_Link_1234262632" LINK="../profiles/default/types.xml" MODIFIED="1172588916308" TEXT="Types"/>
 <node CREATED="1172588791669" ID="Freemind_Link_832896495" LINK="../profiles/default/layouts.xml" MODIFIED="1173007318993" TEXT="Labels (Titles)"/>
 </node>
-<node CREATED="1172489529057" FOLDED="true" ID="Freemind_Link_43083883" MODIFIED="1172489545651" POSITION="right" TEXT="SRP Data Structure">
+<node CREATED="1172489529057" ID="Freemind_Link_43083883" MODIFIED="1172489545651" POSITION="right" TEXT="SRP Data Structure">
 <node CREATED="1170079621592" FOLDED="true" ID="Freemind_Link_1297017754" MODIFIED="1170079640872" TEXT="Campus">
 <node CREATED="1171710559043" ID="Freemind_Link_1592396213" MODIFIED="1171710565212" TEXT="Id: campus"/>
@@ -262,5 +262,5 @@
 <node CREATED="1171711999584" ID="Freemind_Link_1070634598" MODIFIED="1171712315178" TEXT="Groups"/>
 </node>
-<node CREATED="1170931308473" FOLDED="true" ID="Freemind_Link_249696543" MODIFIED="1170931315740" TEXT="Catalogs">
+<node CREATED="1170931308473" ID="Freemind_Link_249696543" MODIFIED="1170931315740" TEXT="Catalogs">
 <node CREATED="1170931319920" ID="Freemind_Link_1633117071" MODIFIED="1171712108641" TEXT="Portal Catalog"/>
 <node CREATED="1171712109062" ID="Freemind_Link_769089546" LINK="../profiles/default/courses_catalog.xml" MODIFIED="1172055793074" TEXT="Courses Catalog"/>
@@ -273,5 +273,5 @@
 </node>
 <node CREATED="1172001308558" FOLDED="true" ID="Freemind_Link_1997267023" MODIFIED="1172490300476" TEXT="Profiles">
-<node CREATED="1172001324877" FOLDED="true" ID="Freemind_Link_1866579033" MODIFIED="1172001330846" TEXT="default">
+<node CREATED="1172001324877" ID="Freemind_Link_1866579033" MODIFIED="1172001330846" TEXT="default">
 <node CREATED="1172001340812" ID="Freemind_Link_274105864" LINK="../profiles/default/directories.xml" MODIFIED="1172001465313" TEXT="portal_directories"/>
 <node CREATED="1172001340812" ID="Freemind_Link_1612370167" LINK="../profiles/default/layouts.xml" MODIFIED="1172001506077" TEXT="portal_layouts"/>
Index: WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py	(revision 1529)
+++ WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py	(revision 1530)
@@ -29,9 +29,6 @@
 dep['id'] = "All Faculties"
 
-umequery = Eq('level','100') | (Eq('level','200') & Eq('entry_mode','DE'))
-#umequery = Eq('level','100')
-#dequery = Eq('entry_mode','DE')  # only correct for 2006/2007
-#total_new = aq_students(umequery or dequery)
-total_new = aq_students(umequery)
+freshquery = Eq('level','100') | (Eq('level','200') & Eq('entry_mode','DE'))
+total_new = aq_students(freshquery)
 total_new = float(len(total_new))
 dep['new'] = "%.0f" % total_new
@@ -70,4 +67,9 @@
 dep['objection_raised_percent'] = "%.0f" % round(ora*100/total_new)
 
+total_sfp = total_new - (cav + cr + cpe + adm + ora)
+dep['rest'] = int(total_sfp)
+dep['rest_percent'] = "%.0f" % round(total_sfp*100/total_new)
+
+
 l.append(dep)
 fs = context.portal_catalog(portal_type="Faculty")
@@ -76,11 +78,11 @@
     dep['id'] = fid
     fquery = Eq('faculty',fid)
-    #umequery = Eq('level','100')
-    #fac_res = aq_students(fquery & umequery & dequery)
-    fac_res = aq_students(fquery & umequery)
+    fac_res = aq_students(fquery & freshquery)
     fac_ids = [r.id for r in fac_res]
     total = float(len(fac_res))
-    #if total == 0:
-    #    continue
+
+    if total == 0:
+        continue
+
     dep['new'] = "%.0f" % total
 
@@ -106,4 +108,5 @@
     if total:
         dep['cleared_and_validated_percent'] = "%.0f" % round(cav*100/total)
+        
     ora = len([s for s in fac_ids if s in or_ids])
     dep['objection_raised'] = ora
@@ -112,8 +115,10 @@
         dep['objection_raised_percent'] = "%.0f" % round(ora*100/total)
 
-    if total == 0:
-        continue
+    rest = int(total - (cav + cr + cpe + adm + ora))
+    dep['rest'] = rest
+    dep['rest_percent'] = "%.0f" % round(rest*100/total)
 
     l.append(dep)
 
 return l
+
Index: WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py	(revision 1530)
+++ WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py	(revision 1530)
@@ -0,0 +1,93 @@
+## Script (Python) "getRegStatistics"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id: getStudentStatistics.py 1277 2007-01-11 21:11:37Z joachim $
+"""
+return Student Statistics
+"""
+import logging
+logger = logging.getLogger('Student.Statistics')
+
+try:
+    from Products.AdvancedQuery import Eq, Between, Le,In, Ge
+    aq_portal = context.portal_catalog.evalAdvancedQuery
+    students_catalog = context.students_catalog
+except:
+    evalAdvancedQuery = None
+logger.info('"%s","invoked reg statistics"' % context.portal_membership.getAuthenticatedMember())
+l = []
+if not context.isStaff():
+    return l
+dep = {}
+
+dep['id'] = "All Faculties"
+
+total = float(len(students_catalog))
+
+dep['total'] = "%.0f" % total
+
+
+#from Products.zdb import set_trace;set_trace()
+
+sfp_res = context.portal_catalog(review_state ='school_fee_paid')
+sfp_ids = [r.getId for r in sfp_res]
+sfp = len(sfp_res)
+dep['school_fee_paid'] = sfp
+dep['school_fee_paid_percent'] =  "%.0f" % round(sfp*100/total)
+
+creg_res = context.portal_catalog(review_state ='courses_registered')
+creg_ids = [r.getId for r in creg_res]
+creg = len(creg_res)
+dep['courses_registered'] = creg
+dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
+
+cval_res = context.portal_catalog(review_state='courses_validated')
+cval_ids = [r.getId for r in cval_res]
+cval = len(cval_res)
+dep['courses_validated'] = cval
+dep['courses_validated_percent'] = "%.0f" % round(cval*100/total)
+
+
+l.append(dep)
+fs = context.portal_catalog(portal_type="Faculty")
+for fid in [f.getId for f in fs]:
+    dep = {}
+    dep['id'] = fid
+    #fquery = Eq('faculty',fid)
+    fac_res = students_catalog(faculty = fid)
+    fac_ids = [r.id for r in fac_res]
+    total = float(len(fac_res))
+
+    if total == 0:
+        continue
+
+    dep['total'] = "%.0f" % total
+
+    sfp = len([s for s in fac_ids if s in sfp_ids])
+    dep['school_fee_paid'] = sfp
+    dep['school_fee_paid_percent'] = 0
+    if total:
+        dep['school_fee_paid_percent'] = "%.0f" % round(sfp*100/total)
+
+    creg = len([s for s in fac_ids if s in creg_ids])
+    dep['courses_registered'] = creg
+    dep['courses_registered_percent'] = 0
+    if total:
+        dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
+        
+    cval = len([s for s in fac_ids if s in cval_ids])
+    dep['courses_validated'] = cval
+    dep['courses_validated_percent'] = 0
+    if total:
+        dep['courses_validated_percent'] = "%.0f" % round(cval*100/total)
+
+    l.append(dep)
+
+return l
+
Index: WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1529)
+++ WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1530)
@@ -26,5 +26,5 @@
     return l
 dep = {}
-
+sum = 0
 dep['id'] = "All Faculties"
 
@@ -33,7 +33,6 @@
 ret_res = context.portal_catalog(review_state ='returning')
 ret_ids = [r.getId for r in ret_res]
-total_returned = aq_students(Ge('level','200'))
-total_returned = float(len(total_returned))
-dep['returned'] = "%.0f" % total_returned
+ret = len(ret_res)
+dep['total'] = ret
 
 l.append(dep)
@@ -43,9 +42,14 @@
     dep['id'] = fid
     fquery = Eq('faculty',fid)
-    squery = Ge('level','200')
-    fac_res = aq_students(fquery & squery)
+    fac_res = aq_students(fquery)
     fac_ids = [r.id for r in fac_res]
+    total = float(len(fac_res))
+
+    if total == 0:
+        continue
+
     ret = len([s for s in fac_ids if s in ret_ids])
     dep['returned'] = ret
+    sum += ret
 
     if ret == 0:
@@ -54,3 +58,6 @@
     l.append(dep)
 
+l[0]['sum'] = sum
+
 return l
+
Index: WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt	(revision 1529)
+++ WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt	(revision 1530)
@@ -19,15 +19,16 @@
       </span>
       <span tal:condition="allowed" tal:omit-tag="">
-        <a href="statistics_new_view"><strong>New Student Statistics</strong></a>
+        <a href="statistics_new_view"><strong><nobr>New Student Statistics</nobr></strong></a>
         &nbsp;&nbsp;&nbsp;&nbsp;
-        <a href="statistics_ret_view"><strong>Returning Student Statistics</strong></a>
+        <a href="statistics_ret_view"><strong><nobr>Returning Student Statistics</nobr></strong></a>
         &nbsp;&nbsp;&nbsp;&nbsp;
-        <a href="list_students"><strong>Cleared Student Export</strong></a>
+        <a href="statistics_reg_view"><strong><nobr>Registration Statistics</nobr></strong></a>
+        &nbsp;&nbsp;&nbsp;&nbsp;        
+        <a href="list_students"><strong><nobr>Cleared Student Export</nobr></strong></a>
         &nbsp;&nbsp;&nbsp;&nbsp;
-        
         <span tal:condition="is_so">
-        <a href="add_student"><strong>Add Student Record</strong></a>        
+        <a href="add_student"><strong><nobr>Add Student Record</nobr></strong></a>        
         &nbsp;&nbsp;&nbsp;&nbsp;
-        <a href="paid_transfer_list"><strong>Export Transfer Students</strong></a>    
+        <a href="paid_transfer_list"><strong><nobr>Export Transfer Students</nobr></strong></a>    
         </span> 
               
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt	(revision 1529)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt	(revision 1530)
@@ -10,7 +10,10 @@
       <span tal:condition="departments">
   
-      <a href="search_students"><strong>Search Students</strong></a>
-      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-      <a href="statistics_ret_view"><strong>Returning Student Statistics</strong></a>
+      <a href="search_students"><strong><nobr>Search Students</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_ret_view"><strong><nobr>Returning Student Statistics</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_reg_view"><strong><nobr>Registration Statistics</nobr></strong></a>      
+
       <h3>New Student Statistics</h3>
       <br />      
@@ -25,4 +28,5 @@
             <th align="right">CR</th>
             <th align="right">VC</th>
+            <th align="right">SFP</th>
           </tr>
           <tr tal:repeat="d departments"
@@ -52,5 +56,8 @@
                 (<span tal:content="d/cleared_and_validated_percent" />%)
               </td>
-     
+              <td width="80px" align="right"> 
+                <span tal:content="d/rest" />
+                (<span tal:content="d/rest_percent" />%)
+              </td>     
           </tr>
         </table>
@@ -62,4 +69,5 @@
         <tr><td>CR: </td> <td>Clearance requested</td></tr>
         <tr><td>VC: </td> <td>Validated and cleared</td></tr>
+        <tr><td>SFP: </td> <td>School fee paid</td></tr>
         </table>
       </span>
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_reg_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_reg_view.pt	(revision 1530)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_reg_view.pt	(revision 1530)
@@ -0,0 +1,61 @@
+<metal:body use-macro="here/main_template/macros/master">
+  <metal:main fill-slot="main">
+  <metal:block tal:define="departments context/getRegStatistics;
+                        mtool here/portal_membership;
+                        member mtool/getAuthenticatedMember;">       
+
+      <span tal:condition="not: departments">
+        <span tal:content="here/illegal_view" />
+      </span>
+      <span tal:condition="departments">
+  
+      <a href="search_students"><strong><nobr>Search Students</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_new_view"><strong><nobr>New Student Statistics</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_ret_view"><strong><nobr>Returning Student Statistics</nobr></strong></a>      
+
+      <h3>New Student Statistics</h3>
+      <br />
+      <span tal:condition="not:isAnon">
+        <table>
+          <tr class="odd ajaxtd">
+            <th >Faculty</th>
+            <th align="right">Total</th>
+            <th align="right">SFP</th>
+            <th align="right">CREG</th>
+            <th align="right">CVAL</th>
+          </tr>
+          <tr tal:repeat="d departments"
+              tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <td width="80px"> <span tal:content="d/id" /> </td>
+              <td width="80px" align="right">
+                <span tal:content="d/total" />
+              </td>
+              <td width="80px" align="right"> 
+                <span tal:content="d/school_fee_paid" />
+                (<span tal:content="d/school_fee_paid_percent" />%)
+              </td>              
+              <td width="80px" align="right"> 
+                <span tal:content="d/courses_registered" />
+                (<span tal:content="d/courses_registered_percent" />%)
+              </td>
+              <td width="80px" align="right"> 
+                <span tal:content="d/courses_validated" />
+                (<span tal:content="d/courses_validated_percent" />%)
+              </td>
+
+          </tr>
+        </table>
+        <br />
+        <table>
+        <tr><td>SFP:</td> <td>School fee paid</td></tr>
+        <tr><td>CREG:</td> <td>Courses registered</td></tr>
+        <tr><td>CVAL:</td> <td>Courses validated</td></tr>
+        </table>
+      </span>
+      </span>
+  </metal:block>      
+  </metal:main>
+</metal:body>
+      
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1529)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1530)
@@ -10,7 +10,9 @@
       <span tal:condition="departments">
   
-      <a href="search_students"><strong>Search Students</strong></a>
-      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-      <a href="statistics_new_view"><strong>New Student Statistics</strong></a>
+      <a href="search_students"><strong><nobr>Search Students</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_new_view"><strong><nobr>New Student Statistics</nobr></strong></a>
+      &nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="statistics_reg_view"><strong><nobr>Registration Statistics</nobr></strong></a>      
       <h3>Returning Student Statistics</h3>
       <br />      
@@ -21,6 +23,13 @@
             <th align="right">Returning</th>
           </tr>
-          <tr tal:repeat="d departments"
-              tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')">
+          <tr tal:define="d python:departments[0]"
+              class="even ajaxtd">
+              <td width="80px">All Faculties</td>
+              <td width="80px" align="right"> 
+                <span tal:content="d/sum" /> of <span tal:content="d/total" />
+              </td>              
+          </tr>
+          <tr tal:repeat="d python:departments[1:]"
+              tal:attributes="class python:test(repeat['d'].even(), 'odd ajaxtd', 'even ajaxtd')">
               <td width="80px"> <span tal:content="d/id" /> </td>
               <td width="80px" align="right"> 
