Ignore:
Timestamp:
21 Jun 2023, 04:37:43 (17 months ago)
Author:
Henrik Bettermann
Message:

Add 2021 school fees.

File:
1 edited

Legend:

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

    r17431 r17444  
    3333
    3434schoolfees_path = os.path.join(
    35     os.path.dirname(__file__), 'schoolfees.csv')
     35    os.path.dirname(__file__), 'schoolfees_22.csv')
    3636reader = csv.DictReader(open(schoolfees_path, 'rb'))
    37 SCHOOLFEES = {item['code']:(item['tuition'], item.values()) for item in reader}
     37SCHOOLFEES_22 = {item['code']:(item['tuition'], item.values()) for item in reader}
     38
     39schoolfees_path = os.path.join(
     40    os.path.dirname(__file__), 'schoolfees_21.csv')
     41reader = csv.DictReader(open(schoolfees_path, 'rb'))
     42SCHOOLFEES_21 = {item['code']:(item['tuition'], item.values()) for item in reader}
     43
    3844acceptancefees_path = os.path.join(
    3945    os.path.dirname(__file__), 'acceptancefees.csv')
     
    356362                    return _("No additional fees required."), None
    357363            try:
    358                 acceptancefees_entry = ACCEPTANCEFEES[student.certcode]
     364                acceptancefees = ACCEPTANCEFEES[student.certcode]
    359365            except KeyError:
    360366                return _('Acceptance fees not yet fixed.'), None
    361367            if category == 'clearance_incl':
    362                 for item in acceptancefees_entry[1]:
     368                for item in acceptancefees[1]:
    363369                    try:
    364370                        amount += int(item)
     
    366372                        pass
    367373            else:
    368                 amount = float(acceptancefees_entry[0])
     374                amount = float(acceptancefees[0])
    369375        elif category == 'late_registration':
    370376            if student.is_postgrad:
     
    384390                return _('Study course data are incomplete.'), None
    385391            try:
    386                 schoolfees_entry = SCHOOLFEES[student.certcode]
     392                if student.entry_session < 2022:
     393                    schoolfees = SCHOOLFEES_21[student.certcode]
     394                else:
     395                    schoolfees = SCHOOLFEES_22[student.certcode]
    387396            except KeyError:
    388397                return _('School fees not yet fixed.'), None
     
    404413                             "to pay by instalments."), None
    405414            additional = 0.0
    406             for item in schoolfees_entry[1]:
     415            for item in schoolfees[1]:
    407416                try:
    408417                    additional += int(item)
    409418                except:
    410419                    pass
    411             amount = float(schoolfees_entry[0])
     420            amount = float(schoolfees[0])
    412421            additional -= amount
    413422            if previous_session:
Note: See TracChangeset for help on using the changeset viewer.