Ignore:
Timestamp:
4 Jun 2019, 08:17:06 (5 years ago)
Author:
Henrik Bettermann
Message:

Use CustomKofaUtils?.selectable_payment_categories for customization instead of customizing the view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py

    r15433 r15451  
    2121import string
    2222from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
     23from waeup.kofa.students.workflow  import ALUMNI_STATES
    2324
    2425class CustomKofaUtils(NigeriaKofaUtils):
     
    99100        }
    100101
     102    ALUMNI_PAYMENT_CATS =  {
     103        'transcript_local': 'Transcript Fee Local',
     104        'transcript_inter': 'Transcript Fee International',
     105        }
     106
     107    REDUCED_PAYMENT_CATS =  {
     108        'clearance': 'Acceptance Fee',
     109        'schoolfee': 'School Fee',
     110        }
     111
     112    IJMBE_PAYMENT_CATS =  {
     113        'clearance': 'Acceptance Fee',
     114        'schoolfee': 'School Fee',
     115        'schoolfee_1': 'School Fee (1st instalment)',
     116        'schoolfee_2': 'School Fee (2nd instalment)',
     117        }
     118
     119    PT_AND_DSH_PAYMENT_CATS =  {
     120        'clearance_incl': 'Acceptance Fee Plus',
     121        'schoolfee_incl': 'School Fee Plus',
     122        'ent_registration_1': 'Registration Fee ENT201',
     123        'ent_text_book_1': 'Text Book Fee ENT201',
     124        'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
     125        'gst_registration_2': 'Registration Fee GST222',
     126        'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112',
     127        'gst_text_book_1': 'Text Book Fee GST101 GST102',
     128        'gst_text_book_2': 'Text Book Fee GST111 GST112',
     129        'gst_text_book_3': 'Text Book Fee GST222',
     130        }
     131
    101132    def selectable_payment_categories(self, student):
     133        if student.state in ALUMNI_STATES:
     134            return self.ALUMNI_PAYMENT_CATS
     135        if student.current_mode in (
     136            'special_pg_ft', 'special_pg_pt', 'found', 'bridge'):
     137            return self.REDUCED_PAYMENT_CATS
     138        if student.current_mode in (
     139            'ug_pt', 'de_pt','dp_pt', 'de_dsh', 'ug_dsh'):
     140            return self.PT_AND_DSH_PAYMENT_CATS
     141        if student.current_mode == 'ijmbe':
     142            return self.IJMBE_PAYMENT_CATS
    102143        return self.SELECTABLE_PAYMENT_CATEGORIES
    103144
Note: See TracChangeset for help on using the changeset viewer.