## $Id: utils.py 14258 2016-11-05 04:33:57Z henrik $ ## ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## """Customize general helper utilities for Kofa. """ import string from kofacustom.nigeria.utils.utils import NigeriaKofaUtils class CustomKofaUtils(NigeriaKofaUtils): """A collection of methods subject to customization. """ PREFERRED_LANGUAGES_DICT = { } PAYMENT_CATEGORIES = { 'schoolfee': 'School Fee', 'schoolfee_1': 'School Fee Plus (1st instalment)', 'schoolfee_2': 'School Fee (2nd instalment)', 'schoolfee_incl': 'School Fee Plus', 'clearance': 'Acceptance Fee', 'clearance_incl': 'Acceptance Fee Plus', 'hostel_maintenance': 'Hostel Accommodation Fee', 'application': 'Application Fee', 'bed_allocation': 'Bed Allocation Fee', 'transfer': 'Transfer Fee', 'transcript': 'Transcript Fee', 'late_registration': 'Late Course Registration Fee', 'welfare': 'Student Welfare Assurance Fee', 'union': 'Student Union Dues', 'lapel': 'Lapel/File Fee', 'matric_gown': 'Matriculation Gown Fee', 'concessional': 'Concessional Fee', 'id_card': 'Student ID Card', 'gst_text_book_1': 'Text Book Fee GST101 GST102', 'gst_text_book_2': 'Text Book Fee GST111 GST112', 'gst_text_book_3': 'Text Book Fee GST222', 'ent_text_book_4': 'Text Book Fee ENT201', 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', 'gst_registration_2': 'Registration Fee GST222', 'ent_registration_3': 'Registration Fee ENT201', 'fac_dep': 'Faculty and Departmental Dues', } SELECTABLE_PAYMENT_CATEGORIES = { 'schoolfee': 'School Fee without additional fees', 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', 'schoolfee_2': 'School Fee (2nd instalment)', 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', 'clearance': 'Acceptance Fee without additional fees', 'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee', 'hostel_maintenance': 'Hostel Accommodation Fee', #'application': 'Application Fee', #'bed_allocation': 'Bed Allocation Fee', #'transfer': 'Transfer Fee', 'transcript': 'Transcript Fee', 'late_registration': 'Late Course Registration Fee', #'welfare': 'Student Welfare Assurance Fee', #'union': 'Student Union Dues', #'lapel': 'Lapel/File Fee', #'matric_gown': 'Matriculation Gown Fee', 'concessional': 'Concessional Fee', #'id_card': 'Student ID Card', 'gst_text_book_1': 'Text Book Fee GST101 GST102', 'gst_text_book_2': 'Text Book Fee GST111 GST112', 'gst_text_book_3': 'Text Book Fee GST222', 'ent_text_book_4': 'Text Book Fee ENT201', 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', 'gst_registration_2': 'Registration Fee GST222', 'ent_registration_3': 'Registration Fee ENT201', 'fac_dep': 'Faculty and Departmental Dues', } REPORTABLE_PAYMENT_CATEGORIES = { 'schoolfee': 'School Fee', 'schoolfee_incl': 'School Fee Plus', 'schoolfee_1': 'School Fee 1 Plus', 'schoolfee_2': 'School Fee 2', 'clearance': 'Acceptance Fee', 'clearance_incl': 'Acceptance Fee Plus', 'hostel_maintenance': 'Hostel Maintenance Fee', } BALANCE_PAYMENT_CATEGORIES = { 'schoolfee': 'School Fee', 'clearance': 'Acceptance Fee', 'hostel_maintenance': 'Hostel Maintenance Fee', 'late_registration': 'Late Course Registration Fee', 'welfare': 'Student Welfare Assurance Fee', 'union': 'Student Union Dues', 'lapel': 'Lapel/File Fee', 'matric_gown': 'Matriculation Gown Fee', 'id_card': 'Student ID Card', 'gst_text_book_1': 'Text Book Fee GST101 GST102', 'gst_text_book_2': 'Text Book Fee GST111 GST112', 'gst_text_book_3': 'Text Book Fee GST222', 'ent_text_book_4': 'Text Book Fee ENT201', 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', 'gst_registration_2': 'Registration Fee GST222', 'ent_registration_3': 'Registration Fee ENT201', 'fac_dep': 'Faculty and Departmental Dues', } APP_CATS_DICT = { 'basic': 'PUTME, PUDE, PCE, PRENCE', 'no': 'No Application', 'pg_ft': 'Postgraduate Full-Time', 'pg_pt': 'Postgraduate Part-Time', 'cest': 'Part-Time, Diploma, Certificate', 'found': 'Foundation', 'ptee': 'Part-Time Entrance Examination', 'ioe_dp': 'Institute of Education Diploma', } STUDY_MODES_DICT = { 'ug_ft': 'Undergraduate Full Time', 'ug_pt': 'Undergraduate Part Time', 'de_ft': 'Direct Entry Full Time', 'de_pt': 'Direct Entry Part Time', 'dp_pt': 'Diploma Part Time', 'dp_ft': 'Diploma Full Time', 'special_pg_ft': 'Postgraduate Full Time', 'special_pg_pt': 'Postgraduate Part Time', 'found': 'Foundation', 'transfer': 'Transfer', 'mug_ft': 'Undergraduate Full Time Merit List', 'mde_ft': 'Direct Entry Full Time Merit List', } VERDICTS_DICT = { '0': 'not yet', 'A': 'Successful student', 'B': 'Student with carryover courses', 'C': 'Student on probation', #'D': 'Withdrawn from the faculty', #'E': 'Student who were previously on probation', #'F': 'Medical case', #'G': 'Absent from examination', #'H': 'Withheld results', #'I': 'Expelled/rusticated/suspended student', #'J': 'Temporary withdrawn from the university', #'K': 'Unregistered student', #'L': 'Referred student', #'M': 'Reinstatement', #'N': 'Student on transfer', #'O': 'NCE-III repeater', #'Y': 'No previous verdict', #'X': 'New 300 level student', 'Z': 'Successful student (provisional)', #'A1': 'First Class', #'A2': 'Second Class Upper', #'A3': 'Second Class Lower', #'A4': 'Third Class', #'A5': 'Pass', #'A6': 'Distinction', #'A7': 'Credit', #'A8': 'Merit', 'NEOR': 'No evidence of registration', 'NEOV': 'No evidence of verification', 'FRNS': 'Faculty requirements not satisfied', } DISABLE_PAYMENT_GROUP_DICT = { 'sf_all': 'School Fee - All Students', 'sf_pg': 'School Fee - Postgraduate Students', 'sf_pt': 'School Fee - Part-Time Students', 'sf_found': 'School Fee - Foundation Students', 'maint_all': 'Accommodation Fee - All Students', 'cl_regular': 'Acceptance Fee - Regular Students', } MODE_GROUPS = { 'All': ('all',), 'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'), 'Undergraduate Part-Time': ('ug_pt', 'de_pt'), 'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'), 'Foundation Programme': ('found',), 'Institute of Education': ('dp_ft'), } def fullname(self, firstname, lastname, middlename=None): """Construct fullname. """ try: lastname = lastname.upper() except AttributeError: pass # We do not necessarily have the middlename attribute if middlename: givennames = '%s %s' % (firstname, middlename) else: givennames = '%s' % firstname givennames = string.capwords( givennames.replace('-', ' - ')).replace(' - ', '-') fullname = '%s, %s' % (lastname, givennames) if '<' in fullname: return 'XXX' return fullname