Ignore:
Timestamp:
1 Sep 2012, 15:16:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Configure school fees. In FCEOkene we can't setup school fees in certificates.

File:
1 edited

Legend:

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

    r8953 r9143  
    2222from kofacustom.nigeria.students.utils import NigeriaStudentsUtils
    2323from waeup.kofa.accesscodes import create_accesscode
     24from waeup.kofa.interfaces import CLEARED, RETURNING
    2425from waeup.fceokene.interfaces import MessageFactory as _
    2526
     
    7374            amount = academic_session.maint_fee
    7475        elif category == 'clearance':
     76            amount = academic_session.clearance_fee
    7577            try:
    7678                p_item = student['studycourse'].certificate.code
    7779            except (AttributeError, TypeError):
    7880                return _('Study course data are incomplete.'), None
    79             if p_item in ('BEDCET', 'BIOEDCET', 'CHMEDCET', 'ISEDCET',
    80                 'MTHEDCET', 'PHYEDCET', 'ITECET', 'AGREDCET', 'HEEDCET'):
    81                 amount = 17250.0
    82             else:
    83                 amount = 34250.0
    8481        elif category == 'schoolfee':
    8582            try:
     
    8885            except (AttributeError, TypeError):
    8986                return _('Study course data are incomplete.'), None
    90             if student.state == CLEARED:
    91                 amount = getattr(certificate, 'school_fee_1', 0.0)
    92             elif student.state == RETURNING:
    93                 # In case of returning school fee payment the payment session
    94                 # and level contain the values of the session the student
    95                 # has paid for.
    96                 p_session, p_level = self.getReturningData(student)
    97                 amount = getattr(certificate, 'school_fee_2', 0.0)
    98             elif student.is_postgrad and student.state == PAID:
    99                 # Returning postgraduate students also pay for the next session
    100                 # but their level always remains the same.
    101                 p_session += 1
    102                 amount = getattr(certificate, 'school_fee_2', 0.0)
     87
     88            # Very special school fee configuration, should be moved to
     89            # a seperate file.
     90
     91            ARTS = ('CRS','ISS','HIS','MUS','ECO','GEO','POL','SOS','CCA','ECU',
     92                    'THA','GED','GSE','PES','SPC','ENG','FRE','ARB','HAU','IGB',
     93                    'YOR','NCRS','NISS','NHIS','NMUS','NECO','NGEO','NPOL',
     94                    'NCCA','NECU','NTHA','NGED','NGSE','NPES','NSPC','NENG',
     95                    'NFRE','NARB','NHAU','NIGB','NYOR','NSOS')
     96
     97            #PDE Students
     98            if student.current_mode == 'pd_ft':
     99                amount = 35000
     100            elif not student.current_mode.endswith('_sw'):
     101                # PRENCE
     102                if student.current_level == 10 and student.state == CLEARED:
     103                    if student.depcode in ARTS:
     104                        amount = 14900
     105                    else:
     106                        amount = 15400
     107                # NCE I fresh
     108                elif student.current_level == 100 and student.state == CLEARED:
     109                    if student.depcode in ARTS:
     110                        amount = 12020
     111                    else:
     112                        amount = 12495
     113                # NCE II
     114                elif student.current_level in (100, 110, 120) and \
     115                    student.state == RETURNING:
     116                    if student.depcode in ARTS:
     117                        amount = 11070
     118                    else:
     119                        amount = 11545
     120                # NCE III
     121                elif student.current_level in (200, 210, 220):
     122                    if student.depcode in ARTS:
     123                        amount = 11070
     124                    else:
     125                        amount = 11545
     126                # NCE III repeater
     127                elif student.current_level in (300, 310, 320) and \
     128                    student.current_verdict == 'O':
     129                    if student.depcode in ARTS:
     130                        amount = 6535
     131                    else:
     132                        amount = 6773
     133                # NCE III spillover
     134                elif student.current_level in (300, 310, 320) and \
     135                    student.current_verdict == 'B':
     136                    if student.depcode in ARTS:
     137                        amount = 9170
     138                    else:
     139                        amount = 9645
     140                # NCE III second spillover
     141                elif student.current_level in (400, 410, 420) and \
     142                    student.current_verdict == 'B':
     143                    if student.depcode in ARTS:
     144                        amount = 9170
     145                    else:
     146                        amount = 9645
     147            else:
     148                if student.current_level == 100 and student.state == CLEARED:
     149                    if student.depcode in ARTS:
     150                        amount = 21900
     151                    else:
     152                        amount = 22400
     153                # NCE II
     154                elif student.current_level in (100, 110, 120) and \
     155                    student.state == RETURNING:
     156                    if student.depcode in ARTS:
     157                        amount = 18400
     158                    else:
     159                        amount = 18900
     160                # NCE III
     161                elif student.current_level in (200, 210, 220):
     162                    if student.depcode in ARTS:
     163                        amount = 20400
     164                    else:
     165                        amount = 20900
     166                # NCE IV
     167                elif student.current_level in (300, 310, 320):
     168                    if student.depcode in ARTS:
     169                        amount = 18400
     170                    else:
     171                        amount = 18900
     172                # NCE V
     173                elif student.current_level in (400, 410, 420):
     174                    if student.depcode in ARTS:
     175                        amount = 18400
     176                    else:
     177                        amount = 18900
     178                # NCE V spillover
     179                elif student.current_level in (500, 510, 520) and \
     180                    student.current_verdict == 'B':
     181                    if student.depcode in ARTS:
     182                        amount = 16900
     183                    else:
     184                        amount = 17400
     185                # NCE V second spillover
     186                elif student.current_level in (600, 610, 620) and \
     187                    student.current_verdict == 'B':
     188                    if student.depcode in ARTS:
     189                        amount = 16900
     190                    else:
     191                        amount = 17400
     192
    103193        if amount in (0.0, None):
    104194            return _(u'Amount could not be determined.'), None
     
    117207        payment.p_session = p_session
    118208        payment.p_level = p_level
    119         payment.amount_auth = amount
     209        payment.amount_auth = float(amount)
    120210        return None, payment
    121211
Note: See TracChangeset for help on using the changeset viewer.