source: main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py @ 15367

Last change on this file since 15367 was 15367, checked in by Henrik Bettermann, 5 years ago

Add shs study mode.

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