source: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py @ 18135

Last change on this file since 18135 was 18135, checked in by Henrik Bettermann, 15 hours ago

Minor modifications requested in #252

  • Property svn:keywords set to Id
File size: 14.9 KB
RevLine 
[10765]1## $Id: utils.py 18135 2025-07-21 15:18:07Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""Customize general helper utilities for Kofa.
19"""
[15645]20
[17661]21import grok
[15645]22from copy import deepcopy
[10765]23from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
24
25class CustomKofaUtils(NigeriaKofaUtils):
26    """A collection of methods subject to customization.
27    """
28
[15645]29    PAYMENT_CATEGORIES = {
[15663]30        'schoolfee': 'Tuition Plus (total amount)',
31        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
[15773]32        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
[15645]33        'clearance': 'Acceptance Fee',
[16212]34        'grad_clearance': 'Clearance Fee',
[15728]35        'registration': 'Registration Fee',
[17900]36        'registration_fresh': 'Registration Fee (Fresh)',
37        'registration_return': 'Registration Fee (Returning)',
[15661]38        #'bed_allocation': 'Bed Allocation Fee',
39        #'hostel_maintenance': 'Accommodation',
[15645]40        #'transfer': 'Transfer Fee',
41        #'gown': 'Gown Hire Fee',
42        'application': 'Application Fee',
[16747]43        'pg_application': 'PG Application Fee',
[15645]44        'app_balance': 'Application Fee Balance',
[16142]45        'transcript': 'Transcript Fee',
[15789]46        'transcript_local': 'Transcript Fee Local',
47        'transcript_overseas': 'Transcript Fee Oversea',
[15645]48        'late_registration': 'Late Registration Fee',
49        'science': 'Science Bench Fee',
50        'clinical': 'Clinical Fee (Medical Students)',
51        'develop': 'Development Fee',
[16223]52        'municipal_fresh': 'Municipal Fee (Fresh Students)',
53        'municipal_returning': 'Municipal Fee (Returning Students)',
[15645]54        'alumni': 'Alumni Fee',
55        'conv': 'Convocation Fee',
56        'matric': 'Matriculation Fee',
[16305]57        'waecneco': 'WAEC/NECO Verification',
[15645]58        'jambver': 'JAMB Verification',
59        'book': 'Book Deposit',
60        'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
61        'pharmlab': 'Pharmacy Lab Support Fee',
[15736]62        'lo_ident': 'Letter of Identification Fee',
63        'change_course': 'Change of Course Fee',
64        'make_up': 'Make-up Fee',
65        'iuits': 'IUITS Fee',
66        'fine': 'Fine',
[15686]67        'combi': 'Combi Payment',
[15937]68        'resit1': '1 Make-Up Examination Course',
69        'resit2': '2 Make-Up Examination Courses',
70        'resit3': '3 Make-Up Examination Courses',
71        'resit4': '4 Make-Up Examination Courses',
72        'resit5': '5 Make-Up Examination Courses',
[17661]73        'resit6': '6 Make-Up Examination Courses',
[15937]74        'resit7': '7 Make-Up Examination Courses',
75        'resit8': '8 Make-Up Examination Courses',
76        'resit9': '9 Make-Up Examination Courses',
[16575]77        'makeup_admin': 'Make-Up Registration Fee',
[16111]78        'id_card': 'Student ID Card',
[18135]79        'required_combi': 'Required Sundry Charges',
[16233]80        'pg_other': 'PG Other Charges',
[16395]81        'jupeb_form':'JUPEB Form Fee',
82        'jupeb_acc':'JUPEB Acceptance Fee',
[16585]83        'jupeb_reg':'JUPEB Administrative Fee',
[16687]84        'jupeb_sci':'JUPEB Tuition (Science)',
85        'jupeb_arts':'JUPEB Tuition (Arts)',
86        'jupeb_hostel':'JUPEB Accommodation (optional)',
[16630]87        'brought_fwd': 'Balance Brought Forward',
[17436]88        'health_insurance': 'Student Health Insurance',
[17661]89        # CDL Portal Fees only
90        'medical':'Medical Services',
91        'library':'Library',
92        'ict':'ICT Fees',
93        'orientation':'Orientation Fee',
94        'examination':'Examination Fee',
[17838]95        'medical_screening':'Medical Screening Fees',
[17661]96        'cdlcourse1': ' 1 Course',
97        'cdlcourse2': ' 2 Courses',
98        'cdlcourse3': ' 3 Courses',
99        'cdlcourse4': ' 4 Courses',
100        'cdlcourse5': ' 5 Courses',
101        'cdlcourse6': ' 6 Courses',
102        'cdlcourse7': ' 7 Courses',
103        'cdlcourse8': ' 8 Courses',
104        'cdlcourse9': ' 9 Courses',
105        'cdlcourse10': '10 Courses',
106        'cdlcourse11': '11 Courses',
107        'cdlcourse12': '12 Courses',
108        'cdlcourse13': '13 Courses',
109        'cdlcourse14': '14 Courses',
110        'cdlcourse15': '15 Courses',
[15645]111        }
112
113    SELECTABLE_PAYMENT_CATEGORIES = {
[16233]114        'schoolfee': 'Tuition Plus (total amount)',
115        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
116        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
[18133]117        'clearance': 'Acceptance Fee',
[17900]118        #'registration': 'Registration Fee',
[15645]119        #'bed_allocation': 'Bed Allocation Fee',
[15661]120        #'hostel_maintenance': 'Accommodation',
[15645]121        #'transfer': 'Transfer Fee',
122        #'gown': 'Gown Hire Fee',
[18133]123        #'app_balance': 'Application Fee Balance',
124        #'make_up': 'Make-up Fee',
[16394]125        'application': 'Application Fee',
[16747]126        'pg_application': 'PG Application Fee',
[15789]127        'transcript_local': 'Transcript Fee (Local Students)',
128        'transcript_overseas': 'Transcript Fee (Oversea Students)',
[15645]129        'late_registration': 'Late Registration Fee',
130        'clinical': 'Clinical Fee (Medical Students)',
[15736]131        'lo_ident': 'Letter of Identification Fee',
132        'change_course': 'Change of Course Fee',
133        'iuits': 'IUITS Fee',
134        'fine': 'Fine',
[18133]135        #'combi': 'Combi Payment',
[17502]136        #'resit1': '1 Make-Up Examination Course',
137        #'resit2': '2 Make-Up Examination Courses',
138        #'resit3': '3 Make-Up Examination Courses',
139        #'resit4': '4 Make-Up Examination Courses',
140        #'resit5': '5 Make-Up Examination Courses',
[17661]141        #'resit6': '6 Make-Up Examination Courses',
[17502]142        #'resit7': '7 Make-Up Examination Courses',
143        #'resit8': '8 Make-Up Examination Courses',
144        #'resit9': '9 Make-Up Examination Courses',
[16575]145        'makeup_admin': 'Make-Up Registration Fee',
[18135]146        'required_combi': 'Required Sundry Charges',
[16233]147        'pg_other': 'PG Other Charges',
[16687]148        #'jupeb_form':'JUPEB Form Fee',
149        #'jupeb_acc':'JUPEB Acceptance Fee',
150        #'jupeb_reg':'JUPEB Administrative Fee',
151        'jupeb_sci':'JUPEB Tuition (Science)',
152        'jupeb_arts':'JUPEB Tuition (Arts)',
153        'jupeb_hostel':'JUPEB Accommodation (optional)',
[18133]154
155        ## sundry: 'registration_fresh': 'Registration Fee (Fresh)',
156        ## sundry: 'registration_return': 'Registration Fee (Returning)',
157        ## sundry: 'grad_clearance': 'Clearance Fee',
158        ## sundry: 'science': 'Science Bench Fee',
159        ## sundry: 'medical_screening':'Medical Screening Fees',
160        ## sundry: 'municipal_fresh': 'Municipal Fee (Fresh Students)',
161        ## sundry: 'municipal_returning': 'Municipal Fee (Returning Students)',
162        ## sundry: 'alumni': 'Alumni Fee',
163        ## sundry: 'conv': 'Convocation Fee',
164        ## sundry: 'matric': 'Matriculation Fee',
165        ## sundry: 'waecneco': 'WAEC/NECO Verification',
166        ## sundry: 'jambver': 'JAMB Verification',
167        ## sundry: 'book': 'Book Deposit',
168        ## sundry: 'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
169        ## sundry: 'id_card': 'Student ID Card',
170        ## sundry: 'develop': 'Development Fee',
171        ## sundry: 'health_insurance': 'Student Health Insurance',
[18135]172        ## sundry: 'pharmlab': 'Pharmacy Lab Support Fee',
[15645]173        }
174
[17661]175    CDLPORTAL_PAYMENT_CATEGORIES = {
[17672]176        'schoolfee': 'School Fees',
[17661]177        'clearance': 'Acceptance Fee',
178        'id_card': 'Student ID Card',
179        'waecneco': 'WAEC/NECO Verification',
180        # CDL Portal fees only
181        'medical':'Medical Services',
182        'library':'Library',
183        'ict':'ICT Fees',
184        'orientation':'Orientation Fee',
185        'examination':'Examination Fee',
186        'cdlcourse1': ' 1 Course',
187        'cdlcourse2': ' 2 Courses',
188        'cdlcourse3': ' 3 Courses',
189        'cdlcourse4': ' 4 Courses',
190        'cdlcourse5': ' 5 Courses',
191        'cdlcourse6': ' 6 Courses',
192        'cdlcourse7': ' 7 Courses',
193        'cdlcourse8': ' 8 Courses',
194        'cdlcourse9': ' 9 Courses',
195        'cdlcourse10': '10 Courses',
196        'cdlcourse11': '11 Courses',
197        'cdlcourse12': '12 Courses',
198        'cdlcourse13': '13 Courses',
199        'cdlcourse14': '14 Courses',
200        'cdlcourse15': '15 Courses',
[17800]201        'combi': 'Combi Payment',
[17661]202        }
203
[16576]204    def selectable_payment_categories(self, student):
[17661]205        if grok.getSite().__name__ == 'iuokada-cdl':
206            spc = deepcopy(self.CDLPORTAL_PAYMENT_CATEGORIES)
207            return spc
[17126]208        spc = deepcopy(self.SELECTABLE_PAYMENT_CATEGORIES)
209        if student.depcode == 'BMS':
210            del spc['schoolfee40']
211            del spc['secondinstal']
212        return spc
[16576]213
[15661]214    PREVIOUS_PAYMENT_CATEGORIES = {
[16233]215        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
[17900]216        #'registration': 'Registration Fee',
217        'registration_fresh': 'Registration Fee (Fresh)',
218        'registration_return': 'Registration Fee (Returning)',
[16208]219        'clearance': 'Acceptance Fee',
[16212]220        'grad_clearance': 'Clearance Fee',
[15661]221        'application': 'Application Fee',
222        'late_registration': 'Late Registration Fee',
223        'science': 'Science Bench Fee',
224        'clinical': 'Clinical Fee (Medical Students)',
[17838]225        'medical_screening':'Medical Screening Fees',
[15661]226        'develop': 'Development Fee',
[15789]227        'municipal_fresh': 'Municipal Fee (Fresh Students)',
228        'municipal_returning': 'Municipal Fee (Returning Students)',
[15661]229        'alumni': 'Alumni Fee',
230        'conv': 'Convocation Fee',
231        'matric': 'Matriculation Fee',
[16305]232        'waecneco': 'WAEC/NECO Verification',
[15661]233        'jambver': 'JAMB Verification',
234        'book': 'Book Deposit',
235        'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
236        'pharmlab': 'Pharmacy Lab Support Fee',
[15736]237        'lo_ident': 'Letter of Identification Fee',
238        'change_course': 'Change of Course Fee',
239        'make_up': 'Make-up Fee',
240        'iuits': 'IUITS Fee',
241        'fine': 'Fine',
[16111]242        'id_card': 'Student ID Card',
[18135]243        #'required_combi': 'Required Sundry Charges',
[16233]244        'pg_other': 'PG Other Charges',
[16687]245        #'jupeb_form':'JUPEB Form Fee',
246        #'jupeb_acc':'JUPEB Acceptance Fee',
247        #'jupeb_reg':'JUPEB Administrative Fee',
248        'jupeb_sci':'JUPEB Tuition (Science)',
249        'jupeb_arts':'JUPEB Tuition (Arts)',
250        'jupeb_hostel':'JUPEB Accommodation (optional)',
[17482]251        'health_insurance': 'Student Health Insurance',
[15675]252        }
253
[17664]254    @property
255    def COMBI_PAYMENT_CATEGORIES(self):
256        if grok.getSite().__name__ == 'iuokada-cdl':
[17665]257            return self.CDLPORTAL_COMBI_PAYMENT_CATEGORIES
258        return self._COMBI_PAYMENT_CATEGORIES
[17664]259
260    CDLPORTAL_COMBI_PAYMENT_CATEGORIES = {
261        'clearance': 'Acceptance Fee',
262        'id_card': 'Student ID Card',
263        'waecneco': 'WAEC/NECO Verification',
264        # CDL Portal fees only
265        'medical':'Medical Services',
266        'library':'Library',
267        'ict':'ICT Fees',
268        'orientation':'Orientation Fee',
269        'examination':'Examination Fee',
270        'cdlcourse1': ' 1 Course',
271        'cdlcourse2': ' 2 Courses',
272        'cdlcourse3': ' 3 Courses',
273        'cdlcourse4': ' 4 Courses',
274        'cdlcourse5': ' 5 Courses',
275        'cdlcourse6': ' 6 Courses',
276        'cdlcourse7': ' 7 Courses',
277        'cdlcourse8': ' 8 Courses',
278        'cdlcourse9': ' 9 Courses',
279        'cdlcourse10': '10 Courses',
280        'cdlcourse11': '11 Courses',
281        'cdlcourse12': '12 Courses',
282        'cdlcourse13': '13 Courses',
283        'cdlcourse14': '14 Courses',
284        'cdlcourse15': '15 Courses',
285        }
286
287    _COMBI_PAYMENT_CATEGORIES = {
[17900]288        #'registration': 'Registration Fee',
[18131]289        ## sundry: 'registration_fresh': 'Registration Fee (Fresh)',
290        ## sundry: 'registration_return': 'Registration Fee (Returning)',
291        ## sundry: 'grad_clearance': 'Clearance Fee',
292        ## sundry: 'science': 'Science Bench Fee',
293        ## sundry: 'medical_screening':'Medical Screening Fees',
294        ## sundry: 'municipal_fresh': 'Municipal Fee (Fresh Students)',
295        ## sundry: 'municipal_returning': 'Municipal Fee (Returning Students)',
296        ## sundry: 'alumni': 'Alumni Fee',
297        ## sundry: 'conv': 'Convocation Fee',
298        ## sundry: 'matric': 'Matriculation Fee',
299        ## sundry: 'waecneco': 'WAEC/NECO Verification',
300        ## sundry: 'jambver': 'JAMB Verification',
301        ## sundry: 'book': 'Book Deposit',
302        ## sundry: 'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
303        ## sundry: 'id_card': 'Student ID Card',
304        ## sundry: 'develop': 'Development Fee',
305        ## sundry: 'health_insurance': 'Student Health Insurance',
[18135]306        ## sundry: 'pharmlab': 'Pharmacy Lab Support Fee',
[18131]307        'clinical': 'Clinical Fee (Medical Students)',
[15675]308        'late_registration': 'Late Registration Fee',
[15736]309        'lo_ident': 'Letter of Identification Fee',
310        'change_course': 'Change of Course Fee',
311        'make_up': 'Make-up Fee',
312        'iuits': 'IUITS Fee',
313        'fine': 'Fine',
[16233]314        'pg_other': 'PG Other Charges',
[17767]315        'jupeb_form':'JUPEB Form Fee',
316        'jupeb_acc':'JUPEB Acceptance Fee',
317        'jupeb_reg':'JUPEB Administrative Fee',
[16687]318        'jupeb_sci':'JUPEB Tuition (Science)',
319        'jupeb_arts':'JUPEB Tuition (Arts)',
320        'jupeb_hostel':'JUPEB Accommodation (optional)',
[15738]321        }
322
[16015]323    BALANCE_PAYMENT_CATEGORIES = {
[16233]324        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
[16015]325        }
326
[17665]327    @property
328    def PAYMENT_OPTIONS(self):
329        if grok.getSite().__name__ == 'iuokada-cdl':
330            return dict()
331        return self._PAYMENT_OPTIONS
332
333    _PAYMENT_OPTIONS = {
[16434]334        'first': 'First Bank Debit Card',
335        'access': 'Access Bank Debit Card',
336        'zenith': 'Zenith Bank Debit Card',
337        'other': 'Other Bank Debit Card',
338        }
339
[15738]340    APP_CATS_DICT = {
341        'basic': 'UAS, PUTME, PUDE, PCE, PRENCE',
342        'no': 'No Application',
[15858]343        'pg': 'Postgraduate Programmes',
[16092]344        'pg2': 'Postgraduate Programmes 2',
[16497]345        'pgphd': 'Postgraduate PhD/MPhil',
[15738]346        'pre': 'Pre-Degree Studies',
[15809]347        'pt': 'Part-Time Degree Programmes',
[15858]348        'ut': 'Undergraduate Programmes',
[16619]349        'conv': 'HND to BSc Conversion',
[17651]350        'odl': 'Open & Distant Learning',
[15738]351        }
[15877]352
[17651]353    STUDY_MODES_DICT = {
354        'ug_ft': 'Undergraduate Full Time',
355        'ug_pt': 'Undergraduate Part Time',
356        'pg_ft': 'Postgraduate Full Time',
357        'pg_pt': 'Postgraduate Part Time',
358        'pgphd': 'Postgraduate PhD/MPhil',
359        'odl': 'Open & Distant Learning',
360        'found': 'Foundation',
361        'no': 'no application',
[17767]362        'transfer': 'Transfer',
[17770]363        'transferred': 'Transferred',
[17767]364        'de': 'Direct Entry',
365        'jupeb': 'JUPEB',
[17651]366        }
367
[15877]368    #: Maximum size in Bytes of passport images in the applicants and
369    #: students section
[16048]370    MAX_PASSPORT_SIZE = 250 * 1024
Note: See TracBrowser for help on using the repository browser.