Changeset 17444 for main


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

Add 2021 school fees.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py

    r17442 r17444  
    8686
    8787schoolfees_path = os.path.join(
    88     os.path.dirname(__file__), '../students/schoolfees.csv')
     88    os.path.dirname(__file__), '../students/schoolfees_22.csv')
    8989reader = csv.DictReader(open(schoolfees_path, 'rb'))
    90 SCHOOLFEES = {item['code']:item for item in reader}
     90SCHOOLFEES_22 = {item['code']:item for item in reader}
     91
     92schoolfees_path = os.path.join(
     93    os.path.dirname(__file__), '../students/schoolfees_21.csv')
     94reader = csv.DictReader(open(schoolfees_path, 'rb'))
     95SCHOOLFEES_21 = {item['code']:item for item in reader}
    9196
    9297acceptancefees_path = os.path.join(
     
    258263<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">""" % xmldict
    259264                item_id = 1
    260                 sorted_items = SCHOOLFEES[student.certcode].items()
     265                if student.entry_session < 2022:
     266                    sorted_items = SCHOOLFEES_21[student.certcode].items()
     267                else:
     268                    sorted_items = SCHOOLFEES_22[student.certcode].items()
    261269                sorted_items.insert(0, sorted_items.pop(4))
    262270                for item in sorted_items:
  • 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.