Ignore:
Timestamp:
18 Oct 2007, 16:37:24 (17 years ago)
Author:
joachim
Message:

count online payments + two counts for scratchcards (in custom)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_utilities/getPaymentStatistic.py

    r2366 r2386  
    2727pins = context.portal_pins
    2828aq_pins = context.portal_pins.evalAdvancedQuery
     29portal = context.portal_catalog_real
    2930aq_portal = context.portal_catalog_real.evalAdvancedQuery
    3031request = context.REQUEST
     
    3637    response.write("%s<br>\n\r" % s)
    3738
     39# aso = aq_portal(Eq('portal_type','Payment'))# & In("SearchableText",("approved","Approved")))
     40# #set_trace()
     41# count = 0
     42# for pp in aso:
     43#     count += 1
     44#     if count > 1000:
     45#         break
     46#     indexdata = portal.getIndexDataForRID(pp.getRID())
     47#     rwrite("%s %s %s" % (pp.id,pp.listCreators,indexdata['SearchableText']))
     48# return
    3849pbs = pins.uniqueValuesFor('prefix_batch')
    3950hostel_pbs = []
     
    4556
    4657schoolfee_pbs = list(pbs)[:]
    47 for pb in application_pbs + hostel_pbs + clearance_pbs:
     58for pb in application_pbs + hostel_pbs + clearance_pbs + ['HOS1','HOS2']:
    4859    schoolfee_pbs.remove(pb)
    4960fees = {}
     
    7081                  'prefixes': application_pbs,
    7182                 }
    72 aso = aq_portal(Eq('portal_type','Payment') & In("SearchableText",("successful",)))
     83aso = aq_portal(Eq('portal_type','Payment') & Eq("SearchableText","approved"))
     84# for pp in aso:
     85#     indexdata = portal.getIndexDataForRID(pp.getRID())
     86#     rwrite("%s %s %s" % (pp.id,pp.listCreators,indexdata['SearchableText']))
    7387fees['schoolfee_onl'] = {'anz' : len(aso),
    7488                 'fee': 1000,
     
    7690                  'prefixes': (),
    7791                 }
     92aspaysc = aq_portal(Eq('portal_type','Payment') &\
     93                    Eq("SearchableText","payment") &\
     94                    Eq("SearchableText","successful"))
     95rwrite("*"*80)
     96# for pp in aspaysc:
     97    # indexdata = portal.getIndexDataForRID(pp.getRID())
     98    # rwrite("%s %s %s" % (pp.id,pp.listCreators,indexdata['SearchableText']))
     99fees['schoolfee_paysc'] = {'anz' : len(aspaysc),
     100                 'fee': 1000,
     101                 'title': 'Schoolfee (sc in payments)',
     102                  'prefixes': (),
     103                 }
    78104#assc = [pin for pin in aq_pins(In('prefix_batch', schoolfee_pbs)) if pin.student]
    79105assc = aq_pins(In('prefix_batch', schoolfee_pbs) & missing_query)
    80106fees['schoolfee_scratch'] = {'anz' : len(assc),
    81                  'fee': 1000,
    82                  'title': 'Schoolfee (Scratchcard)',
     107                 'fee': 0,
     108                 'title': 'Schoolfee (Scratchcard counting)',
    83109                  'prefixes': schoolfee_pbs,
    84110                 }
Note: See TracChangeset for help on using the changeset viewer.