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

Last change on this file since 17664 was 17664, checked in by Henrik Bettermann, 10 months ago

Enable combo payments.

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