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

Last change on this file since 18133 was 18133, checked in by Henrik Bettermann, 6 hours ago

Rename ‚Required Combi Payment‘, fix test.

  • Property svn:keywords set to Id
File size: 14.9 KB
Line 
1## $Id: utils.py 18133 2025-07-19 21:46:02Z 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"""
20
21import grok
22from copy import deepcopy
23from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
24
25class CustomKofaUtils(NigeriaKofaUtils):
26    """A collection of methods subject to customization.
27    """
28
29    PAYMENT_CATEGORIES = {
30        'schoolfee': 'Tuition Plus (total amount)',
31        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
32        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
33        'clearance': 'Acceptance Fee',
34        'grad_clearance': 'Clearance Fee',
35        'registration': 'Registration Fee',
36        'registration_fresh': 'Registration Fee (Fresh)',
37        'registration_return': 'Registration Fee (Returning)',
38        #'bed_allocation': 'Bed Allocation Fee',
39        #'hostel_maintenance': 'Accommodation',
40        #'transfer': 'Transfer Fee',
41        #'gown': 'Gown Hire Fee',
42        'application': 'Application Fee',
43        'pg_application': 'PG Application Fee',
44        'app_balance': 'Application Fee Balance',
45        'transcript': 'Transcript Fee',
46        'transcript_local': 'Transcript Fee Local',
47        'transcript_overseas': 'Transcript Fee Oversea',
48        'late_registration': 'Late Registration Fee',
49        'science': 'Science Bench Fee',
50        'clinical': 'Clinical Fee (Medical Students)',
51        'develop': 'Development Fee',
52        'municipal_fresh': 'Municipal Fee (Fresh Students)',
53        'municipal_returning': 'Municipal Fee (Returning Students)',
54        'alumni': 'Alumni Fee',
55        'conv': 'Convocation Fee',
56        'matric': 'Matriculation Fee',
57        'waecneco': 'WAEC/NECO Verification',
58        'jambver': 'JAMB Verification',
59        'book': 'Book Deposit',
60        'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
61        'pharmlab': 'Pharmacy Lab Support Fee',
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',
67        'combi': 'Combi Payment',
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',
73        'resit6': '6 Make-Up Examination Courses',
74        'resit7': '7 Make-Up Examination Courses',
75        'resit8': '8 Make-Up Examination Courses',
76        'resit9': '9 Make-Up Examination Courses',
77        'makeup_admin': 'Make-Up Registration Fee',
78        'id_card': 'Student ID Card',
79        'required_combi': 'Required Sundry Payment',
80        'pg_other': 'PG Other Charges',
81        'jupeb_form':'JUPEB Form Fee',
82        'jupeb_acc':'JUPEB Acceptance Fee',
83        'jupeb_reg':'JUPEB Administrative Fee',
84        'jupeb_sci':'JUPEB Tuition (Science)',
85        'jupeb_arts':'JUPEB Tuition (Arts)',
86        'jupeb_hostel':'JUPEB Accommodation (optional)',
87        'brought_fwd': 'Balance Brought Forward',
88        'health_insurance': 'Student Health Insurance',
89        # CDL Portal Fees only
90        'medical':'Medical Services',
91        'library':'Library',
92        'ict':'ICT Fees',
93        'orientation':'Orientation Fee',
94        'examination':'Examination Fee',
95        'medical_screening':'Medical Screening Fees',
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',
111        }
112
113    SELECTABLE_PAYMENT_CATEGORIES = {
114        'schoolfee': 'Tuition Plus (total amount)',
115        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
116        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
117        'clearance': 'Acceptance Fee',
118        #'registration': 'Registration Fee',
119        #'bed_allocation': 'Bed Allocation Fee',
120        #'hostel_maintenance': 'Accommodation',
121        #'transfer': 'Transfer Fee',
122        #'gown': 'Gown Hire Fee',
123        #'app_balance': 'Application Fee Balance',
124        #'make_up': 'Make-up Fee',
125        'application': 'Application Fee',
126        'pg_application': 'PG Application Fee',
127        'transcript_local': 'Transcript Fee (Local Students)',
128        'transcript_overseas': 'Transcript Fee (Oversea Students)',
129        'late_registration': 'Late Registration Fee',
130        'clinical': 'Clinical Fee (Medical Students)',
131        'pharmlab': 'Pharmacy Lab Support Fee',
132        'lo_ident': 'Letter of Identification Fee',
133        'change_course': 'Change of Course Fee',
134        'iuits': 'IUITS Fee',
135        'fine': 'Fine',
136        #'combi': 'Combi Payment',
137        #'resit1': '1 Make-Up Examination Course',
138        #'resit2': '2 Make-Up Examination Courses',
139        #'resit3': '3 Make-Up Examination Courses',
140        #'resit4': '4 Make-Up Examination Courses',
141        #'resit5': '5 Make-Up Examination Courses',
142        #'resit6': '6 Make-Up Examination Courses',
143        #'resit7': '7 Make-Up Examination Courses',
144        #'resit8': '8 Make-Up Examination Courses',
145        #'resit9': '9 Make-Up Examination Courses',
146        'makeup_admin': 'Make-Up Registration Fee',
147        'required_combi': 'Required Sundry Payment',
148        'pg_other': 'PG Other Charges',
149        #'jupeb_form':'JUPEB Form Fee',
150        #'jupeb_acc':'JUPEB Acceptance Fee',
151        #'jupeb_reg':'JUPEB Administrative Fee',
152        'jupeb_sci':'JUPEB Tuition (Science)',
153        'jupeb_arts':'JUPEB Tuition (Arts)',
154        'jupeb_hostel':'JUPEB Accommodation (optional)',
155
156        ## sundry: 'registration_fresh': 'Registration Fee (Fresh)',
157        ## sundry: 'registration_return': 'Registration Fee (Returning)',
158        ## sundry: 'grad_clearance': 'Clearance Fee',
159        ## sundry: 'science': 'Science Bench Fee',
160        ## sundry: 'medical_screening':'Medical Screening Fees',
161        ## sundry: 'municipal_fresh': 'Municipal Fee (Fresh Students)',
162        ## sundry: 'municipal_returning': 'Municipal Fee (Returning Students)',
163        ## sundry: 'alumni': 'Alumni Fee',
164        ## sundry: 'conv': 'Convocation Fee',
165        ## sundry: 'matric': 'Matriculation Fee',
166        ## sundry: 'waecneco': 'WAEC/NECO Verification',
167        ## sundry: 'jambver': 'JAMB Verification',
168        ## sundry: 'book': 'Book Deposit',
169        ## sundry: 'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
170        ## sundry: 'id_card': 'Student ID Card',
171        ## sundry: 'develop': 'Development Fee',
172        ## sundry: 'health_insurance': 'Student Health Insurance',
173        }
174
175    CDLPORTAL_PAYMENT_CATEGORIES = {
176        'schoolfee': 'School Fees',
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',
201        'combi': 'Combi Payment',
202        }
203
204    def selectable_payment_categories(self, student):
205        if grok.getSite().__name__ == 'iuokada-cdl':
206            spc = deepcopy(self.CDLPORTAL_PAYMENT_CATEGORIES)
207            return spc
208        spc = deepcopy(self.SELECTABLE_PAYMENT_CATEGORIES)
209        if student.depcode == 'BMS':
210            del spc['schoolfee40']
211            del spc['secondinstal']
212        return spc
213
214    PREVIOUS_PAYMENT_CATEGORIES = {
215        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
216        #'registration': 'Registration Fee',
217        'registration_fresh': 'Registration Fee (Fresh)',
218        'registration_return': 'Registration Fee (Returning)',
219        'clearance': 'Acceptance Fee',
220        'grad_clearance': 'Clearance Fee',
221        'application': 'Application Fee',
222        'late_registration': 'Late Registration Fee',
223        'science': 'Science Bench Fee',
224        'clinical': 'Clinical Fee (Medical Students)',
225        'medical_screening':'Medical Screening Fees',
226        'develop': 'Development Fee',
227        'municipal_fresh': 'Municipal Fee (Fresh Students)',
228        'municipal_returning': 'Municipal Fee (Returning Students)',
229        'alumni': 'Alumni Fee',
230        'conv': 'Convocation Fee',
231        'matric': 'Matriculation Fee',
232        'waecneco': 'WAEC/NECO Verification',
233        'jambver': 'JAMB Verification',
234        'book': 'Book Deposit',
235        'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
236        'pharmlab': 'Pharmacy Lab Support Fee',
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',
242        'id_card': 'Student ID Card',
243        #'required_combi': 'Required Sundry Payment',
244        'pg_other': 'PG Other Charges',
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)',
251        'health_insurance': 'Student Health Insurance',
252        }
253
254    @property
255    def COMBI_PAYMENT_CATEGORIES(self):
256        if grok.getSite().__name__ == 'iuokada-cdl':
257            return self.CDLPORTAL_COMBI_PAYMENT_CATEGORIES
258        return self._COMBI_PAYMENT_CATEGORIES
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 = {
288        #'registration': 'Registration Fee',
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',
306        'clinical': 'Clinical Fee (Medical Students)',
307        'late_registration': 'Late Registration Fee',
308        'pharmlab': 'Pharmacy Lab Support Fee',
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',
314        'pg_other': 'PG Other Charges',
315        'jupeb_form':'JUPEB Form Fee',
316        'jupeb_acc':'JUPEB Acceptance Fee',
317        'jupeb_reg':'JUPEB Administrative Fee',
318        'jupeb_sci':'JUPEB Tuition (Science)',
319        'jupeb_arts':'JUPEB Tuition (Arts)',
320        'jupeb_hostel':'JUPEB Accommodation (optional)',
321        }
322
323    BALANCE_PAYMENT_CATEGORIES = {
324        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
325        }
326
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 = {
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
340    APP_CATS_DICT = {
341        'basic': 'UAS, PUTME, PUDE, PCE, PRENCE',
342        'no': 'No Application',
343        'pg': 'Postgraduate Programmes',
344        'pg2': 'Postgraduate Programmes 2',
345        'pgphd': 'Postgraduate PhD/MPhil',
346        'pre': 'Pre-Degree Studies',
347        'pt': 'Part-Time Degree Programmes',
348        'ut': 'Undergraduate Programmes',
349        'conv': 'HND to BSc Conversion',
350        'odl': 'Open & Distant Learning',
351        }
352
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',
362        'transfer': 'Transfer',
363        'transferred': 'Transferred',
364        'de': 'Direct Entry',
365        'jupeb': 'JUPEB',
366        }
367
368    #: Maximum size in Bytes of passport images in the applicants and
369    #: students section
370    MAX_PASSPORT_SIZE = 250 * 1024
Note: See TracBrowser for help on using the repository browser.