Changeset 7152


Ignore:
Timestamp:
20 Nov 2011, 10:26:54 (13 years ago)
Author:
Henrik Bettermann
Message:

get_school_fee is not part of IStudentsUtils.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.custom/trunk/src/waeup/custom/students/utils.py

    r7151 r7152  
    44from waeup.sirp.students.utils import StudentsUtils
    55from waeup.sirp.students.interfaces import IStudentsUtils
     6
     7def get_school_fee(student, surcharge):
     8    study_mode = student['studycourse'].certificate.study_mode
     9    entry_mode = student['studycourse'].entry_mode
     10    state = student.state
     11    #lga = student.lga
     12    lga = 'nothing'
     13    current_level = student['studycourse'].current_level
     14
     15    if study_mode.endswith('_ft'):
     16        # fresh
     17        if state == CLEARED:
     18            return 40000 - surcharge
     19        # returning
     20        elif state == RETURNING:
     21            return 20000 - surcharge
     22        else:
     23            return 0
     24    else:
     25        return 0
    626
    727class StudentsUtils(StudentsUtils):
     
    3858            d['surcharge_1'] = academic_session.surcharge_1
    3959            d['surcharge_2'] = academic_session.surcharge_2
    40             d['amount'] = self.getSchoolFee(student, d['surcharge_1'] + d['surcharge_2'])
     60            d['amount'] = get_school_fee(student, d['surcharge_1'] + d['surcharge_2'])
    4161            code = student['studycourse'].certificate.code
    4262            #session_string = academic_sessions_vocab.by_value[p_session + 1].title
     
    4666            d['error'] = u'Amount could not be determined.'
    4767        return d
    48 
    49     def getSchoolFee(self, student, surcharge):
    50         study_mode = student['studycourse'].certificate.study_mode
    51         entry_mode = student['studycourse'].entry_mode
    52         state = student.state
    53         #lga = student.lga
    54         lga = 'nothing'
    55         current_level = student['studycourse'].current_level
    56 
    57         if study_mode.endswith('_ft'):
    58             # fresh
    59             if state == CLEARED:
    60                 return 40000 - surcharge
    61             # returning
    62             elif state == RETURNING:
    63                 return 20000 - surcharge
    64             else:
    65                 return 0
    66         else:
    67             return 0
Note: See TracChangeset for help on using the changeset viewer.