source: WAeUP_SRP/trunk/skins/waeup_uniben/getSchoolFee.py @ 16814

Last change on this file since 16814 was 8768, checked in by Henrik Bettermann, 12 years ago

Add 3000 Nairas in final year for gown.

  • Property svn:keywords set to Id
File size: 1.0 KB
RevLine 
[7901]1## Script (Python) "getSchoolFee"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=brain=None
8##title=
9##
10# $Id: getSchoolFee.py 8768 2012-06-20 13:17:52Z henrik $
11"""
12return SchoolFee
13"""
14
[8297]15#all_fees = context.uniben_school_fees()
[7901]16
17#import csv
18#from Globals import INSTANCE_HOME
[8297]19#fees_path = "%s/import/school_fees.csv" % (INSTANCE_HOME)
[7901]20#reader = csv.DictReader(open(fees_path, 'r'))
21#lst = [i for i in reader]
22#all_fees = dict([(i['payment_item'],i) for i in lst])
23
[8297]24wtool = context.waeup_tool
25try:
26    all_fees = wtool.getSchoolFees()
27except:
28    return None
[7901]29next_info = context.getNextInfo(brain)
30next_session_str = next_info['next_session_str']
[8279]31description = "School Fee for Session %s" % next_session_str
[7901]32
[8279]33d = {}
[7901]34
35if all_fees.has_key(brain.course):
36    d = all_fees[brain.course]
37    d['description'] = "%s (%s)" % (description,brain.course)
[8028]38else:
39    return None
[8768]40
[7901]41d['next_session_id'] = next_info['next_session_id']
[8768]42d['next_level_id'] = next_info['next_level_id']
[8279]43                                                   
[7901]44return d
45
[8279]46
47
Note: See TracBrowser for help on using the repository browser.