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

Last change on this file since 18330 was 18330, checked in by Henrik Bettermann, 3 months ago

Add sundry payment category.

  • Property svn:keywords set to Id
File size: 13.6 KB
Line 
1## $Id: utils.py 18330 2026-09-15 10:02:13Z 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': 'Total Sundry Charges',
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        'jupeb_idcard': 'JUPEB ID Card',
88        'jupeb_transp': 'JUPEB Transportation',
89        'jupeb_exam': 'JUPEB Examination Fee',
90        'jupeb_municipal': 'JUPEB Municipal',
91        'brought_fwd': 'Balance Brought Forward',
92        'health_insurance': 'Student Health Insurance',
93        'endowment': 'Endowment Fund',
94        # CDL Portal Fees only
95        'medical':'Medical Services',
96        'library':'Library',
97        'ict':'ICT Fees',
98        'orientation':'Orientation Fee',
99        'examination':'Examination Fee',
100        'medical_screening':'Medical Screening Fees',
101        'cdlcourse1': ' 1 Course',
102        'cdlcourse2': ' 2 Courses',
103        'cdlcourse3': ' 3 Courses',
104        'cdlcourse4': ' 4 Courses',
105        'cdlcourse5': ' 5 Courses',
106        'cdlcourse6': ' 6 Courses',
107        'cdlcourse7': ' 7 Courses',
108        'cdlcourse8': ' 8 Courses',
109        'cdlcourse9': ' 9 Courses',
110        'cdlcourse10': '10 Courses',
111        'cdlcourse11': '11 Courses',
112        'cdlcourse12': '12 Courses',
113        'cdlcourse13': '13 Courses',
114        'cdlcourse14': '14 Courses',
115        'cdlcourse15': '15 Courses',
116        }
117
118    SELECTABLE_PAYMENT_CATEGORIES = {
119        'schoolfee': 'Tuition Plus (total amount)',
120        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
121        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
122        'clearance': 'Acceptance Fee',
123        #'registration': 'Registration Fee',
124        #'bed_allocation': 'Bed Allocation Fee',
125        #'hostel_maintenance': 'Accommodation',
126        #'transfer': 'Transfer Fee',
127        #'gown': 'Gown Hire Fee',
128        #'app_balance': 'Application Fee Balance',
129        #'make_up': 'Make-up Fee',
130        'application': 'Application Fee',
131        'pg_application': 'PG Application Fee',
132        'transcript_local': 'Transcript Fee (Local Students)',
133        'transcript_overseas': 'Transcript Fee (Oversea Students)',
134        'late_registration': 'Late Registration Fee',
135        'clinical': 'Clinical Fee (Medical Students)',
136        'lo_ident': 'Letter of Identification Fee',
137        'change_course': 'Change of Course Fee',
138        'iuits': 'IUITS Fee',
139        'fine': 'Fine',
140        #'combi': 'Combi Payment',
141        #'resit1': '1 Make-Up Examination Course',
142        #'resit2': '2 Make-Up Examination Courses',
143        #'resit3': '3 Make-Up Examination Courses',
144        #'resit4': '4 Make-Up Examination Courses',
145        #'resit5': '5 Make-Up Examination Courses',
146        #'resit6': '6 Make-Up Examination Courses',
147        #'resit7': '7 Make-Up Examination Courses',
148        #'resit8': '8 Make-Up Examination Courses',
149        #'resit9': '9 Make-Up Examination Courses',
150        'makeup_admin': 'Make-Up Registration Fee',
151        'required_combi': 'Total Sundry Charges',
152        'pg_other': 'PG Other Charges',
153        #'jupeb_form':'JUPEB Form Fee',
154        #'jupeb_acc':'JUPEB Acceptance Fee',
155        #'jupeb_reg':'JUPEB Administrative Fee',
156        'jupeb_sci':'JUPEB Tuition (Science)',
157        'jupeb_arts':'JUPEB Tuition (Arts)',
158        'jupeb_hostel':'JUPEB Accommodation (optional)',
159        'jupeb_idcard': 'JUPEB ID Card',
160        'jupeb_transp': 'JUPEB Transportation',
161        'jupeb_exam': 'JUPEB Examination Fee',
162        'jupeb_municipal': 'JUPEB Municipal',
163
164        ## sundry: 'registration_fresh': 'Registration Fee (Fresh)',
165        ## sundry: 'registration_return': 'Registration Fee (Returning)',
166        ## sundry: 'grad_clearance': 'Clearance Fee',
167        ## sundry: 'science': 'Science Bench Fee',
168        ## sundry: 'medical_screening':'Medical Screening Fees',
169        ## sundry: 'municipal_fresh': 'Municipal Fee (Fresh Students)',
170        ## sundry: 'municipal_returning': 'Municipal Fee (Returning Students)',
171        ## sundry: 'alumni': 'Alumni Fee',
172        ## sundry: 'conv': 'Convocation Fee',
173        ## sundry: 'matric': 'Matriculation Fee',
174        ## sundry: 'waecneco': 'WAEC/NECO Verification',
175        ## sundry: 'jambver': 'JAMB Verification',
176        ## sundry: 'book': 'Book Deposit',
177        ## sundry: 'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
178        ## sundry: 'id_card': 'Student ID Card',
179        ## sundry: 'develop': 'Development Fee',
180        ## sundry: 'health_insurance': 'Student Health Insurance',
181        ## sundry: 'pharmlab': 'Pharmacy Lab Support Fee',
182        ## sundry: 'endowment': 'Endowment Fund',
183        }
184
185    CDLPORTAL_PAYMENT_CATEGORIES = {
186        'schoolfee': 'School Fees',
187        'clearance': 'Acceptance Fee',
188        'id_card': 'Student ID Card',
189        'waecneco': 'WAEC/NECO Verification',
190        # CDL Portal fees only
191        'medical':'Medical Services',
192        'library':'Library',
193        'ict':'ICT Fees',
194        'orientation':'Orientation Fee',
195        'examination':'Examination Fee',
196        'cdlcourse1': ' 1 Course',
197        'cdlcourse2': ' 2 Courses',
198        'cdlcourse3': ' 3 Courses',
199        'cdlcourse4': ' 4 Courses',
200        'cdlcourse5': ' 5 Courses',
201        'cdlcourse6': ' 6 Courses',
202        'cdlcourse7': ' 7 Courses',
203        'cdlcourse8': ' 8 Courses',
204        'cdlcourse9': ' 9 Courses',
205        'cdlcourse10': '10 Courses',
206        'cdlcourse11': '11 Courses',
207        'cdlcourse12': '12 Courses',
208        'cdlcourse13': '13 Courses',
209        'cdlcourse14': '14 Courses',
210        'cdlcourse15': '15 Courses',
211        'combi': 'Combi Payment',
212        }
213
214    def selectable_payment_categories(self, student):
215        if grok.getSite().__name__ == 'iuokada-cdl':
216            spc = deepcopy(self.CDLPORTAL_PAYMENT_CATEGORIES)
217            return spc
218        spc = deepcopy(self.SELECTABLE_PAYMENT_CATEGORIES)
219        if student.depcode == 'BMS':
220            del spc['schoolfee40']
221            del spc['secondinstal']
222        return spc
223
224    PREVIOUS_PAYMENT_CATEGORIES = {
225        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
226        'clearance': 'Acceptance Fee',
227        'application': 'Application Fee',
228        'late_registration': 'Late Registration Fee',
229        'clinical': 'Clinical Fee (Medical Students)',
230        'lo_ident': 'Letter of Identification Fee',
231        'change_course': 'Change of Course Fee',
232        'make_up': 'Make-up Fee',
233        'iuits': 'IUITS Fee',
234        'fine': 'Fine',
235        'pg_other': 'PG Other Charges',
236        'jupeb_sci':'JUPEB Tuition (Science)',
237        'jupeb_arts':'JUPEB Tuition (Arts)',
238        'jupeb_hostel':'JUPEB Accommodation (optional)',
239        'jupeb_idcard': 'JUPEB ID Card',
240        'jupeb_transp': 'JUPEB Transportation',
241        'jupeb_exam': 'JUPEB Examination Fee',
242        'jupeb_municipal': 'JUPEB Municipal',
243        }
244
245    @property
246    def COMBI_PAYMENT_CATEGORIES(self):
247        if grok.getSite().__name__ == 'iuokada-cdl':
248            return self.CDLPORTAL_COMBI_PAYMENT_CATEGORIES
249        return self._COMBI_PAYMENT_CATEGORIES
250
251    CDLPORTAL_COMBI_PAYMENT_CATEGORIES = {
252        'clearance': 'Acceptance Fee',
253        'id_card': 'Student ID Card',
254        'waecneco': 'WAEC/NECO Verification',
255        # CDL Portal fees only
256        'medical':'Medical Services',
257        'library':'Library',
258        'ict':'ICT Fees',
259        'orientation':'Orientation Fee',
260        'examination':'Examination Fee',
261        'cdlcourse1': ' 1 Course',
262        'cdlcourse2': ' 2 Courses',
263        'cdlcourse3': ' 3 Courses',
264        'cdlcourse4': ' 4 Courses',
265        'cdlcourse5': ' 5 Courses',
266        'cdlcourse6': ' 6 Courses',
267        'cdlcourse7': ' 7 Courses',
268        'cdlcourse8': ' 8 Courses',
269        'cdlcourse9': ' 9 Courses',
270        'cdlcourse10': '10 Courses',
271        'cdlcourse11': '11 Courses',
272        'cdlcourse12': '12 Courses',
273        'cdlcourse13': '13 Courses',
274        'cdlcourse14': '14 Courses',
275        'cdlcourse15': '15 Courses',
276        }
277
278    _COMBI_PAYMENT_CATEGORIES = {
279        #'registration': 'Registration Fee',
280        'clinical': 'Clinical Fee (Medical Students)',
281        'late_registration': 'Late Registration Fee',
282        'lo_ident': 'Letter of Identification Fee',
283        'change_course': 'Change of Course Fee',
284        'make_up': 'Make-up Fee',
285        'iuits': 'IUITS Fee',
286        'fine': 'Fine',
287        'pg_other': 'PG Other Charges',
288        'jupeb_form':'JUPEB Form Fee',
289        'jupeb_acc':'JUPEB Acceptance Fee',
290        'jupeb_reg':'JUPEB Administrative Fee',
291        'jupeb_sci':'JUPEB Tuition (Science)',
292        'jupeb_arts':'JUPEB Tuition (Arts)',
293        'jupeb_hostel':'JUPEB Accommodation (optional)',
294        'jupeb_idcard': 'JUPEB ID Card',
295        'jupeb_transp': 'JUPEB Transportation',
296        'jupeb_exam': 'JUPEB Examination Fee',
297        'jupeb_municipal': 'JUPEB Municipal',
298        }
299
300    BALANCE_PAYMENT_CATEGORIES = {
301        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
302        }
303
304    @property
305    def PAYMENT_OPTIONS(self):
306        if grok.getSite().__name__ == 'iuokada-cdl':
307            return dict()
308        return self._PAYMENT_OPTIONS
309
310    _PAYMENT_OPTIONS = {
311        'first': 'First Bank Debit Card',
312        'access': 'Access Bank Debit Card',
313        'zenith': 'Zenith Bank Debit Card',
314        'other': 'Other Bank Debit Card',
315        }
316
317    APP_CATS_DICT = {
318        'basic': 'UAS, PUTME, PUDE, PCE, PRENCE',
319        'no': 'No Application',
320        'pg': 'Postgraduate Programmes',
321        'pg2': 'Postgraduate Programmes 2',
322        'pgphd': 'Postgraduate PhD/MPhil',
323        'pre': 'Pre-Degree Studies',
324        'pt': 'Part-Time Degree Programmes',
325        'ut': 'Undergraduate Programmes',
326        'conv': 'HND to BSc Conversion',
327        'odl': 'Open & Distant Learning',
328        }
329
330    STUDY_MODES_DICT = {
331        'ug_ft': 'Undergraduate Full Time',
332        'ug_pt': 'Undergraduate Part Time',
333        'pg_ft': 'Postgraduate Full Time',
334        'pg_pt': 'Postgraduate Part Time',
335        'pgphd': 'Postgraduate PhD/MPhil',
336        'odl': 'Open & Distant Learning',
337        'found': 'Foundation',
338        'no': 'no application',
339        'transfer': 'Transfer',
340        'transferred': 'Transferred',
341        'de': 'Direct Entry',
342        'jupeb': 'JUPEB',
343        }
344
345    #: Maximum size in Bytes of passport images in the applicants and
346    #: students section
347    MAX_PASSPORT_SIZE = 250 * 1024
Note: See TracBrowser for help on using the repository browser.