Index: /WAeUP_SRP/base/skins/waeup_statistics/getPaymentStatistics.py
===================================================================
--- /WAeUP_SRP/base/skins/waeup_statistics/getPaymentStatistics.py	(revision 2403)
+++ /WAeUP_SRP/base/skins/waeup_statistics/getPaymentStatistics.py	(revision 2404)
@@ -8,5 +8,5 @@
 ##title=
 ##
-# $Id: getPaymentStatistic.py 2391 2007-10-19 09:24:16Z joachim $
+# $Id: getPaymentStatistics.py 2391 2007-10-19 09:24:16Z joachim $
 """
 """
@@ -16,13 +16,17 @@
     def set_trace():
         pass
-mtool = context.portal_membership
-member = mtool.getAuthenticatedMember()
-if str(member) not in ('admin','joachim'):
-    return
 
 import logging
 import DateTime
-logger = logging.getLogger('Skins.getPaymentStatistic')
+logger = logging.getLogger('Skins.getPaymentStatistics')
 from Products.AdvancedQuery import Eq, Between, Le,In
+
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+logger.info('%s starts getPaymentStatistics' % (member))
+if str(member) not in ('admin','joachim','isouaba','hetomi'):
+    return
+
 pins = context.portal_pins
 aq_pins = context.portal_pins.evalAdvancedQuery
@@ -79,5 +83,5 @@
 fees['hostel'] = {'anz': len(ah),
                  'fee': 500,
-                 'title': 'Hostel Maintainance',
+                 'title': 'Hostel maintainance scratch cards',
                   'prefixes': hostel_pbs,
                  }
@@ -86,5 +90,5 @@
 fees['clearance'] = {'anz': len(ac),
                      'fee': 250,
-                     'title': 'Clearance',
+                     'title': 'Clearance scratch cards',
                      'prefixes': clearance_pbs,
                  }
@@ -93,7 +97,8 @@
 fees['application'] = {'anz' : len(aa),
                  'fee': 200,
-                 'title': 'Application',
+                 'title': 'Application scratch cards',
                   'prefixes': application_pbs,
                  }
+                 
 aso_query = Eq('portal_type','Payment') & Eq("SearchableText","approved")
 aso = aq_portal(aso_query)
@@ -103,43 +108,52 @@
 fees['schoolfee_onl'] = {'anz' : len(aso),
                  'fee': 1000,
-                 'title': 'Schoolfee (online)',
+                 'title': 'School fee Wema/Interswitch payments',
                   'prefixes': (),
                  }
-aspaysc_query = Eq('portal_type','Payment') &\
-                    Eq("SearchableText","payment") &\
-                    Eq("SearchableText","successful") &\
-                    ~ Eq("SearchableText","transfer")
 
-aspaysc = aq_portal(aspaysc_query)
+
+#aspaysc_query = Eq('portal_type','Payment') &\
+#                    Eq("SearchableText","payment") &\
+#                    Eq("SearchableText","successful") &\
+#                    ~ Eq("SearchableText","transfer")
+
+#aspaysc = aq_portal(aspaysc_query)
 #rwrite("*"*80)
 # for pp in aspaysc:
     # indexdata = portal.getIndexDataForRID(pp.getRID())
     # rwrite("%s %s %s" % (pp.id,pp.listCreators,indexdata['SearchableText']))
-fees['schoolfee_paysc'] = {'anz' : len(aspaysc),
-                 'fee': 1000,
-                 'title': 'Schoolfee (sc in payments)',
-                  'prefixes': (),
-                 }
-not_query = ~aso_query & ~aspaysc_query
-not_res = aq_portal(aspaysc_query)
-fees['schoolfee_not'] = {'anz' : len(not_res),
-                 'fee': 0,
-                 'title': 'Not Schoolfee',
-                  'prefixes': (),
-                 }
-anewschool = aq_pins(In('prefix_batch', newschoolfee_pbs) & missing_query)
-fees['newschoolfee_sc'] = {'anz' : len(anewschool),
-                 'fee': 1000,
-                 'title': 'Schoolfee (..NEW SC)',
-                  'prefixes': newschoolfee_pbs,
-                 }
+#fees['schoolfee_paysc'] = {'anz' : len(aspaysc),
+#                 'fee': 1000,
+#                 'title': 'Schoolfee (sc in payments)',
+#                  'prefixes': (),
+#                 }
+
+#not_query = ~aso_query & ~aspaysc_query
+#not_res = aq_portal(aspaysc_query)
+#fees['schoolfee_not'] = {'anz' : len(not_res),
+#                 'fee': 0,
+#                 'title': 'Not Schoolfee',
+#                  'prefixes': (),
+#                 }
+                 
+#anewschool = aq_pins(In('prefix_batch', newschoolfee_pbs) & missing_query)
+#fees['newschoolfee_sc'] = {'anz' : len(anewschool),
+#                 'fee': 1000,
+#                 'title': 'Schoolfee (..NEW SC)',
+#                  'prefixes': newschoolfee_pbs,
+#                 }
+
 #assc = [pin for pin in aq_pins(In('prefix_batch', schoolfee_pbs)) if pin.student]
 assc = aq_pins(In('prefix_batch', schoolfee_pbs) & missing_query)
 fees['schoolfee_scratch'] = {'anz' : len(assc),
-                 'fee': 0,
-                 'title': 'Schoolfee (Scratchcard counting)',
+                 'fee': 1000,
+                 'title': 'School fee scratch cards',
                   'prefixes': schoolfee_pbs,
                  }
-rwrite("Payed fees")
+
+current = DateTime.DateTime()
+rwrite("Portal Service Charges (of %s)" % current)
+rwrite('------------------------------------------------------------------')
+
 total = 0
 keys = fees.keys()
@@ -149,5 +163,6 @@
     t = fee['value'] = fee['anz'] * fee['fee']
     total += t
-    rwrite("%(title)s fees %(anz)d = %(value)d (%(fee)d N %(prefixes)s)" % fee)
+    rwrite("%(title)s: %(anz)d * %(fee)d Nairas = %(value)d Nairas"  % fee)                            #(Prefixes %(prefixes)s)" % fee)
 gt = float(total)/1000000
-rwrite("Total %10.2f Million N" % gt)
+rwrite("Total %10.2f Million Nairas" % gt)
+
