[7569] | 1 | ## $Id: utils.py 14375 2017-01-07 07:25:14Z 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 | |
---|
| 21 | import string |
---|
[8823] | 22 | from kofacustom.nigeria.utils.utils import NigeriaKofaUtils |
---|
[7569] | 23 | |
---|
[8823] | 24 | class 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', |
---|
[14296] | 42 | 'transcript_local': 'Local Transcript Fee', |
---|
| 43 | 'transcript_inter': 'International Transcript Fee', |
---|
[13035] | 44 | 'late_registration': 'Late Course Registration Fee', |
---|
[13402] | 45 | 'welfare': 'Student Welfare Assurance Fee', |
---|
[13463] | 46 | 'union': 'Student Union Dues', |
---|
[13402] | 47 | 'lapel': 'Lapel/File Fee', |
---|
[13374] | 48 | 'matric_gown': 'Matriculation Gown Fee', |
---|
| 49 | 'concessional': 'Concessional Fee', |
---|
[14234] | 50 | 'id_card': 'Student ID Card', |
---|
[14355] | 51 | 'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112', |
---|
| 52 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 53 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
[14258] | 54 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 55 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 56 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 57 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 58 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 59 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[14375] | 60 | 'restitution': 'Restitution Fee', |
---|
[9755] | 61 | } |
---|
| 62 | |
---|
| 63 | SELECTABLE_PAYMENT_CATEGORIES = { |
---|
[13435] | 64 | 'schoolfee': 'School Fee without additional fees', |
---|
[13512] | 65 | 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', |
---|
| 66 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
[13463] | 67 | 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', |
---|
[13435] | 68 | 'clearance': 'Acceptance Fee without additional fees', |
---|
[14239] | 69 | 'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee', |
---|
[13454] | 70 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
[14243] | 71 | #'application': 'Application Fee', |
---|
[11621] | 72 | #'bed_allocation': 'Bed Allocation Fee', |
---|
| 73 | #'transfer': 'Transfer Fee', |
---|
[14296] | 74 | 'transcript_local': 'Local Transcript Fee', |
---|
| 75 | 'transcript_inter': 'International Transcript Fee', |
---|
[13035] | 76 | 'late_registration': 'Late Course Registration Fee', |
---|
[14243] | 77 | #'welfare': 'Student Welfare Assurance Fee', |
---|
| 78 | #'union': 'Student Union Dues', |
---|
| 79 | #'lapel': 'Lapel/File Fee', |
---|
| 80 | #'matric_gown': 'Matriculation Gown Fee', |
---|
[13374] | 81 | 'concessional': 'Concessional Fee', |
---|
[14243] | 82 | #'id_card': 'Student ID Card', |
---|
[14355] | 83 | 'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112', |
---|
| 84 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 85 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
[14258] | 86 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 87 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 88 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 89 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 90 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 91 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[14375] | 92 | 'restitution': 'Restitution Fee', |
---|
[9755] | 93 | } |
---|
| 94 | |
---|
[13451] | 95 | REPORTABLE_PAYMENT_CATEGORIES = { |
---|
| 96 | 'schoolfee': 'School Fee', |
---|
[13452] | 97 | 'schoolfee_incl': 'School Fee Plus', |
---|
[13635] | 98 | 'schoolfee_1': 'School Fee 1 Plus', |
---|
| 99 | 'schoolfee_2': 'School Fee 2', |
---|
[13451] | 100 | 'clearance': 'Acceptance Fee', |
---|
[13452] | 101 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
[13451] | 102 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
| 103 | } |
---|
| 104 | |
---|
[13638] | 105 | BALANCE_PAYMENT_CATEGORIES = { |
---|
| 106 | 'schoolfee': 'School Fee', |
---|
| 107 | 'clearance': 'Acceptance Fee', |
---|
| 108 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
[13750] | 109 | 'late_registration': 'Late Course Registration Fee', |
---|
| 110 | 'welfare': 'Student Welfare Assurance Fee', |
---|
| 111 | 'union': 'Student Union Dues', |
---|
| 112 | 'lapel': 'Lapel/File Fee', |
---|
| 113 | 'matric_gown': 'Matriculation Gown Fee', |
---|
[14234] | 114 | 'id_card': 'Student ID Card', |
---|
[14258] | 115 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 116 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
| 117 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 118 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 119 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 120 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 121 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 122 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[14375] | 123 | 'restitution': 'Restitution Fee', |
---|
[13638] | 124 | } |
---|
| 125 | |
---|
[10304] | 126 | APP_CATS_DICT = { |
---|
| 127 | 'basic': 'PUTME, PUDE, PCE, PRENCE', |
---|
| 128 | 'no': 'No Application', |
---|
| 129 | 'pg_ft': 'Postgraduate Full-Time', |
---|
| 130 | 'pg_pt': 'Postgraduate Part-Time', |
---|
| 131 | 'cest': 'Part-Time, Diploma, Certificate', |
---|
| 132 | 'found': 'Foundation', |
---|
[10893] | 133 | 'ptee': 'Part-Time Entrance Examination', |
---|
[13568] | 134 | 'ioe_dp': 'Institute of Education Diploma', |
---|
[14339] | 135 | 'ijmbe': 'IJMBE Preparation', |
---|
[10304] | 136 | } |
---|
| 137 | |
---|
[11591] | 138 | STUDY_MODES_DICT = { |
---|
| 139 | 'ug_ft': 'Undergraduate Full Time', |
---|
| 140 | 'ug_pt': 'Undergraduate Part Time', |
---|
[11593] | 141 | 'de_ft': 'Direct Entry Full Time', |
---|
| 142 | 'de_pt': 'Direct Entry Part Time', |
---|
[11591] | 143 | 'dp_pt': 'Diploma Part Time', |
---|
| 144 | 'dp_ft': 'Diploma Full Time', |
---|
[13524] | 145 | 'special_pg_ft': 'Postgraduate Full Time', |
---|
| 146 | 'special_pg_pt': 'Postgraduate Part Time', |
---|
[11591] | 147 | 'found': 'Foundation', |
---|
[13498] | 148 | 'transfer': 'Transfer', |
---|
[13749] | 149 | 'mug_ft': 'Undergraduate Full Time Merit List', |
---|
| 150 | 'mde_ft': 'Direct Entry Full Time Merit List', |
---|
[14339] | 151 | 'ijmbe': 'IJMBE Preparation', |
---|
[11591] | 152 | } |
---|
| 153 | |
---|
[13127] | 154 | VERDICTS_DICT = { |
---|
| 155 | '0': 'not yet', |
---|
| 156 | 'A': 'Successful student', |
---|
| 157 | 'B': 'Student with carryover courses', |
---|
| 158 | 'C': 'Student on probation', |
---|
| 159 | #'D': 'Withdrawn from the faculty', |
---|
| 160 | #'E': 'Student who were previously on probation', |
---|
| 161 | #'F': 'Medical case', |
---|
| 162 | #'G': 'Absent from examination', |
---|
| 163 | #'H': 'Withheld results', |
---|
| 164 | #'I': 'Expelled/rusticated/suspended student', |
---|
| 165 | #'J': 'Temporary withdrawn from the university', |
---|
| 166 | #'K': 'Unregistered student', |
---|
| 167 | #'L': 'Referred student', |
---|
| 168 | #'M': 'Reinstatement', |
---|
| 169 | #'N': 'Student on transfer', |
---|
| 170 | #'O': 'NCE-III repeater', |
---|
| 171 | #'Y': 'No previous verdict', |
---|
| 172 | #'X': 'New 300 level student', |
---|
| 173 | 'Z': 'Successful student (provisional)', |
---|
| 174 | #'A1': 'First Class', |
---|
| 175 | #'A2': 'Second Class Upper', |
---|
| 176 | #'A3': 'Second Class Lower', |
---|
| 177 | #'A4': 'Third Class', |
---|
| 178 | #'A5': 'Pass', |
---|
| 179 | #'A6': 'Distinction', |
---|
| 180 | #'A7': 'Credit', |
---|
| 181 | #'A8': 'Merit', |
---|
| 182 | 'NEOR': 'No evidence of registration', |
---|
| 183 | 'NEOV': 'No evidence of verification', |
---|
| 184 | 'FRNS': 'Faculty requirements not satisfied', |
---|
| 185 | } |
---|
[13454] | 186 | |
---|
| 187 | DISABLE_PAYMENT_GROUP_DICT = { |
---|
| 188 | 'sf_all': 'School Fee - All Students', |
---|
[14246] | 189 | 'sf_pg': 'School Fee - Postgraduate Students', |
---|
| 190 | 'sf_pt': 'School Fee - Part-Time Students', |
---|
| 191 | 'sf_found': 'School Fee - Foundation Students', |
---|
[13454] | 192 | 'maint_all': 'Accommodation Fee - All Students', |
---|
[13794] | 193 | 'cl_regular': 'Acceptance Fee - Regular Students', |
---|
[13454] | 194 | } |
---|
[13870] | 195 | |
---|
| 196 | MODE_GROUPS = { |
---|
| 197 | 'All': ('all',), |
---|
| 198 | 'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'), |
---|
| 199 | 'Undergraduate Part-Time': ('ug_pt', 'de_pt'), |
---|
| 200 | 'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'), |
---|
| 201 | 'Foundation Programme': ('found',), |
---|
| 202 | 'Institute of Education': ('dp_ft'), |
---|
| 203 | } |
---|
[13963] | 204 | |
---|
| 205 | def fullname(self, firstname, lastname, middlename=None): |
---|
| 206 | """Construct fullname. |
---|
| 207 | """ |
---|
| 208 | try: |
---|
| 209 | lastname = lastname.upper() |
---|
| 210 | except AttributeError: |
---|
| 211 | pass |
---|
| 212 | # We do not necessarily have the middlename attribute |
---|
| 213 | if middlename: |
---|
| 214 | givennames = '%s %s' % (firstname, middlename) |
---|
| 215 | else: |
---|
| 216 | givennames = '%s' % firstname |
---|
| 217 | givennames = string.capwords( |
---|
| 218 | givennames.replace('-', ' - ')).replace(' - ', '-') |
---|
| 219 | fullname = '%s, %s' % (lastname, givennames) |
---|
| 220 | if '<' in fullname: |
---|
| 221 | return 'XXX' |
---|
| 222 | return fullname |
---|