Changeset 17447
- Timestamp:
- 23 Jun 2023, 07:36:56 (17 months ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r17446 r17447 36 36 from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment 37 37 from waeup.aaue.applicants.interfaces import ICustomApplicantOnlinePayment 38 from waeup.aaue.students.utils import SFEECHANGES 38 39 from waeup.aaue.interfaces import MessageFactory as _ 39 40 … … 85 86 } 86 87 87 schoolfees_path = os.path.join( 88 os.path.dirname(__file__), '../students/schoolfees_22.csv') 89 reader = csv.DictReader(open(schoolfees_path, 'rb')) 90 SCHOOLFEES_22 = {item['code']:item for item in reader} 91 92 schoolfees_path = os.path.join( 93 os.path.dirname(__file__), '../students/schoolfees_21.csv') 94 reader = csv.DictReader(open(schoolfees_path, 'rb')) 95 SCHOOLFEES_21 = {item['code']:item for item in reader} 96 97 schoolfees_path = os.path.join( 98 os.path.dirname(__file__), '../students/schoolfees_20.csv') 99 reader = csv.DictReader(open(schoolfees_path, 'rb')) 100 SCHOOLFEES_20 = {item['code']:item for item in reader} 101 102 schoolfees_path = os.path.join( 103 os.path.dirname(__file__), '../students/schoolfees_19.csv') 104 reader = csv.DictReader(open(schoolfees_path, 'rb')) 105 SCHOOLFEES_19 = {item['code']:item for item in reader} 106 107 schoolfees_path = os.path.join( 108 os.path.dirname(__file__), '../students/schoolfees_14.csv') 109 reader = csv.DictReader(open(schoolfees_path, 'rb')) 110 SCHOOLFEES_14 = {item['code']:item for item in reader} 111 112 schoolfees_path = os.path.join( 113 os.path.dirname(__file__), '../students/schoolfees_13.csv') 114 reader = csv.DictReader(open(schoolfees_path, 'rb')) 115 SCHOOLFEES_13 = {item['code']:item for item in reader} 116 117 schoolfees_path = os.path.join( 118 os.path.dirname(__file__), '../students/schoolfees_12.csv') 119 reader = csv.DictReader(open(schoolfees_path, 'rb')) 120 SCHOOLFEES_12 = {item['code']:item for item in reader} 88 89 SCHOOLFEES = dict() 90 91 for year in SFEECHANGES: 92 schoolfees_path = os.path.join( 93 os.path.dirname(__file__), '../students/schoolfees_%s.csv' %year) 94 reader = csv.DictReader(open(schoolfees_path, 'rb')) 95 SCHOOLFEES[year] = {item['code']:item for item in reader} 121 96 122 97 acceptancefees_path = os.path.join( … … 290 265 291 266 if student.entry_session < 2013: 292 sorted_items = SCHOOLFEES_12[student.certcode].items() 293 elif student.entry_session < 2013: 294 sorted_items = SCHOOLFEES_19[student.certcode].items() 267 sorted_items = SCHOOLFEES[12][student.certcode].items() 295 268 elif student.entry_session < 2014: 296 sorted_items = SCHOOLFEES_19[student.certcode].items() 269 sorted_items = SCHOOLFEES[13][student.certcode].items() 270 elif student.entry_session < 2015: 271 sorted_items = SCHOOLFEES[14][student.certcode].items() 297 272 elif student.entry_session < 2020: 298 sorted_items = SCHOOLFEES _19[student.certcode].items()273 sorted_items = SCHOOLFEES[19][student.certcode].items() 299 274 elif student.entry_session < 2021: 300 sorted_items = SCHOOLFEES _20[student.certcode].items()275 sorted_items = SCHOOLFEES[20][student.certcode].items() 301 276 elif student.entry_session < 2022: 302 sorted_items = SCHOOLFEES _21[student.certcode].items()277 sorted_items = SCHOOLFEES[21][student.certcode].items() 303 278 else: 304 sorted_items = SCHOOLFEES _22[student.certcode].items()279 sorted_items = SCHOOLFEES[22][student.certcode].items() 305 280 sorted_items.insert(0, sorted_items.pop(4)) 306 281 for item in sorted_items: -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r17446 r17447 32 32 MINIMUM_UNITS_THRESHOLD = 15 33 33 34 schoolfees_path = os.path.join( 35 os.path.dirname(__file__), 'schoolfees_22.csv') 36 reader = csv.DictReader(open(schoolfees_path, 'rb')) 37 SCHOOLFEES_22 = {item['code']:(item['tuition'], item.values()) for item in reader} 38 39 schoolfees_path = os.path.join( 40 os.path.dirname(__file__), 'schoolfees_21.csv') 41 reader = csv.DictReader(open(schoolfees_path, 'rb')) 42 SCHOOLFEES_21 = {item['code']:(item['tuition'], item.values()) for item in reader} 43 44 schoolfees_path = os.path.join( 45 os.path.dirname(__file__), 'schoolfees_20.csv') 46 reader = csv.DictReader(open(schoolfees_path, 'rb')) 47 SCHOOLFEES_20 = {item['code']:(item['tuition'], item.values()) for item in reader} 48 49 schoolfees_path = os.path.join( 50 os.path.dirname(__file__), 'schoolfees_19.csv') 51 reader = csv.DictReader(open(schoolfees_path, 'rb')) 52 SCHOOLFEES_19 = {item['code']:(item['tuition'], item.values()) for item in reader} 53 54 schoolfees_path = os.path.join( 55 os.path.dirname(__file__), 'schoolfees_14.csv') 56 reader = csv.DictReader(open(schoolfees_path, 'rb')) 57 SCHOOLFEES_14 = {item['code']:(item['tuition'], item.values()) for item in reader} 58 59 schoolfees_path = os.path.join( 60 os.path.dirname(__file__), 'schoolfees_13.csv') 61 reader = csv.DictReader(open(schoolfees_path, 'rb')) 62 SCHOOLFEES_13 = {item['code']:(item['tuition'], item.values()) for item in reader} 63 64 schoolfees_path = os.path.join( 65 os.path.dirname(__file__), 'schoolfees_12.csv') 66 reader = csv.DictReader(open(schoolfees_path, 'rb')) 67 SCHOOLFEES_12 = {item['code']:(item['tuition'], item.values()) for item in reader} 34 SCHOOLFEES = dict() 35 SFEECHANGES = (12, 13, 14, 19, 20, 21, 22) 36 37 for year in SFEECHANGES: 38 schoolfees_path = os.path.join( 39 os.path.dirname(__file__), 'schoolfees_%s.csv' %year) 40 reader = csv.DictReader(open(schoolfees_path, 'rb')) 41 SCHOOLFEES[year] = {item['code']:(item['tuition'], item.values()) for item in reader} 68 42 69 43 acceptancefees_path = os.path.join( … … 416 390 try: 417 391 if student.entry_session < 2013: 418 schoolfees = SCHOOLFEES _12[student.certcode]392 schoolfees = SCHOOLFEES[12][student.certcode] 419 393 elif student.entry_session < 2014: 420 schoolfees = SCHOOLFEES _13[student.certcode]394 schoolfees = SCHOOLFEES[13][student.certcode] 421 395 elif student.entry_session < 2015: 422 schoolfees = SCHOOLFEES _14[student.certcode]396 schoolfees = SCHOOLFEES[14][student.certcode] 423 397 elif student.entry_session < 2020: 424 schoolfees = SCHOOLFEES _19[student.certcode]398 schoolfees = SCHOOLFEES[19][student.certcode] 425 399 elif student.entry_session < 2021: 426 schoolfees = SCHOOLFEES _20[student.certcode]400 schoolfees = SCHOOLFEES[20][student.certcode] 427 401 elif student.entry_session < 2022: 428 schoolfees = SCHOOLFEES _21[student.certcode]402 schoolfees = SCHOOLFEES[21][student.certcode] 429 403 else: 430 schoolfees = SCHOOLFEES _22[student.certcode]404 schoolfees = SCHOOLFEES[22][student.certcode] 431 405 except KeyError: 432 406 return _('School fees not yet fixed.'), None
Note: See TracChangeset for help on using the changeset viewer.