from waeup.sirp.students.vocabularies import academic_sessions_vocab def getPaymentDetails(category, student): p_session = student['studycourse'].current_session surcharge_1 = surcharge_2 = surcharge_3 = 0 p_item = u'' if category == 'transfer': amount = 500 elif category == 'gown': amount = 500 elif category == 'hostel_maintenance': amount = 300 elif category == 'schoolfee': surcharge_1 = 1500 # BT amount surcharge_2 = 300 # Interswitch amount try: amount = getSchoolFee(student, surcharge_1 + surcharge_2) code = student['studycourse'].certificate.code except AttributeError: return 0, None, None, 0, 0, 0 #session_string = academic_sessions_vocab.by_value[p_session + 1].title p_item = code p_session += 1 return amount, p_item, p_session, surcharge_1, surcharge_2, surcharge_3 def getSchoolFee(student, surcharge): study_mode = student['studycourse'].certificate.study_mode entry_mode = student.entry_mode state = student.state #lga = student.lga lga = 'nothing' current_level = student['studycourse'].current_level CLEARED = 'cleared' if study_mode.endswith('_ft'): # fresh remedial if current_level == 0 and state == CLEARED: if entry_mode == 'rmd_ft': return 80200 - surcharge else: return 74200 - surcharge # fresh elif state == CLEARED: if study_mode == 'jm_ft': return 72700 - surcharge elif lga == 'foreigner': return 131500 - surcharge else: return 41500 - surcharge # returning elif state == 'returning': if study_mode == 'jm_ft': return 32500 - surcharge elif lga == 'foreigner': return 109500 - surcharge else: return 19500 - surcharge else: return 0 else: return 0