- Timestamp:
- 10 Mar 2025, 16:40:53 (6 hours ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interfaces.py
r17900 r18034 112 112 # ) 113 113 114 registration_fresh_fee = schema.Float(115 title = _(u'Registration Fee (Fresh)'),116 default = 0.0,117 required = False,118 )119 120 registration_return_fee = schema.Float(121 title = _(u'Registration Fee (Returning)'),122 default = 0.0,123 required = False,124 )125 126 114 late_registration_fee = schema.Float( 127 115 title = _(u'Late Registration Fee'), … … 142 130 ) 143 131 144 develop_fee = schema.Float(145 title = _(u'Development Fee'),146 default = 0.0,147 required = False,148 )149 150 municipal_fresh_fee = schema.Float(151 title = _(u'Municipal Fee Fresh Students'),152 default = 0.0,153 required = False,154 )155 156 municipal_returning_fee = schema.Float(157 title = _(u'Municipal Fee Returning Students'),158 default = 0.0,159 required = False,160 )161 162 132 alumni_fee = schema.Float( 163 133 title = _(u'Alumni Fee'), … … 168 138 conv_fee = schema.Float( 169 139 title = _(u'Convocation Fee'), 170 default = 0.0,171 required = False,172 )173 174 matric_fee = schema.Float(175 title = _(u'Matriculation Fee'),176 default = 0.0,177 required = False,178 )179 180 waecneco_fee = schema.Float(181 title = _(u'WAEC & NECO Verification Fee'),182 default = 0.0,183 required = False,184 )185 186 jambver_fee = schema.Float(187 title = _(u'JAMB Verification Fee'),188 default = 0.0,189 required = False,190 )191 192 book_fee = schema.Float(193 title = _(u'Book Deposit'),194 default = 0.0,195 required = False,196 )197 198 parentsconsult_fee = schema.Float(199 title = _(u'Parents Consultative Forum (PCF) Fee'),200 140 default = 0.0, 201 141 required = False, … … 250 190 ) 251 191 192 pg_other_fee = schema.Float( 193 title = _(u'PG Other Charges'), 194 default = 0.0, 195 required = True, 196 ) 197 198 application_fee = schema.Float( 199 title = _(u'Application Fee'), 200 default = 0.0, 201 required = False, 202 ) 203 jupeb_form_fee = schema.Float( 204 title = _(u'JUPEB Form Fee'), 205 default = 0.0, 206 required = False, 207 ) 208 209 jupeb_acc_fee = schema.Float( 210 title = _(u'JUPEB Acceptance Fee'), 211 default = 0.0, 212 required = False, 213 ) 214 215 jupeb_sci_fee = schema.Float( 216 title = _(u'JUPEB Science Fee'), 217 default = 0.0, 218 required = False, 219 ) 220 221 jupeb_arts_fee = schema.Float( 222 title = _(u'JUPEB Arts Fee'), 223 default = 0.0, 224 required = False, 225 ) 226 227 jupeb_hostel_fee = schema.Float( 228 title = _(u'JUPEB Hostel Fee'), 229 default = 0.0, 230 required = False, 231 ) 232 233 jupeb_reg_fee = schema.Float( 234 title = _(u'JUPEB Administrative Fee'), 235 default = 0.0, 236 required = False, 237 ) 238 239 pg_application_fee = schema.Float( 240 title = _(u'PG Application Fee'), 241 default = 0.0, 242 required = False, 243 ) 244 245 # Sundry Fees 246 247 medical_screening_fee = schema.Float( 248 title = _(u'Medical Screening Fees'), 249 default = 0.0, 250 required = False, 251 ) 252 253 book_fee = schema.Float( 254 title = _(u'Book Deposit'), 255 default = 0.0, 256 required = False, 257 ) 258 259 parentsconsult_fee = schema.Float( 260 title = _(u'Parents Consultative Forum (PCF) Fee'), 261 default = 0.0, 262 required = False, 263 ) 264 265 health_insurance_fee = schema.Float( 266 title = _(u'Student Health Insurance Fee'), 267 default = 0.0, 268 required = False, 269 ) 270 271 develop_fee = schema.Float( 272 title = _(u'Development Fee'), 273 default = 0.0, 274 required = False, 275 ) 276 277 registration_fresh_fee = schema.Float( 278 title = _(u'Registration Fee (Fresh)'), 279 default = 0.0, 280 required = False, 281 ) 282 283 registration_return_fee = schema.Float( 284 title = _(u'Registration Fee (Returning)'), 285 default = 0.0, 286 required = False, 287 ) 288 289 municipal_fresh_fee = schema.Float( 290 title = _(u'Municipal Fee Fresh Students'), 291 default = 0.0, 292 required = False, 293 ) 294 295 municipal_returning_fee = schema.Float( 296 title = _(u'Municipal Fee Returning Students'), 297 default = 0.0, 298 required = False, 299 ) 300 301 matric_fee = schema.Float( 302 title = _(u'Matriculation Fee'), 303 default = 0.0, 304 required = False, 305 ) 306 307 waecneco_fee = schema.Float( 308 title = _(u'WAEC & NECO Verification Fee'), 309 default = 0.0, 310 required = False, 311 ) 312 313 jambver_fee = schema.Float( 314 title = _(u'JAMB Verification Fee'), 315 default = 0.0, 316 required = False, 317 ) 318 252 319 id_card_fee = schema.Float( 253 320 title = _(u'Student ID Card Fee'), … … 255 322 required = True, 256 323 ) 257 pg_other_fee = schema.Float( 258 title = _(u'PG Other Charges'), 259 default = 0.0, 260 required = True, 261 ) 262 263 application_fee = schema.Float( 264 title = _(u'Application Fee'), 265 default = 0.0, 266 required = False, 267 ) 268 jupeb_form_fee = schema.Float( 269 title = _(u'JUPEB Form Fee'), 270 default = 0.0, 271 required = False, 272 ) 273 274 jupeb_acc_fee = schema.Float( 275 title = _(u'JUPEB Acceptance Fee'), 276 default = 0.0, 277 required = False, 278 ) 279 280 jupeb_sci_fee = schema.Float( 281 title = _(u'JUPEB Science Fee'), 282 default = 0.0, 283 required = False, 284 ) 285 286 jupeb_arts_fee = schema.Float( 287 title = _(u'JUPEB Arts Fee'), 288 default = 0.0, 289 required = False, 290 ) 291 292 jupeb_hostel_fee = schema.Float( 293 title = _(u'JUPEB Hostel Fee'), 294 default = 0.0, 295 required = False, 296 ) 297 298 jupeb_reg_fee = schema.Float( 299 title = _(u'JUPEB Administrative Fee'), 300 default = 0.0, 301 required = False, 302 ) 303 304 pg_application_fee = schema.Float( 305 title = _(u'PG Application Fee'), 306 default = 0.0, 307 required = False, 308 ) 309 310 health_insurance_fee = schema.Float( 311 title = _(u'Student Health Insurance Fee'), 312 default = 0.0, 313 required = False, 314 ) 315 316 medical_screening_fee = schema.Float( 317 title = _(u'Medical Screening Fees'), 318 default = 0.0, 319 required = False, 320 ) 321 322 # CDL Portal Fess only 324 325 _fee = schema.Float( 326 title = u'', 327 default = 0.0, 328 required = False, 329 ) 330 331 332 # CDL Portal Fees only 323 333 324 334 medical_fee = schema.Float( … … 358 368 required = False, 359 369 ) 360 361 370 362 371 def getSessionString(): -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py
r17900 r18034 19 19 import hashlib 20 20 import grok 21 from waeup.kofa.students.interfaces import IStudentsUtils 22 from zope.component import getUtility 21 23 from kofacustom.nigeria.interswitch.browser import ( 22 24 module_activated, … … 52 54 HTTPS = True 53 55 56 BANK_ACCOUNTS = { 57 'access': ('1228744877', '117'), 58 'parentsconsult': ('1228747029', '117'), 59 'health_insurance': ('1228744884', '117'), 60 'municipal_returning': ('0040621193','31'), 61 'clearance': ('0040621193','31'), 62 'develop': ('0040621193','31'), 63 'medical_screening': ('1311220657','117'), 64 'conv': ('0040621193','31'), 65 'registration_fresh': ('0040621193','31'), 66 'science': ('0040621193','31'), 67 'id_card': ('0040621193','31'), 68 'alumni': ('1311974981','117'), 69 'lab_support': ('0040621193','31'), 70 'registration_return': ('0040621193','31'), 71 'book': ('1228744877','117'), 72 'waecneco': ('0040621193','31'), 73 'jambver': ('0040621193','31'), 74 'pg_other': ('0040621193','31'), 75 'municipal_fresh': ('0040621193','31'), 76 'matric': ('0040621193','31') 77 } 78 54 79 class CustomInterswitchPageStudent(InterswitchPageStudent): 55 80 """ View which sends a POST request to the Interswitch … … 65 90 66 91 def update(self): 92 student_utils = getUtility(IStudentsUtils) 67 93 if not module_activated( 68 94 self.context.student.current_session, self.context): … … 97 123 'schoolfee', 'schoolfee40', 'secondinstal'): 98 124 self.pay_item_id = '101' 99 elif self.context.p_category == 'book':100 self.pay_item_id = '103'101 elif self.context.p_category == 'parentsconsult':102 self.pay_item_id = '104'103 elif self.context.p_category in (104 'municipal_fresh', 'municipal_returning',105 'transcript_local', 'transcript_overseas', 'transcript'):106 self.pay_item_id = '105'107 125 else: 126 # we use the same item_id for all sundry payments 108 127 self.pay_item_id = '102' 109 128 if self.context.p_category in ( … … 143 162 144 163 # Overwrite above selection 145 if self.context.p_category == 'book': 146 xmldict['institution_acct'] = '1228744877' 147 xmldict['institution_bank_id'] = '117' 148 elif self.context.p_category == 'parentsconsult': 149 xmldict['institution_acct'] = '1228747029' 150 xmldict['institution_bank_id'] = '117' 151 elif self.context.p_category == 'health_insurance': 152 xmldict['institution_acct'] = '1228744884' 153 xmldict['institution_bank_id'] = '117' 164 sundry_acct = BANK_ACCOUNTS.get(self.context.p_category, None) 165 if sundry_acct is True: 166 xmldict['institution_acct'] = sundry_acct[0] 167 xmldict['institution_bank_id'] = sundry_acct[0] 154 168 155 169 if provider_amt == 0: … … 166 180 </item_details> 167 181 </payment_item_detail>""" % xmldict 182 183 # Overwrite xmltext above because we have to split required combi 184 if self.context.p_category == 'required_combi': 185 rp = student_utils._collect_required_payment_items(self.context.student) 186 academic_session = student_utils._getSessionConfiguration(self.context.p_session) 187 xmltext = """<payment_item_detail> 188 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> 189 <item_detail item_id="1" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />""" % xmldict 190 item_id = 2 191 for cat in rp: 192 fee_name = cat + '_fee' 193 item_name = cat 194 item_amt = 100 * getattr(academic_session, fee_name, 0.0) 195 if item_name.startswith('registration'): 196 item_amt -= 100 * provider_amt 197 bank_id = BANK_ACCOUNTS[cat][1] 198 acct_num = BANK_ACCOUNTS[cat][0] 199 xmltext += """ 200 <item_detail item_id="%s" item_name="%s" item_amt="%d" bank_id="%s" acct_num="%s" />""" % (item_id, item_name, item_amt, bank_id, acct_num) 201 item_id += 1 202 xmltext += """ 203 </item_details> 204 </payment_item_detail>""" % xmldict 205 168 206 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext 169 207 self.amount_auth = int(100 * self.context.amount_auth) -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/tests.py
r17900 r18034 89 89 self.browser.contents) 90 90 91 def test_interswitch_required_combi(self): 92 # Student is a fresh non-science student 93 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 94 self.browser.open(self.payments_path) 95 IWorkflowState(self.student).setState('cleared') 96 self.student.nationality = u'NG' 97 self.browser.open(self.payments_path + '/addop') 98 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 99 self.browser.getControl(name="form.p_option").value = ['first'] 100 self.browser.getControl("Create payment").click() 101 self.assertTrue('Make either single payments or make a' in self.browser.contents) 102 self.browser.getControl(name="form.p_category").value = ['required_combi'] 103 self.browser.getControl("Create payment").click() 104 self.assertTrue('Student Health Insurance undefined.' in self.browser.contents) 105 self.app['configuration']['2004'].registration_fresh_fee = 10000.0 106 self.app['configuration']['2004'].book_fee = 10000.0 107 self.app['configuration']['2004'].develop_fee = 10000.0 108 self.app['configuration']['2004'].parentsconsult_fee = 10000.0 109 self.app['configuration']['2004'].municipal_fresh_fee = 10000.0 110 self.app['configuration']['2004'].matric_fee = 10000.0 111 self.app['configuration']['2004'].waecneco_fee = 10000.0 112 self.app['configuration']['2004'].jambver_fee = 10000.0 113 self.app['configuration']['2004'].health_insurance_fee = 10000.0 114 self.app['configuration']['2004'].id_card_fee = 10000.0 115 self.app['configuration']['2004'].medical_screening_fee = 10000.0 116 self.browser.getControl(name="form.p_category").value = ['required_combi'] 117 self.browser.getControl("Create payment").click() 118 self.assertTrue('Payment created' in self.browser.contents) 119 self.browser.open(self.payments_path) 120 ctrl = self.browser.getControl(name='val_id') 121 self.value = ctrl.options[0] 122 self.browser.getLink(self.value).click() 123 self.assertTrue( 124 '<span>110000.0</span>' in self.browser.contents) 125 self.payment_url = self.browser.url 126 self.browser.getLink("Pay via Interswitch", index=0).click() 127 self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />' in 128 self.browser.contents) 129 self.assertEqual(self.student.current_mode, 'ug_ft') 130 # 250 gateway charge have been added 131 payment = self.student['payments'][self.value] 132 self.assertEqual(payment.amount_auth, 110250) 133 self.assertEqual(payment.net_amt, 110000) 134 print self.browser.contents 135 self.assertTrue( 136 '<input type="hidden" name="amount" value="11025000" />' in 137 self.browser.contents) 138 self.assertTrue( 139 'item_id="6" item_name="registration_fresh" item_amt="500000" bank_id="31" acct_num="0040621193"' in 140 self.browser.contents) 141 self.assertTrue( 142 'item_id="12" item_name="parentsconsult" item_amt="1000000" bank_id="117" acct_num="1228747029"' in 143 self.browser.contents) 144 91 145 def test_interswitch_form_ticket_expired(self): 92 146 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') -
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' -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py
r17900 r18034 161 161 'makeup_admin': 'Make-Up Registration Fee', 162 162 'id_card': 'Student ID Card', 163 #'required_combi': 'Required Combi Payment',163 'required_combi': 'Required Combi Payment', 164 164 'pg_other': 'PG Other Charges', 165 165 #'jupeb_form':'JUPEB Form Fee',
Note: See TracChangeset for help on using the changeset viewer.