Index: WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1549)
+++ WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1551)
@@ -13,5 +13,5 @@
 """
 import logging
-logger = logging.getLogger('Student.Statistics')
+logger = logging.getLogger('Skins.getRetStudentStatistics')
 
 try:
@@ -21,20 +21,26 @@
 except:
     evalAdvancedQuery = None
-logger.info('"%s","invoked returning statistics"' % context.portal_membership.getAuthenticatedMember())
+logger.info('%s invoked returning statistics' % context.portal_membership.getAuthenticatedMember())
 l = []
 if not context.isStaff():
     return l
 dep = {}
-sum = 0
 dep['id'] = "All Faculties"
 
-#from Products.zdb import set_trace;set_trace()
 
-ret_res = context.portal_catalog(review_state ='returning')
-ret_ids = [r.getId for r in ret_res]
-ret = len(ret_res)
-dep['total'] = ret
+ret_res1 = context.portal_catalog(review_state = 'returning')
+ret_ids1 = [r.getId for r in ret_res1]
+total_ret = len(ret_ids1)
+
+ret_res2 = context.portal_catalog(review_state = ('school_fee_paid','courses_registered','courses_validated',))
+ret_ids2 = [r.getId for r in ret_res2]
+
+retquery = Ge('level','300') | (Eq('level','200') & Eq('entry_mode','UME'))
+ret_res3 = aq_students(retquery)
+ret_ids3 = [r.id for r in ret_res3]
 
 l.append(dep)
+sum_ret = 0
+sum_sfp = 0
 fs = context.portal_catalog(portal_type="Faculty")
 for fid in [f.getId for f in fs]:
@@ -45,18 +51,20 @@
     stud_ids = [r.id for r in stud_res]
     total = float(len(stud_res))
-
     if total == 0:
         continue
-
-    ret = len([s for s in stud_ids if s in ret_ids])
-    dep['returned'] = ret
-    sum += ret
-
-    if ret == 0:
-        continue
-
+    sfp = len([s for s in stud_ids if s in ret_ids2 and s in ret_ids3])
+    dep['sfp'] = sfp
+    ret = len([s for s in stud_ids if s in ret_ids1])
+    dep['ret'] = ret
+    sum_ret += ret
+    sum_sfp += sfp
+       
     l.append(dep)
 
-l[0]['sum'] = sum
+l[0]['ret'] = sum_ret
+l[0]['sfp'] = sum_sfp
+l[0]['total_ret'] = total_ret + sum_sfp
+l[0]['total_li'] = sum_ret + sum_sfp
+
 
 return l
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1549)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1551)
@@ -24,9 +24,15 @@
       <h3>Returning Student Statistics</h3>
       <br />      
+      <span tal:content="python:departments[0]['total_ret']" /> 
+      returning student records have been imported. 
+      <span tal:content="python:departments[0]['total_li']" /> returning students 
+      have logged in.
+      <br /><br />
       <span tal:condition="not:isAnon">
         <table>
           <tr class="odd ajaxtd">
             <th >Faculty</th>
-            <th align="right">Returning</th>
+            <th align="right">RET</th>
+            <th align="right">SFP</th>
           </tr>
           <tr tal:define="d python:departments[0]"
@@ -34,5 +40,8 @@
               <td width="80px">All Faculties</td>
               <td width="80px" align="right"> 
-                <span tal:content="d/sum" /> of <span tal:content="d/total" />
+                <span tal:content="d/ret" />
+              </td>   
+              <td width="80px" align="right"> 
+                <span tal:content="d/sfp" />
               </td>              
           </tr>
@@ -41,9 +50,16 @@
               <td width="80px"> <span tal:content="d/id" /> </td>
               <td width="80px" align="right"> 
-                <span tal:content="d/returned " />
-              </td>              
+                <span tal:content="d/ret" />
+              </td>       
+              <td width="80px" align="right"> 
+                <span tal:content="d/sfp" />
+              </td>                              
           </tr>
         </table>
         <br />
+        <table>
+        <tr><td>RET:</td> <td>Returning students who only logged in</td></tr>
+        <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr>
+        </table>        
       </span>
       </span>
