source: main/kofacustom.unidel/trunk/src/kofacustom/unidel/utils/utils.py @ 18354

Last change on this file since 18354 was 18354, checked in by Henrik Bettermann, 4 weeks ago

Addpayment category late_registration.

  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1## $Id: utils.py 18354 2026-10-28 13:52:58Z 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"""
20import string
21from copy import deepcopy
22from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
23
24class CustomKofaUtils(NigeriaKofaUtils):
25    """A collection of methods subject to customization.
26    """
27
28    PAYMENT_CATEGORIES = {
29        'schoolfee': 'School Fee',
30        'clearance': 'Acceptance Fee',
31        'bed_allocation': 'Bed Reservation',
32        'hostel_maintenance': 'Hostel Fee',
33        #'transfer': 'Transfer Fee',
34        #'gown': 'Gown Hire Fee',
35        'application': 'Application Fee',
36        #'app_balance': 'Application Fee Balance',
37        'transcript': 'Transcript Fee',
38        'transcript_student': 'Transcript Fee Students Copy',
39        'transcript_local': 'Transcript Fee Local Copy',
40        'transcript_inter': 'Transcript Fee International Copy',
41        'late_registration': 'Late Course Registration Fee',
42        #'combi': 'Combi Payment',
43        'med_reg':'Medical Registration Fee',
44        'teaching_practice':'Teaching Practice Fee',
45        'ijmb_exam':'IJMB Examination Fees',
46        'union': 'Student Union Due',
47        'siwes': 'SIWES',
48        'trcn_nce': 'NCE TRCN Induction / License Fees',
49        'trcn_degree': 'DEGREE TRCN Induction / License Fees',
50        'twohundred_ced': 'CED Registration Fee (200 Level)',
51        'threehundred_ced': 'CED Registration Fee (300 Level)',
52        'convocation': 'Convocation Fee',
53        'plagtest':   'Turnitin Plagiarism Checker',
54        'plagtest_2': 'Turnitin Plagiarism Checker 2',
55        'plagtest_3': 'Turnitin Plagiarism Checker 3',
56        'plagtest_4': 'Turnitin Plagiarism Checker 4',
57        'plagtest_5': 'Turnitin Plagiarism Checker 5',
58        'plagtest_6': 'Turnitin Plagiarism Checker 6',
59        'plagtest_7': 'Turnitin Plagiarism Checker 7',
60        'plagtest_8': 'Turnitin Plagiarism Checker 8',
61        'plagtest_9': 'Turnitin Plagiarism Checker 9',
62        'plagtest_10': 'Turnitin Plagiarism Checker 10',
63        'plagtest_11': 'Turnitin Plagiarism Checker 11',
64        'plagtest_12': 'Turnitin Plagiarism Checker 12',
65        'plagtest_13': 'Turnitin Plagiarism Checker 13',
66        'plagtest_14': 'Turnitin Plagiarism Checker 14',
67        'plagtest_15': 'Turnitin Plagiarism Checker 15',
68        'plagtest_16': 'Turnitin Plagiarism Checker 16',
69        'plagtest_17': 'Turnitin Plagiarism Checker 17',
70        'plagtest_18': 'Turnitin Plagiarism Checker 18',
71        'plagtest_19': 'Turnitin Plagiarism Checker 19',
72        'dsb': 'Digital Skills Training Fee',
73        }
74
75    SELECTABLE_PAYMENT_CATEGORIES = {
76        'schoolfee': 'School Fee',
77        'clearance': 'Acceptance Fee',
78        #'bed_allocation': 'Bed Reservation (free of charge)',
79        'late_registration': 'Late Course Registration Fee',
80        'hostel_maintenance': 'Hostel Fee',
81        'med_reg':'Medical Registration Fee',
82        'teaching_practice':'Teaching Practice Fee',
83        'ijmb_exam':'IJMB Examination Fees',
84        #'transcript': 'Transcript Fee',
85        'transcript_student': 'Transcript Fee Students Copy',
86        'transcript_local': 'Transcript Fee Local Copy',
87        'transcript_inter': 'Transcript Fee International Copy',
88        'siwes': 'SIWES',
89        #'union': 'Student Union Due',
90        'trcn_nce': 'NCE TRCN Induction / License Fees',
91        'trcn_degree': 'DEGREE TRCN Induction / License Fees',
92        'twohundred_ced': 'CED Registration Fee (200 Level)',
93        'threehundred_ced': 'CED Registration Fee (300 Level)',
94        'convocation': 'Convocation Fee',
95        'plagtest':   'Turnitin Plagiarism Checker',
96        'dsb': 'Digital Skills Training Fee',
97        }
98
99    def selectable_payment_categories(self, student):
100        return self.SELECTABLE_PAYMENT_CATEGORIES
101
102    PREVIOUS_PAYMENT_CATEGORIES = deepcopy(SELECTABLE_PAYMENT_CATEGORIES)
103
104    DISABLE_PAYMENT_GROUP_DICT = {
105        'sf_all':    'School Fee - All',
106        'sf_ugft':   'School Fee - Undergraduate Full-Time',
107        }
108
109    COURSE_CATEGORY_DICT = {
110        'C':'Core Course (C)',
111        'R':'Required Courses (R)',
112        'E':'Elective Courses (E)',
113        }
114       
115    STUDY_MODES_DICT = {
116        'ug_ft': 'Undergraduate Full-Time',
117        'ug_pt': 'Undergraduate Part-Time',
118        'found': 'Foundation',
119        'dp_ft': 'Full-Time Diploma Programmes',
120        'dp_pt': 'Part-Time Diploma Programmes',
121        'de_ft': 'Direct Entry Full-Time Programmes',
122        'nce_ft': 'NCE Full-Time',
123        'nce_pt': 'NCE Part-Time',
124        'pde': 'Professional Diploma in Education Programmes',
125        'trc': 'TRCN Programmes',
126        'dsb': 'Digital Skill Boulevard Certificate Programmes',
127        'pg_ft': 'Postgraduate Full-Time',
128        'pg_pt': 'Postgraduate Part-Time',
129        }
130
131    ENABLE_SCORE_EDITING_GROUP_DICT = STUDY_MODES_DICT
132
133    APP_CATS_DICT = {
134        'basic': 'UAS, PUTME, PCE, PRENCE',
135        'basic_de': 'UAS, PUTME, PUDE, PCE, PRENCE',
136        'no': 'No Application',
137        'pre': 'Pre-Degree Programmes',
138        'jupeb': 'JUPEB Pre-Degree (Foundation) Programmes',
139        'ijmb': 'IJMB Foundation School Programmes',
140        'dp_ft': 'Full-Time Diploma Programmes',
141        'dp_pt': 'Part-Time Diploma Programmes',
142        'ug_pt': 'Undergraduate Part-Time Programmes',
143        'df': 'Digital Forensic for Professionals and Academia',
144        'law': 'Certificate in Law Programme',
145        'pde': 'Professional Diploma in Education Programmes',
146        'trcdeg': 'TRCN Degree Programmes',
147        'trcnce': 'TRCN NCE Programmes',
148        'dsb': 'Digital Skill Boulevard Certificate Programmes',
149        'pg_ft': 'Full-Time Postgraduate Programmes',
150        'pg_pt': 'Part-Time Postgraduate Programmes',
151        }
152
153    SPECIAL_HANDLING_DICT = {
154        'regular': 'Regular Hostel',
155        'blocked': 'Blocked Hostel',
156        'oyibu': 'Owa-Oyibu Campus Hostel',
157        'alero': 'Owa-Alero Campus Hostel',
158        }
159
160    def fullname(self, firstname, lastname, middlename=None):
161        """Construct fullname.
162        """
163        try:
164            lastname = lastname.upper()
165        except AttributeError:
166            pass
167        # We remove single initial
168        if firstname and len(firstname) == 1:
169            firstname = ''
170        if middlename and len(middlename) == 1:
171            middlename = ''
172        if lastname and len(lastname) == 1:
173            lastname = ''
174        # We construct givennames
175        givennames = ''
176        if middlename and firstname:
177            givennames = '%s %s' % (firstname, middlename)
178        elif firstname:
179            givennames = firstname
180        elif middlename:
181            givennames = middlename
182        givennames = string.capwords(
183            givennames.replace('-', ' - ')).replace(' - ', '-')
184        # We construct fullname
185        fullname = ''
186        if lastname and givennames:
187            fullname = '%s, %s' % (lastname, givennames)
188        elif lastname:
189            fullname = lastname
190        elif givennames:
191            fullname = givennames
192        if '<' in fullname:
193            return 'XXX'
194        return fullname
Note: See TracBrowser for help on using the repository browser.