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

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

Resolve ticket #228:

  1. The first column should be the Serial number.
  2. Under the column for Full name, surname should come first in capital letter with a coma before the other names.
  3. The heading for ‘score’ column should be renamed ‘exam score’.
  4. CA column should come before exam score column
  5. The column for Total should be added after exam score column.
  6. Extra column for letter grade should come after the ‘total’ column.
  • Property svn:keywords set to Id
File size: 6.8 KB
RevLine 
[7569]1## $Id: utils.py 13963 2016-06-21 06:30:07Z 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##
[7822]18"""Customize general helper utilities for Kofa.
[7569]19"""
[13963]20
21import string
[8823]22from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
[7569]23
[8823]24class CustomKofaUtils(NigeriaKofaUtils):
[7569]25    """A collection of methods subject to customization.
26    """
[7845]27
28    PREFERRED_LANGUAGES_DICT = {
[9755]29        }
30
31    PAYMENT_CATEGORIES = {
32        'schoolfee': 'School Fee',
[13512]33        'schoolfee_1': 'School Fee Plus (1st instalment)',
34        'schoolfee_2': 'School Fee (2nd instalment)',
[13410]35        'schoolfee_incl': 'School Fee Plus',
[9755]36        'clearance': 'Acceptance Fee',
[13410]37        'clearance_incl': 'Acceptance Fee Plus',
[13424]38        'hostel_maintenance': 'Hostel Accommodation Fee',
[9755]39        'application': 'Application Fee',
40        'bed_allocation': 'Bed Allocation Fee',
41        'transfer': 'Transfer Fee',
[10467]42        'transcript': 'Transcript Fee',
[13035]43        'late_registration': 'Late Course Registration Fee',
[13402]44        'welfare': 'Student Welfare Assurance Fee',
[13463]45        'union': 'Student Union Dues',
[13402]46        'lapel': 'Lapel/File Fee',
[13374]47        'matric_gown': 'Matriculation Gown Fee',
48        'concessional': 'Concessional Fee',
[9755]49        }
50
51    SELECTABLE_PAYMENT_CATEGORIES = {
[13435]52        'schoolfee': 'School Fee without additional fees',
[13512]53        'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee',
54        'schoolfee_2': 'School Fee (2nd instalment)',
[13463]55        'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee',
[13435]56        'clearance': 'Acceptance Fee without additional fees',
[13410]57        'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee',
[13454]58        'hostel_maintenance': 'Hostel Accommodation Fee',
[9755]59        'application': 'Application Fee',
[11621]60        #'bed_allocation': 'Bed Allocation Fee',
61        #'transfer': 'Transfer Fee',
[10468]62        'transcript': 'Transcript Fee',
[13035]63        'late_registration': 'Late Course Registration Fee',
[13435]64        'welfare': 'Student Welfare Assurance Fee',
[13463]65        'union': 'Student Union Dues',
[13435]66        'lapel': 'Lapel/File Fee',
67        'matric_gown': 'Matriculation Gown Fee',
[13374]68        'concessional': 'Concessional Fee',
[9755]69        }
70
[13451]71    REPORTABLE_PAYMENT_CATEGORIES = {
72        'schoolfee': 'School Fee',
[13452]73        'schoolfee_incl': 'School Fee Plus',
[13635]74        'schoolfee_1': 'School Fee 1 Plus',
75        'schoolfee_2': 'School Fee 2',
[13451]76        'clearance': 'Acceptance Fee',
[13452]77        'clearance_incl': 'Acceptance Fee Plus',
[13451]78        'hostel_maintenance': 'Hostel Maintenance Fee',
79        }
80
[13638]81    BALANCE_PAYMENT_CATEGORIES = {
82        'schoolfee': 'School Fee',
83        'clearance': 'Acceptance Fee',
84        'hostel_maintenance': 'Hostel Maintenance Fee',
[13750]85        'late_registration': 'Late Course Registration Fee',
86        'welfare': 'Student Welfare Assurance Fee',
87        'union': 'Student Union Dues',
88        'lapel': 'Lapel/File Fee',
89        'matric_gown': 'Matriculation Gown Fee',
[13638]90        }
91
[10304]92    APP_CATS_DICT = {
93        'basic': 'PUTME, PUDE, PCE, PRENCE',
94        'no': 'No Application',
95        'pg_ft': 'Postgraduate Full-Time',
96        'pg_pt': 'Postgraduate Part-Time',
97        'cest': 'Part-Time, Diploma, Certificate',
98        'found': 'Foundation',
[10893]99        'ptee': 'Part-Time Entrance Examination',
[13568]100        'ioe_dp': 'Institute of Education Diploma',
[10304]101        }
102
[11591]103    STUDY_MODES_DICT = {
104        'ug_ft': 'Undergraduate Full Time',
105        'ug_pt': 'Undergraduate Part Time',
[11593]106        'de_ft': 'Direct Entry Full Time',
107        'de_pt': 'Direct Entry Part Time',
[11591]108        'dp_pt': 'Diploma Part Time',
109        'dp_ft': 'Diploma Full Time',
[13524]110        'special_pg_ft': 'Postgraduate Full Time',
111        'special_pg_pt': 'Postgraduate Part Time',
[11591]112        'found': 'Foundation',
[13498]113        'transfer': 'Transfer',
[13749]114        'mug_ft': 'Undergraduate Full Time Merit List',
115        'mde_ft': 'Direct Entry Full Time Merit List',
[11591]116        }
117
[13127]118    VERDICTS_DICT = {
119        '0': 'not yet',
120        'A': 'Successful student',
121        'B': 'Student with carryover courses',
122        'C': 'Student on probation',
123        #'D': 'Withdrawn from the faculty',
124        #'E': 'Student who were previously on probation',
125        #'F': 'Medical case',
126        #'G': 'Absent from examination',
127        #'H': 'Withheld results',
128        #'I': 'Expelled/rusticated/suspended student',
129        #'J': 'Temporary withdrawn from the university',
130        #'K': 'Unregistered student',
131        #'L': 'Referred student',
132        #'M': 'Reinstatement',
133        #'N': 'Student on transfer',
134        #'O': 'NCE-III repeater',
135        #'Y': 'No previous verdict',
136        #'X': 'New 300 level student',
137        'Z': 'Successful student (provisional)',
138        #'A1': 'First Class',
139        #'A2': 'Second Class Upper',
140        #'A3': 'Second Class Lower',
141        #'A4': 'Third Class',
142        #'A5': 'Pass',
143        #'A6': 'Distinction',
144        #'A7': 'Credit',
145        #'A8': 'Merit',
146        'NEOR': 'No evidence of registration',
147        'NEOV': 'No evidence of verification',
148        'FRNS': 'Faculty requirements not satisfied',
149        }
[13454]150
151    DISABLE_PAYMENT_GROUP_DICT = {
152        'sf_all': 'School Fee - All Students',
153        'maint_all': 'Accommodation Fee - All Students',
[13794]154        'cl_regular': 'Acceptance Fee - Regular Students',
[13454]155        }
[13870]156
157    MODE_GROUPS = {
158        'All': ('all',),
159        'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'),
160        'Undergraduate Part-Time': ('ug_pt', 'de_pt'),
161        'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'),
162        'Foundation Programme': ('found',),
163        'Institute of Education': ('dp_ft'),
164        }
[13963]165
166    def fullname(self, firstname, lastname, middlename=None):
167        """Construct fullname.
168        """
169        try:
170            lastname = lastname.upper()
171        except AttributeError:
172            pass
173        # We do not necessarily have the middlename attribute
174        if middlename:
175            givennames = '%s %s' % (firstname, middlename)
176        else:
177            givennames = '%s' % firstname
178        givennames = string.capwords(
179            givennames.replace('-', ' - ')).replace(' - ', '-')
180        fullname = '%s, %s' % (lastname, givennames)
181        if '<' in fullname:
182            return 'XXX'
183        return fullname
Note: See TracBrowser for help on using the repository browser.