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

Last change on this file since 14246 was 14246, checked in by Henrik Bettermann, 8 years ago

Extend DISABLE_PAYMENT_GROUP_DICT.

  • Property svn:keywords set to Id
File size: 7.1 KB
Line 
1## $Id: utils.py 14246 2016-11-01 07:22:54Z 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    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': 'Transcript Fee',
43        'late_registration': 'Late Course Registration Fee',
44        'welfare': 'Student Welfare Assurance Fee',
45        'union': 'Student Union Dues',
46        'lapel': 'Lapel/File Fee',
47        'matric_gown': 'Matriculation Gown Fee',
48        'concessional': 'Concessional Fee',
49        'id_card': 'Student ID Card',
50        }
51
52    SELECTABLE_PAYMENT_CATEGORIES = {
53        'schoolfee': 'School Fee without additional fees',
54        'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee',
55        'schoolfee_2': 'School Fee (2nd instalment)',
56        'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee',
57        'clearance': 'Acceptance Fee without additional fees',
58        'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee',
59        'hostel_maintenance': 'Hostel Accommodation Fee',
60        #'application': 'Application Fee',
61        #'bed_allocation': 'Bed Allocation Fee',
62        #'transfer': 'Transfer Fee',
63        'transcript': 'Transcript Fee',
64        'late_registration': 'Late Course Registration Fee',
65        #'welfare': 'Student Welfare Assurance Fee',
66        #'union': 'Student Union Dues',
67        #'lapel': 'Lapel/File Fee',
68        #'matric_gown': 'Matriculation Gown Fee',
69        'concessional': 'Concessional Fee',
70        #'id_card': 'Student ID Card',
71        }
72
73    REPORTABLE_PAYMENT_CATEGORIES = {
74        'schoolfee': 'School Fee',
75        'schoolfee_incl': 'School Fee Plus',
76        'schoolfee_1': 'School Fee 1 Plus',
77        'schoolfee_2': 'School Fee 2',
78        'clearance': 'Acceptance Fee',
79        'clearance_incl': 'Acceptance Fee Plus',
80        'hostel_maintenance': 'Hostel Maintenance Fee',
81        }
82
83    BALANCE_PAYMENT_CATEGORIES = {
84        'schoolfee': 'School Fee',
85        'clearance': 'Acceptance Fee',
86        'hostel_maintenance': 'Hostel Maintenance Fee',
87        'late_registration': 'Late Course Registration Fee',
88        'welfare': 'Student Welfare Assurance Fee',
89        'union': 'Student Union Dues',
90        'lapel': 'Lapel/File Fee',
91        'matric_gown': 'Matriculation Gown Fee',
92        'id_card': 'Student ID Card',
93        }
94
95    APP_CATS_DICT = {
96        'basic': 'PUTME, PUDE, PCE, PRENCE',
97        'no': 'No Application',
98        'pg_ft': 'Postgraduate Full-Time',
99        'pg_pt': 'Postgraduate Part-Time',
100        'cest': 'Part-Time, Diploma, Certificate',
101        'found': 'Foundation',
102        'ptee': 'Part-Time Entrance Examination',
103        'ioe_dp': 'Institute of Education Diploma',
104        }
105
106    STUDY_MODES_DICT = {
107        'ug_ft': 'Undergraduate Full Time',
108        'ug_pt': 'Undergraduate Part Time',
109        'de_ft': 'Direct Entry Full Time',
110        'de_pt': 'Direct Entry Part Time',
111        'dp_pt': 'Diploma Part Time',
112        'dp_ft': 'Diploma Full Time',
113        'special_pg_ft': 'Postgraduate Full Time',
114        'special_pg_pt': 'Postgraduate Part Time',
115        'found': 'Foundation',
116        'transfer': 'Transfer',
117        'mug_ft': 'Undergraduate Full Time Merit List',
118        'mde_ft': 'Direct Entry Full Time Merit List',
119        }
120
121    VERDICTS_DICT = {
122        '0': 'not yet',
123        'A': 'Successful student',
124        'B': 'Student with carryover courses',
125        'C': 'Student on probation',
126        #'D': 'Withdrawn from the faculty',
127        #'E': 'Student who were previously on probation',
128        #'F': 'Medical case',
129        #'G': 'Absent from examination',
130        #'H': 'Withheld results',
131        #'I': 'Expelled/rusticated/suspended student',
132        #'J': 'Temporary withdrawn from the university',
133        #'K': 'Unregistered student',
134        #'L': 'Referred student',
135        #'M': 'Reinstatement',
136        #'N': 'Student on transfer',
137        #'O': 'NCE-III repeater',
138        #'Y': 'No previous verdict',
139        #'X': 'New 300 level student',
140        'Z': 'Successful student (provisional)',
141        #'A1': 'First Class',
142        #'A2': 'Second Class Upper',
143        #'A3': 'Second Class Lower',
144        #'A4': 'Third Class',
145        #'A5': 'Pass',
146        #'A6': 'Distinction',
147        #'A7': 'Credit',
148        #'A8': 'Merit',
149        'NEOR': 'No evidence of registration',
150        'NEOV': 'No evidence of verification',
151        'FRNS': 'Faculty requirements not satisfied',
152        }
153
154    DISABLE_PAYMENT_GROUP_DICT = {
155        'sf_all': 'School Fee - All Students',
156        'sf_pg': 'School Fee - Postgraduate Students',
157        'sf_pt': 'School Fee - Part-Time Students',
158        'sf_found': 'School Fee - Foundation Students',
159        'maint_all': 'Accommodation Fee - All Students',
160        'cl_regular': 'Acceptance Fee - Regular Students',
161        }
162
163    MODE_GROUPS = {
164        'All': ('all',),
165        'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'),
166        'Undergraduate Part-Time': ('ug_pt', 'de_pt'),
167        'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'),
168        'Foundation Programme': ('found',),
169        'Institute of Education': ('dp_ft'),
170        }
171
172    def fullname(self, firstname, lastname, middlename=None):
173        """Construct fullname.
174        """
175        try:
176            lastname = lastname.upper()
177        except AttributeError:
178            pass
179        # We do not necessarily have the middlename attribute
180        if middlename:
181            givennames = '%s %s' % (firstname, middlename)
182        else:
183            givennames = '%s' % firstname
184        givennames = string.capwords(
185            givennames.replace('-', ' - ')).replace(' - ', '-')
186        fullname = '%s, %s' % (lastname, givennames)
187        if '<' in fullname:
188            return 'XXX'
189        return fullname
Note: See TracBrowser for help on using the repository browser.