## Script (Python) "getSchoolFee"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=brain=None
##title=
##
# $Id: getSchoolFee.py 2534 2007-11-05 06:37:12Z henrik $
"""
return SchoolFee
"""

late_registration_fee = 0

d = {}
d['lrf'] = late_registration_fee

if brain.mode.endswith('_ft'):
    # fresh remedial
    if str(brain.level) == '000' and brain.review_state == 'cleared_and_validated':
        if brain.entry_mode == 'rmd_ft':
            d['lrf'] = late_registration_fee
            d['all'] = 80200
        else:
            d['lrf'] = late_registration_fee
            d['all'] = 74200

    # fresh
    elif brain.review_state == 'cleared_and_validated':
        if brain.mode == 'jm_ft':
            d['lrf'] = late_registration_fee
            d['all'] = 72700
        elif brain.lga == 'foreigner':
            d['lrf'] = late_registration_fee
            d['all'] = 131500
        else:
            d['lrf'] = late_registration_fee
            d['all'] = 37000 # School Fee reduced by 8000
    # returning
    elif brain.review_state == 'returning':
        if brain.mode == 'jm_ft':
            d['lrf'] = late_registration_fee
            d['all'] = 37000
        elif brain.lga == 'foreigner':
            d['lrf'] = late_registration_fee
            d['all'] = 109500
        else:
            d['lrf'] = late_registration_fee
            d['all'] = 20000
    else:
        d['all'] = 0
else:
    d['all'] = 0


next_info = context.getNextInfo(brain)
next_session_str = next_info['next_session_str']
d['next_session_id'] = next_info['next_session_id']
d['description'] = "School Fee for Session %s" % next_session_str

return d

