1 | ## $Id: utils.py 14501 2017-02-03 17:34:51Z 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 | |
---|
21 | import string |
---|
22 | from kofacustom.nigeria.utils.utils import NigeriaKofaUtils |
---|
23 | |
---|
24 | class CustomKofaUtils(NigeriaKofaUtils): |
---|
25 | """A collection of methods subject to customization. |
---|
26 | """ |
---|
27 | |
---|
28 | PREFERRED_LANGUAGES_DICT = { |
---|
29 | } |
---|
30 | |
---|
31 | PAYMENT_CATEGORIES = { |
---|
32 | 'schoolfee': 'School Fee', |
---|
33 | 'schoolfee_1': 'School Fee Plus (1st instalment)', |
---|
34 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
35 | 'schoolfee_incl': 'School Fee Plus', |
---|
36 | 'clearance': 'Acceptance Fee', |
---|
37 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
38 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
39 | 'application': 'Application Fee', |
---|
40 | 'bed_allocation': 'Bed Allocation Fee', |
---|
41 | 'transfer': 'Transfer Fee', |
---|
42 | 'transcript_local': 'Local Transcript Fee', |
---|
43 | 'transcript_inter': 'International Transcript Fee', |
---|
44 | 'late_registration': 'Late Course Registration Fee', |
---|
45 | 'welfare': 'Student Welfare Assurance Fee', |
---|
46 | 'union': 'Student Union Dues', |
---|
47 | 'lapel': 'Lapel/File Fee', |
---|
48 | 'matric_gown': 'Matriculation Gown Fee', |
---|
49 | 'concessional': 'Concessional Fee', |
---|
50 | 'id_card': 'Student ID Card', |
---|
51 | 'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112', |
---|
52 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
53 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
54 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
55 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
56 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
57 | 'gst_registration_2': 'Registration Fee GST222', |
---|
58 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
59 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
60 | 'restitution': 'Restitution Fee', |
---|
61 | } |
---|
62 | |
---|
63 | SELECTABLE_PAYMENT_CATEGORIES = { |
---|
64 | 'schoolfee': 'School Fee without additional fees', |
---|
65 | 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', |
---|
66 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
67 | 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', |
---|
68 | 'clearance': 'Acceptance Fee without additional fees', |
---|
69 | 'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee', |
---|
70 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
71 | #'application': 'Application Fee', |
---|
72 | #'bed_allocation': 'Bed Allocation Fee', |
---|
73 | #'transfer': 'Transfer Fee', |
---|
74 | 'transcript_local': 'Local Transcript Fee', |
---|
75 | 'transcript_inter': 'International Transcript Fee', |
---|
76 | 'late_registration': 'Late Course Registration Fee', |
---|
77 | #'welfare': 'Student Welfare Assurance Fee', |
---|
78 | #'union': 'Student Union Dues', |
---|
79 | #'lapel': 'Lapel/File Fee', |
---|
80 | #'matric_gown': 'Matriculation Gown Fee', |
---|
81 | 'concessional': 'Concessional Fee', |
---|
82 | #'id_card': 'Student ID Card', |
---|
83 | 'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112', |
---|
84 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
85 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
86 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
87 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
88 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
89 | 'gst_registration_2': 'Registration Fee GST222', |
---|
90 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
91 | #'fac_dep': 'Faculty and Departmental Dues', |
---|
92 | 'restitution': 'Restitution Fee', |
---|
93 | } |
---|
94 | |
---|
95 | REPORTABLE_PAYMENT_CATEGORIES = { |
---|
96 | 'schoolfee': 'School Fee', |
---|
97 | 'schoolfee_incl': 'School Fee Plus', |
---|
98 | 'schoolfee_1': 'School Fee 1 Plus', |
---|
99 | 'schoolfee_2': 'School Fee 2', |
---|
100 | 'clearance': 'Acceptance Fee', |
---|
101 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
102 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
103 | } |
---|
104 | |
---|
105 | BALANCE_PAYMENT_CATEGORIES = { |
---|
106 | 'schoolfee': 'School Fee', |
---|
107 | 'clearance': 'Acceptance Fee', |
---|
108 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
109 | 'late_registration': 'Late Course Registration Fee', |
---|
110 | 'welfare': 'Student Welfare Assurance Fee', |
---|
111 | 'union': 'Student Union Dues', |
---|
112 | 'lapel': 'Lapel/File Fee', |
---|
113 | 'matric_gown': 'Matriculation Gown Fee', |
---|
114 | 'id_card': 'Student ID Card', |
---|
115 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
116 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
117 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
118 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
119 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
120 | 'gst_registration_2': 'Registration Fee GST222', |
---|
121 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
122 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
123 | 'restitution': 'Restitution Fee', |
---|
124 | } |
---|
125 | |
---|
126 | APP_CATS_DICT = { |
---|
127 | 'basic': 'PUTME, PUDE, PCE, PRENCE', |
---|
128 | 'no': 'No Application', |
---|
129 | 'pg_ft': 'Postgraduate Full-Time', |
---|
130 | 'pg_pt': 'Postgraduate Part-Time', |
---|
131 | 'cest': 'Part-Time, Diploma, Certificate', |
---|
132 | 'found': 'Foundation', |
---|
133 | 'ptee': 'Part-Time Entrance Examination', |
---|
134 | 'ioe_dp': 'Institute of Education Diploma', |
---|
135 | 'ijmbe': 'IJMBE Preparation', |
---|
136 | } |
---|
137 | |
---|
138 | STUDY_MODES_DICT = { |
---|
139 | 'ug_ft': 'Undergraduate Full Time', |
---|
140 | 'ug_pt': 'Undergraduate Part Time', |
---|
141 | 'de_ft': 'Direct Entry Full Time', |
---|
142 | 'de_pt': 'Direct Entry Part Time', |
---|
143 | 'dp_pt': 'Diploma Part Time', |
---|
144 | 'dp_ft': 'Diploma Full Time', |
---|
145 | 'special_pg_ft': 'Postgraduate Full Time', |
---|
146 | 'special_pg_pt': 'Postgraduate Part Time', |
---|
147 | 'found': 'Foundation', |
---|
148 | 'transfer': 'Transfer', |
---|
149 | 'mug_ft': 'Undergraduate Full Time Merit List', |
---|
150 | 'mde_ft': 'Direct Entry Full Time Merit List', |
---|
151 | 'ijmbe': 'IJMBE Preparation', |
---|
152 | } |
---|
153 | |
---|
154 | VERDICTS_DICT = { |
---|
155 | '0': 'not yet', |
---|
156 | 'A': 'Successful student', |
---|
157 | 'B': 'Student with carryover courses', |
---|
158 | 'C': 'Student on probation', |
---|
159 | 'D': 'Withdrawn from the faculty', |
---|
160 | #'E': 'Student who were previously on probation', |
---|
161 | #'F': 'Medical case', |
---|
162 | #'G': 'Absent from examination', |
---|
163 | #'H': 'Withheld results', |
---|
164 | #'I': 'Expelled/rusticated/suspended student', |
---|
165 | #'J': 'Temporary withdrawn from the university', |
---|
166 | #'K': 'Unregistered student', |
---|
167 | #'L': 'Referred student', |
---|
168 | #'M': 'Reinstatement', |
---|
169 | #'N': 'Student on transfer', |
---|
170 | #'O': 'NCE-III repeater', |
---|
171 | #'Y': 'No previous verdict', |
---|
172 | #'X': 'New 300 level student', |
---|
173 | 'Z': 'Successful student (provisional)', |
---|
174 | #'A1': 'First Class', |
---|
175 | #'A2': 'Second Class Upper', |
---|
176 | #'A3': 'Second Class Lower', |
---|
177 | #'A4': 'Third Class', |
---|
178 | #'A5': 'Pass', |
---|
179 | #'A6': 'Distinction', |
---|
180 | #'A7': 'Credit', |
---|
181 | #'A8': 'Merit', |
---|
182 | 'NER': 'No evidence of registration', |
---|
183 | 'NYV': 'Not yet verified', |
---|
184 | 'FRNS': 'Faculty requirements not satisfied', |
---|
185 | } |
---|
186 | |
---|
187 | DISABLE_PAYMENT_GROUP_DICT = { |
---|
188 | 'sf_all': 'School Fee - All Students', |
---|
189 | 'sf_pg': 'School Fee - Postgraduate Students', |
---|
190 | 'sf_pt': 'School Fee - Part-Time Students', |
---|
191 | 'sf_found': 'School Fee - Foundation Students', |
---|
192 | 'maint_all': 'Accommodation Fee - All Students', |
---|
193 | 'cl_regular': 'Acceptance Fee - Regular Students', |
---|
194 | } |
---|
195 | |
---|
196 | MODE_GROUPS = { |
---|
197 | 'All': ('all',), |
---|
198 | 'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'), |
---|
199 | 'Undergraduate Part-Time': ('ug_pt', 'de_pt'), |
---|
200 | 'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'), |
---|
201 | 'Foundation Programme': ('found',), |
---|
202 | 'Institute of Education': ('dp_ft'), |
---|
203 | } |
---|
204 | |
---|
205 | def fullname(self, firstname, lastname, middlename=None): |
---|
206 | """Construct fullname. |
---|
207 | """ |
---|
208 | try: |
---|
209 | lastname = lastname.upper() |
---|
210 | except AttributeError: |
---|
211 | pass |
---|
212 | # We do not necessarily have the middlename attribute |
---|
213 | if middlename: |
---|
214 | givennames = '%s %s' % (firstname, middlename) |
---|
215 | else: |
---|
216 | givennames = '%s' % firstname |
---|
217 | givennames = string.capwords( |
---|
218 | givennames.replace('-', ' - ')).replace(' - ', '-') |
---|
219 | fullname = '%s, %s' % (lastname, givennames) |
---|
220 | if '<' in fullname: |
---|
221 | return 'XXX' |
---|
222 | return fullname |
---|