source: WAeUP_SRP/trunk/skins/waeup_utilities/checkApprovedAmount.py @ 11851

Last change on this file since 11851 was 3961, checked in by Henrik Bettermann, 16 years ago

Widgets.admitOneStudent: entry_session and session must start with '0'
fixSessionKey.py: fix students_catalog, won't be used, because we will import fresh student data with session and entry_session columns. Only 08 students are affected.

File size: 1.4 KB
Line 
1## Script (Python) "checkApprovedAmount"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: checkApprovedAmount.py 3132 2008-02-08 21:10:38Z henrik $
11"""
12"""
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18
19mtool = context.portal_membership
20member = mtool.getAuthenticatedMember()
21if str(member) not in ('admin'):
22    return
23
24import logging
25import DateTime
26logger = logging.getLogger('Skins.checkApprovedAmount')
27from Products.AdvancedQuery import Eq, Between, Le,In
28payments = context.payments_catalog()
29
30counter = 0
31for payment in payments:
32    if not payment.status == 'paid' and payment.type == 'online':
33        continue
34    try:
35        amount = int(payment.amount)
36        surcharge = int(payment.surcharge)
37        resp_approved_amount = int(payment.resp_approved_amount)
38    except:
39        logger.info('invalid literal: %s, %s, %s, %s, %s,%s' % (payment.student_id, payment.order_id, payment.amount, payment.resp_approved_amount, payment.surcharge, payment.resp_desc))
40        continue
41    if amount + surcharge == resp_approved_amount:
42        continue
43    counter +=1
44    logger.info('%s, %s, %s, %s, %s ,%s' % (payment.student_id, payment.order_id, payment.amount, payment.resp_approved_amount, payment.surcharge, payment.resp_desc))
45
46
47return 'finished!'
48
49
Note: See TracBrowser for help on using the repository browser.