source: WAeUP_SRP/trunk/skins/waeup_utilities/fixScratchCardPayments.py @ 11110

Last change on this file since 11110 was 1378, checked in by Henrik Bettermann, 18 years ago

remove 'transfer_' from type_code again

File size: 1.5 KB
RevLine 
[1372]1## Script (Python) "fixScratchCardPayments"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST
8##title=
9##
10# $Id: fixScratchCardPayments.py 1371 2007-01-28 21:36:52Z henrik $
11"""
[1373]12
[1372]13"""
14
15request = REQUEST
16wftool = context.portal_workflow
17mtool = context.portal_membership
18member = mtool.getAuthenticatedMember()
19roles = member.getRolesInContext(context)
20retcat = context.returning_import
21rcat = context.results_import
22scat = context.students_catalog
23from Products.AdvancedQuery import Eq, Between, Le,In
24aq_students = context.students_catalog.evalAdvancedQuery
25students = context.portal_url.getPortalObject().campus.students
26payments = context.portal_catalog(portal_type='Payment')
[1373]27
[1372]28list = []
29for brain in payments:
[1373]30    d = {}
[1378]31#    d['resp_code'] = "SC"
32#    d['resp_desc'] = "SC Payment Successful"
[1372]33    payment = brain.getObject()
34    pay_doc = payment.getContent()
[1378]35#    if pay_doc.type_description.startswith('School Fee'):
36#        d['type_description'] = 'School Fee for Session 2006/2007'
37#        pay_doc.edit(mapping=d)
38#        list.append('%s changed' % pay_doc.type_description)
39    if pay_doc.type_code.startswith('transfer'):
40#        d['type_description'] = 'Transfer Form for Session 2006/2007'
41        old = pay_doc.type_code
42        d['type_code'] = old.replace('transfer_','')
[1372]43        pay_doc.edit(mapping=d)
[1378]44        list.append('%s changed to %s' % (old,d['type_code']))
[1372]45return '\n'.join(list)
Note: See TracBrowser for help on using the repository browser.