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

Last change on this file since 18273 was 18273, checked in by Henrik Bettermann, 5 months ago

Remove sundry payments from previous payments.

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