- Timestamp:
- 10 Mar 2025, 16:40:53 (8 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py
r17947 r18034 49 49 PORTRAIT_CHANGE_STATES = (ADMITTED, CLEARANCE,) 50 50 51 REQUIRED_PAYMENTS_FRESH = {51 REQUIRED_PAYMENTS_FRESH_SCIENCE = { 52 52 'registration_fresh': 'Registration Fee (Fresh)', 53 53 'book': 'Book Deposit', … … 55 55 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 56 56 'municipal_fresh': 'Fresh Students Municipal Fee', 57 } 58 57 'matric': 'Matriculation Fee', 58 'waecneco': 'WAEC/NECO Verification', 59 'jambver': 'JAMB Verification Fee', 60 'health_insurance': 'Student Health Insurance', 61 'id_card': 'I.D. Card', 62 'medical_screening': 'Medical Screening Fees', 63 'science': 'Science Bench Fee', 64 } 65 66 REQUIRED_PAYMENTS_FRESH_NON_SCIENCE = { 67 'registration_fresh': 'Registration Fee (Fresh)', 68 'book': 'Book Deposit', 69 'develop': 'Development Fee', 70 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 71 'municipal_fresh': 'Fresh Students Municipal Fee', 72 'matric': 'Matriculation Fee', 73 'waecneco': 'WAEC/NECO Verification', 74 'jambver': 'JAMB Verification Fee', 75 'health_insurance': 'Student Health Insurance', 76 'id_card': 'I.D. Card', 77 'medical_screening': 'Medical Screening Fees', 78 } 79 80 # all students (except PHM) returning 59 81 REQUIRED_PAYMENTS_RETURNING = { 60 82 'registration_return': 'Registration Fee (Returning)', … … 63 85 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 64 86 'municipal_returning': 'Returning Students Municipal Fee', 87 'health_insurance': 'Student Health Insurance', 88 } 89 90 91 # all stdents (except PHM) final year 92 REQUIRED_PAYMENTS_FINAL = { 93 'registration_return': 'Registration Fee (Returning)', 94 'book': 'Book Deposit', 95 'develop': 'Development Fee', 96 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 97 'municipal_returning': 'Returning Students Municipal Fee', 98 'health_insurance': 'Student Health Insurance', 99 'alumni': 'Alumni Fees', 100 'conv': 'Convocation Fees', 101 'clearance': 'Clearance Fees', 102 } 103 104 # PHM returning students 105 REQUIRED_PAYMENTS_RETURNING_PHARMACY = { 106 'registration_return': 'Registration Fee (Returning)', 107 'book': 'Book Deposit', 108 'develop': 'Development Fee', 109 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 110 'municipal_returning': 'Returning Students Municipal Fee', 111 'health_insurance': 'Student Health Insurance', 112 'lab_support': 'Lab Support', 113 } 114 115 # PHM students final year 116 REQUIRED_PAYMENTS_FINAL_PHARMACY = { 117 'registration_return': 'Registration Fee (Returning)', 118 'book': 'Book Deposit', 119 'develop': 'Development Fee', 120 'parentsconsult': 'Parents Consultative Forum (PCF) Fee', 121 'municipal_returning': 'Returning Students Municipal Fee', 122 'health_insurance': 'Student Health Insurance', 123 'alumni': 'Alumni Fees', 124 'conv': 'Convocation Fees', 125 'clearance': 'Clearance Fees', 126 'lab_support': 'Lab Support', 65 127 } 66 128 … … 87 149 return 88 150 89 def _requiredPaymentsMissing(self, student, session): 90 # Deactivated on 29/09/20 (don't know why) 91 return 92 151 def _is_payment_for_final(self, student): 152 studycourse = student['studycourse'] 153 certificate = getattr(studycourse,'certificate',None) 154 current_level = studycourse.current_level 155 if None in (current_level, certificate): 156 return False 157 end_level = certificate.end_level 158 if current_level >= end_level-100: 159 return True 160 return False 161 162 def _collect_required_payment_items(self, student): 93 163 if student.is_postgrad: 94 164 rp = self.REQUIRED_PAYMENTS_PG 165 elif student.is_fresh and student.faccode in ('ENG', 'HSC', 'NAS', 'PHM'): 166 rp = self.REQUIRED_PAYMENTS_FRESH_SCIENCE 95 167 elif student.is_fresh: 96 rp = self.REQUIRED_PAYMENTS_FRESH 168 rp = self.REQUIRED_PAYMENTS_FRESH_NON_SCIENCE 169 elif student.faccode == 'PHM' and self._is_payment_for_final(student): 170 rp = self.REQUIRED_PAYMENTS_FINAL_PHARMACY 171 elif student.faccode == 'PHM': 172 rp = self.REQUIRED_PAYMENTS_RETURNING_PHARMACY 173 elif self._is_payment_for_final(student): 174 rp = self.REQUIRED_PAYMENTS_FINAL 97 175 else: 98 rp = self.REQUIRED_PAYMENTS_RETURNING 176 rp = REQUIRED_PAYMENTS_RETURNING 177 return rp 178 179 def _requiredPaymentsMissing(self, student, session): 180 # Has the required combi payment been made? 99 181 for ticket in student['payments'].values(): 100 182 if ticket.p_category == 'required_combi'and \ … … 102 184 ticket.p_state == 'paid': 103 185 return 186 # If not, check single payments 187 rp = self._collect_required_payment_items(student) 104 188 cats_missing = deepcopy(rp) 105 189 if len(student['payments']): … … 114 198 return "%s must be paid before Tution Fee. Make either single payments or make a 'Required Combi Payment'." % ', '.join( 115 199 cats_missing.values()) 200 201 @property 202 def _all_required_payments(self): 203 return set( 204 self.REQUIRED_PAYMENTS_PG.keys() 205 + self.REQUIRED_PAYMENTS_FRESH_SCIENCE.keys() 206 + self.REQUIRED_PAYMENTS_FRESH_NON_SCIENCE.keys() 207 + self.REQUIRED_PAYMENTS_FINAL_PHARMACY.keys() 208 + self.REQUIRED_PAYMENTS_RETURNING_PHARMACY.keys() 209 + self.REQUIRED_PAYMENTS_FINAL.keys() 210 + self.REQUIRED_PAYMENTS_RETURNING.keys() 211 ) 116 212 117 213 def samePaymentMade(self, student, category, p_item, p_session): … … 158 254 p_level = student['studycourse'].current_level 159 255 p_current = True 160 if category in self.REQUIRED_PAYMENTS_FRESH.keys() \ 161 + self.REQUIRED_PAYMENTS_RETURNING.keys() \ 162 + ['schoolfee','schoolfee40','secondinstal'] \ 256 if category in list(self._all_required_payments) + ['required_combi',] \ 163 257 and student.state == RETURNING: 164 258 # In case of school fee or required sundry fee payments the … … 253 347 p_item += u'%s + ' % categories[cat] 254 348 p_item = p_item.strip(' + ') 349 255 350 elif category == 'required_combi': 256 if student.is_postgrad: 257 rp = self.REQUIRED_PAYMENTS_PG 258 elif student.is_fresh: 259 rp = self.REQUIRED_PAYMENTS_FRESH 260 else: 261 rp = self.REQUIRED_PAYMENTS_RETURNING 262 for cat in rp: 351 rp = self._collect_required_payment_items(student) 352 for cat in rp.keys(): 263 353 fee_name = cat + '_fee' 264 354 cat_amount = getattr(academic_session, fee_name, 0.0) … … 268 358 p_item += u'%s + ' % rp[cat] 269 359 p_item = p_item.strip(' + ') 360 270 361 else: 271 362 fee_name = category + '_fee'
Note: See TracChangeset for help on using the changeset viewer.