[7569] | 1 | ## $Id: utils.py 13128 2015-07-01 18:39:13Z 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 | """ |
---|
[11913] | 20 | from copy import deepcopy |
---|
[8834] | 21 | from kofacustom.nigeria.utils.utils import NigeriaKofaUtils |
---|
[9989] | 22 | from waeup.fceokene.interfaces import MessageFactory as _ |
---|
[7569] | 23 | |
---|
[8834] | 24 | class CustomKofaUtils(NigeriaKofaUtils): |
---|
[7569] | 25 | """A collection of methods subject to customization. |
---|
| 26 | """ |
---|
[7845] | 27 | |
---|
| 28 | PREFERRED_LANGUAGES_DICT = { |
---|
| 29 | } |
---|
[9461] | 30 | |
---|
| 31 | APP_CATS_DICT = { |
---|
[10570] | 32 | 'basic': 'UTME, DE, PCE, PRENCE', |
---|
[9461] | 33 | 'no': 'No Application', |
---|
| 34 | 'sandwich': 'Sandwich', |
---|
| 35 | 'cest': 'Part-Time, Diploma, Certificate', |
---|
| 36 | 'bec': 'Bachelor of Education Certificate Programmes', |
---|
| 37 | } |
---|
[9989] | 38 | |
---|
[11913] | 39 | |
---|
| 40 | PAYMENT_CATEGORIES = { |
---|
| 41 | 'schoolfee': 'School Fee', |
---|
| 42 | 'clearance': 'Acceptance Fee', |
---|
| 43 | 'bed_allocation': 'Bed Allocation Fee', |
---|
| 44 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
| 45 | #'transfer': 'Transfer Fee', |
---|
| 46 | #'gown': 'Gown Hire Fee', |
---|
| 47 | 'application': 'Application Fee', |
---|
| 48 | #'transcript': 'Transcript Fee', |
---|
| 49 | 'third_semester': 'NCE Third Semester Fee', |
---|
| 50 | } |
---|
| 51 | |
---|
[13030] | 52 | DISABLE_PAYMENT_GROUP_DICT = { |
---|
| 53 | 'sf_all': 'School Fee - All Students', |
---|
| 54 | 'sf_nce1': 'School Fee - NCE I Fresh Students', |
---|
| 55 | } |
---|
| 56 | |
---|
[11913] | 57 | SELECTABLE_PAYMENT_CATEGORIES = deepcopy(PAYMENT_CATEGORIES) |
---|
| 58 | |
---|
[13128] | 59 | VERDICTS_DICT = { |
---|
| 60 | '0': 'not yet', |
---|
| 61 | 'A': 'Successful student', |
---|
| 62 | 'B': 'Student with carryover courses', |
---|
| 63 | 'C': 'Student on probation', |
---|
| 64 | 'D': 'Withdrawn from the faculty', |
---|
| 65 | #'E': 'Student who were previously on probation', |
---|
| 66 | #'F': 'Medical case', |
---|
| 67 | 'G': 'Absent from examination', |
---|
| 68 | #'H': 'Withheld results', |
---|
| 69 | 'I': 'Expelled/rusticated/suspended student', |
---|
| 70 | 'J': 'Temporary withdrawn from the university', |
---|
| 71 | #'K': 'Unregistered student', |
---|
| 72 | 'L': 'Referred student', |
---|
| 73 | 'M': 'Reinstatement', |
---|
| 74 | #'N': 'Student on transfer', |
---|
| 75 | 'O': 'NCE-III repeater', |
---|
| 76 | #'Y': 'No previous verdict', |
---|
| 77 | #'X': 'New 300 level student (Uniben)', |
---|
| 78 | 'Z': 'Successful student (provisional)', |
---|
| 79 | 'A1': 'First Class', |
---|
| 80 | 'A2': 'Second Class Upper', |
---|
| 81 | 'A3': 'Second Class Lower', |
---|
| 82 | 'A4': 'Third Class', |
---|
| 83 | 'A5': 'Pass', |
---|
| 84 | 'A6': 'Distinction', |
---|
| 85 | 'A7': 'Credit', |
---|
| 86 | 'A8': 'Merit', |
---|
| 87 | 'OPDE': 'PDE repeater', |
---|
| 88 | } |
---|
| 89 | |
---|
[9989] | 90 | def getPaymentItem(self, payment): |
---|
| 91 | """Return payment item. |
---|
| 92 | |
---|
| 93 | Bed coordinates are only visible after payment. |
---|
| 94 | """ |
---|
| 95 | if 'maintenance' in payment.p_category and payment.p_state != 'paid': |
---|
| 96 | return _('(visible after successful payment)') |
---|
| 97 | return payment.p_item |
---|