Index: /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py	(revision 17431)
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
-## $Id$
+    # -*- coding: utf-8 -*-
+## $Id: browser.py 17429 2023-06-05 04:34:30Z henrik $
 ##
 ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
@@ -9,5 +9,5 @@
 ##
 ## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## but WITHOUT ANY WARRANTY; without even the implied warranty ofself.context.amount_auth
 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ## GNU General Public License for more details.
@@ -20,4 +20,6 @@
 import hashlib
 import grok
+import os
+import csv
 from xml.dom import minidom
 from zope.interface import Interface
@@ -30,4 +32,5 @@
     InterswitchPaymentVerifyWebservicePageStudent,
     InterswitchPageStudent, InterswitchPageApplicant,
+    module_activated,
     )
 from waeup.aaue.students.interfaces import ICustomStudentOnlinePayment
@@ -35,6 +38,5 @@
 from waeup.aaue.interfaces import MessageFactory as _
 
-PRODUCT_ID_PT = '5040'
-PRODUCT_ID_REGULAR = '5845'
+PRODUCT_ID = '5845'
 SITE_NAME = 'aaue.waeup.org'
 PROVIDER_ACCT = '0200244434'
@@ -49,39 +51,32 @@
 URL = '/paydirect/api/v1/gettransaction.json'
 HTTPS = True
-MAC_REGULAR = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
-MAC_PT = '74424F1DFECD6058F153148255CDD55E16724B4F380ADB2C63C5D1D7A5675759010C8153DCB930AAF2D38903CBF7CE32B8A6BA2C16BBC46721DF2E3F3E4548E3'
+MAC = '9718FA00B0F5070B388A9896ADCED9B2FB02D30F71E12E68BDADC63F6852A3496FF97D8A0F9DA9F753B911A49BB09BB87B55FD02046BD325C74C46C0123CF023'
 
 httplib.HTTPSConnection.debuglevel = 0
 
-
-def gateway_net_amt(fee):
-    if fee > GATEWAY_AMT:
-        return fee - GATEWAY_AMT
-    return 0.0
-
-def contr_agreement_applicant(applicant):
-    if applicant.__parent__.prefix in (
-        'fp',
-        'ptee',
-        'dsh',
-        'bridge',
-        'ijmbe',
-        ):
-        return 'first'
-    return 'second'
-
-def contr_agreement_student(student):
-    if student.current_mode in (
-        'found',
-        'bridge',
-        'ug_dsh',
-        'de_dsh',
-        'ug_pt',
-        'de_pt',
-        'dp_pt',
-        'ijmbe',
-        ):
-        return 'first'
-    return 'second'
+BANK_ACCOUNTS = {
+    'edohis':   ('1222577132', '117', 'Edo State Health Insurance'),
+    'union':    ('1019763348', '7', 'Student Union'),
+    'sport':    ('1021941220', '7', 'Sport Development'),
+    'access':   ('1012688013', '123', 'Access Card'),
+    'notebook': ('4011210501', '51', 'Branded Notebook'),
+    'library':  ('2000122995', '8', 'Library Development'),
+    'fac1':     ('1022438743', '7', 'Faculty Fee'),
+    'fac2':     ('2000249757', '8', 'Faculty Fee'),
+    'fac3':     ('1012678566', '123', 'Faculty Fee'),
+    'acceptance': ('2000249757', '8', 'Acceptance Fee'),
+    'matricgown': ('2000249757', '8', 'Matriculation Gown Fee'),
+    'lapel':      ('2000249757', '8', 'Lapel Fee'),
+    }
+
+schoolfees_path = os.path.join(
+    os.path.dirname(__file__), '../students/schoolfees.csv')
+reader = csv.DictReader(open(schoolfees_path, 'rb'))
+SCHOOLFEES = {item['code']:item for item in reader}
+
+acceptancefees_path = os.path.join(
+    os.path.dirname(__file__), '../students/acceptancefees.csv')
+reader = csv.DictReader(open(acceptancefees_path, 'rb'))
+ACCEPTANCEFEES = {item['code']:item for item in reader}
 
 class CustomInterswitchPageApplicant(InterswitchPageApplicant):
@@ -97,9 +92,12 @@
     provider_bank_id = PROVIDER_BANK_ID
     provider_acct = PROVIDER_ACCT
-    institution_acct = '1010835352'
-    institution_bank_id = '117'
+    pay_item_id = '101'
 
     def update(self):
-
+        if not module_activated(
+            self.context.__parent__.__parent__.year, self.context):
+            self.flash(_('Forbidden'), type='danger')
+            self.redirect(self.url(self.context, '@@index'))
+            return
         error = self.init_update()
         if error:
@@ -107,64 +105,28 @@
             self.redirect(self.url(self.context, '@@index'))
             return
-        self.context.r_company = u'interswitch'
+        # Already now it becomes an Interswitch payment. We set the net amount
+        # and add the gateway amount.
+        if not self.context.r_company:
+            self.context.net_amt = self.context.amount_auth
+            self.context.amount_auth += GATEWAY_AMT
+            self.context.gateway_amt = GATEWAY_AMT
+            self.context.r_company = u'interswitch'
+        xmldict = {}
         provider_amt = 2000.0
-        fedex_amt = 0.0
-        if contr_agreement_applicant(self.applicant) == 'first':
-            self.product_id = PRODUCT_ID_PT
-            self.pay_item_id = '101'
-            self.mac = MAC_PT
-            if self.applicant.__parent__.prefix == 'ijmbe':
-                self.institution_bank_id = '123'
-                self.institution_acct = '1012278272'
-        else:
-            self.product_id = PRODUCT_ID_REGULAR
-            self.pay_item_id = '109'
-            self.mac = MAC_REGULAR
-            if self.applicant.__parent__.prefix in ('utme', 'ude'):
-                provider_amt = 1000.0
-            elif self.applicant.__parent__.prefix in ('trans', 'cert'):
-                self.institution_acct = '1010827641'
-                self.institution_bank_id = '117'
-                self.provider_bank_id = '10'
-                self.provider_acct = '0427773399'
-                if self.applicant.applicant_id[:5] in ('cert7', 'cert8'):
-                    provider_amt = 0.0
-                if self.applicant.applicant_id[:6] in ('trans5', 'trans6'):
-                    self.institution_acct = '5210006575'
-                    self.institution_bank_id = '51'
-                #if self.applicant.applicant_id[:6] in ('trans1', 'trans6'):
-                #    fedex_amt = 10500.0
-                if self.context.p_category == 'app_balance':
-                    provider_amt = 0.0
-            elif self.applicant.applicant_id.startswith('bridge'): # easier to test
-                self.institution_acct = '1014847058'
-                self.institution_bank_id = '7'
-            elif self.applicant.applicant_id.startswith('dsh'): # easier to test
-                self.institution_acct = '1014847058'
-                self.institution_bank_id = '7'
-            elif self.applicant.__parent__.prefix in ('ver', 'send'):
-                provider_amt = 0.0
-            elif self.applicant.__parent__.prefix == 'fedex':
-                provider_amt = 0.0
-                self.institution_acct = '0001115694'
-                self.institution_bank_id = '10'
-            elif self.applicant.applicant_id.startswith('pg'):
-                self.institution_acct = '5210006575'
-                self.institution_bank_id = '51'
-
-        xmldict = {}
+        if self.applicant.applicant_id.startswith('trans'):
+            provider_amt = 3000.0
+        xmldict['institution_acct'] = '00000000'
+        xmldict['institution_bank_id'] = '00'
         xmldict['detail_ref'] = self.context.p_id
         xmldict['provider_amt'] = 100 * provider_amt
-        xmldict['provider_acct'] = self.provider_acct
-        xmldict['provider_bank_id'] = self.provider_bank_id
+        xmldict['provider_acct'] = PROVIDER_ACCT
+        xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        xmldict['institution_acct'] = self.institution_acct
-        xmldict['institution_bank_id'] = self.institution_bank_id
-        xmldict['institution_item_name'] = self.category
+        xmldict['institution_item_name'] = self.context.category
         xmldict['institution_name'] = INSTITUTION_NAME
-        xmldict['fedex_amt'] = 100 * fedex_amt
-        xmldict['institution_amt'] = 100 * (
-            self.context.amount_auth - provider_amt - fedex_amt - GATEWAY_AMT)
-
+        xmldict['institution_amt'] = 100 * self.context.net_amt
+        if not self.context.provider_amt:
+            self.context.provider_amt = provider_amt
+            self.context.amount_auth += provider_amt
         xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
@@ -173,37 +135,5 @@
 </item_details>
 </payment_item_detail>""" % xmldict
-
-        if provider_amt == 0.0:
-            xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-        if fedex_amt:
-            xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="FedEx" item_amt="%(fedex_amt)d" bank_id="10" acct_num="0001115694" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-        if self.applicant.applicant_id.startswith('pg'):
-            handbook_amount = 2000.0
-            xmldict['handbook_amount'] = 100 * handbook_amount
-            xmldict['institution_amt'] = 100 * (
-                self.context.amount_auth - provider_amt - handbook_amount -GATEWAY_AMT)
-            xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="PG Handbook" item_amt="%(handbook_amount)d" bank_id="51" acct_num="5210006575" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
-        self.context.provider_amt = provider_amt
-        self.context.gateway_amt = GATEWAY_AMT
         xmlitems = ''
         xmldoc = minidom.parseString(xmltext)
@@ -221,11 +151,10 @@
         hashargs = (
             self.context.p_id +
-            self.product_id +
+            PRODUCT_ID +
             self.pay_item_id +
             str(int(self.amount_auth)) +
             self.site_redirect_url +
-            self.mac)
+            MAC)
         self.hashvalue = hashlib.sha512(hashargs).hexdigest()
-
         return
 
@@ -238,7 +167,12 @@
     site_name = SITE_NAME
     currency = CURRENCY
-    pay_item_id = '000'
+    pay_item_id = '101'
 
     def update(self):
+        if not module_activated(
+            self.context.student.current_session, self.context):
+            self.flash(_('Forbidden'), type='danger')
+            self.redirect(self.url(self.context, '@@index'))
+            return
         error = self.init_update()
         if error:
@@ -246,410 +180,129 @@
             self.redirect(self.url(self.context, '@@index'))
             return
-        self.context.r_company = u'interswitch'
+        category = self.context.p_category
+        # Already now it becomes an Interswitch payment. We set the net amount
+        # and add the gateway amount.
+        if not self.context.r_company:
+            self.context.net_amt = self.context.amount_auth
+            self.context.amount_auth += GATEWAY_AMT
+            self.context.gateway_amt = GATEWAY_AMT
+            self.context.r_company = u'interswitch'
         student = self.student
-        p_session = self.context.p_session
-        try:
-            academic_session = grok.getSite()['configuration'][str(p_session)]
-        except KeyError:
-            self.flash(_(u'Session configuration object is not available.'),
-                       type='danger')
-            self.redirect(self.url(self.context, '@@index'))
-            return
-        if contr_agreement_student(student) == 'first':
-            self.product_id = PRODUCT_ID_PT
-            self.mac = MAC_PT
-        else:
-            self.product_id = PRODUCT_ID_REGULAR
-            self.mac = MAC_REGULAR
-
-        # To guarantee that cleared students pay both acceptance fee
-        # and school fees, the page can only be accessed
-        # for school fee payments if acceptance/clearance fee has
-        # been successfully queried/paid beforehand. This
-        # requirement applies to students in state 'cleared' and
-        # entry_session greater than 2012 only.
-        if self.context.p_category.startswith('schoolfee') and \
-            student.state == CLEARED and \
-            student.entry_session > 2012:
-            acceptance_fee_paid = False
-            for ticket in student['payments'].values():
-                if ticket.p_state == 'paid' and \
-                    ticket.p_category.startswith('clearance'):
-                    acceptance_fee_paid = True
-                    break
-            if not acceptance_fee_paid:
-                self.flash(
-                    _('Please pay acceptance fee first.'), type="danger")
-                self.redirect(self.url(self.context, '@@index'))
-                return
-
         xmldict = self.xmldict
-        xmltext = ""
-        xmldict['institution_acct'] = '1010827641'
-        xmldict['institution_bank_id'] = '117'
+        # Provider data
         xmldict['detail_ref'] = self.context.p_id
         xmldict['provider_acct'] = PROVIDER_ACCT
         xmldict['provider_bank_id'] = PROVIDER_BANK_ID
         xmldict['provider_item_name'] = PROVIDER_ITEM_NAME
-        xmldict['institution_item_name'] = self.category
+        # Institution data
+        xmldict['institution_acct'] = '00000000'
+        xmldict['institution_bank_id'] = '00'
+        provider_amt = 0.0
+        if category.startswith('clearance'):
+            provider_amt = 1500.0
+        elif category.startswith('hostel_maintenance'):
+            provider_amt = 1000.0
+        elif category in ('schoolfee', 'schoolfee_1', 'schoolfee_incl'):
+            provider_amt = 2500.0
+        xmldict['provider_amt'] = 100 * provider_amt
+        xmldict['institution_item_name'] = self.context.category
         xmldict['institution_name'] = INSTITUTION_NAME
-        provider_amt = 0.0
-        xmldict['institution_amt'] = 100 * (
-            gateway_net_amt(self.context.amount_auth))
-
-        # Schoolfee
-        if self.context.p_category.startswith('schoolfee'):
-            if contr_agreement_student(student) == 'first':
-                # First agreement
-                provider_amt = 1900.0
-                joint_venture_amt = 0.0
-                aaue_share_amt = 0.0
-                student_union_due_amt = gateway_net_amt(
-                    academic_session.union_fee)
-                student_welfare_assurance_amt = gateway_net_amt(
-                    academic_session.welfare_fee)
-                sports_amt = gateway_net_amt(
-                    academic_session.sports_fee)
-                library_amt = gateway_net_amt(
-                    academic_session.library_fee)
-                library_amt_pg = gateway_net_amt(
-                    academic_session.library_pg_fee)
-                lms_sund_amt = gateway_net_amt(
-                    academic_session.lms_sund_fee)
-                xmldict['student_union_bank_id'] = '31'
-                xmldict['student_union_acct'] = '0051005007'
-                xmldict['aaue_share_bank_id'] = '117'
-                xmldict['aaue_share_acct'] = '1010827641'
-                xmldict['joint_venture_bank_id'] = '117'
-                xmldict['joint_venture_acct'] = '1010827641'
-                xmldict['institution_acct'] = '1014847058'
-                xmldict['institution_bank_id'] = '7'
-                self.pay_item_id = '105'
-                if student.current_mode == 'found':
-                    self.pay_item_id = '103'
-                elif student.current_mode == 'ijmbe':
-                    self.pay_item_id = '103'
-                    xmldict['institution_bank_id'] = '123'
-                    xmldict['institution_acct'] = '1012278272'
+        xmldict['institution_amt'] = 100 * self.context.net_amt
+        if not self.context.provider_amt:
+            self.context.provider_amt = provider_amt
+            self.context.amount_auth += provider_amt
+        xmltext = ''
+
+        # School fee
+        if category.startswith('schoolfee'):
+            # collect additional fees
+            if self.context.p_category in ('schoolfee_1', 'schoolfee_incl'):
+                xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">""" % xmldict
+                item_id = 1
+                for item in SCHOOLFEES[student.certcode].items():
+                    try:
+                        item_amt = 100 * int(item[1])
+                        if self.context.p_category == 'schoolfee_1' and item[0] == 'tuition':
+                            item_amt /= 2
+                        acct_num = ''
+                        bank_id = ''
+                        item_name = ''
+                        # Find appropriate bank
+                        try:
+                            bank = BANK_ACCOUNTS[item[0]]
+                        except: # transfer to faculty account
+                            if student.faccode in ('FAG', 'FAT', 'FBM', 'FMLS', 'fac1'):
+                                bank = BANK_ACCOUNTS['fac1']
+                            elif student.faccode in ('FCS', 'FED', 'FES', 'FET'):
+                                bank = BANK_ACCOUNTS['fac2']
+                            elif student.faccode in ('FLS', 'FLW', 'FMS', 'FPS', 'FSS'):
+                                bank = BANK_ACCOUNTS['fac3']
+                        acct_num = bank[0]
+                        bank_id = bank[1]
+                        item_name = "%s (%s)" % (bank[2], item[0])
+                        xmltext += """
+<item_detail item_id="%s" item_name="%s" item_amt="%d" bank_id="%s" acct_num="%s" />""" % (item_id, item_name, item_amt, bank_id, acct_num)
+                        item_id += 1
+                    except:
+                        pass
+                xmldict['item_id'] = item_id
+                xmltext += """
+<item_detail item_id="%(item_id)d" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+            # no additional charges, determine faculty bank only
             else:
-                # Second agreement
-                joint_venture_amt = 1000.0
-                aaue_share_amt = 1500.0
-                provider_amt = 1500.0
-                student_union_due_amt = gateway_net_amt(
-                    academic_session.union_fee)
-                student_welfare_assurance_amt = gateway_net_amt(
-                    academic_session.welfare_fee)
-                sports_amt = gateway_net_amt(
-                    academic_session.sports_fee)
-                library_amt = gateway_net_amt(
-                    academic_session.library_fee)
-                library_amt_pg = gateway_net_amt(
-                    academic_session.library_pg_fee)
-                lms_sund_amt = gateway_net_amt(
-                    academic_session.lms_sund_fee)
-                xmldict['student_union_bank_id'] = '7'
-                xmldict['student_union_acct'] = '1019763348'
-                xmldict['aaue_share_bank_id'] = '117'
-                xmldict['aaue_share_acct'] = '1010827641'
-                xmldict['joint_venture_bank_id'] = '117'
-                xmldict['joint_venture_acct'] = '1010827641'
-                self.pay_item_id = '107'
-                if student.is_postgrad:
-                    self.pay_item_id = '111'
-                    xmldict['institution_acct'] = '5210006575'
-                    xmldict['institution_bank_id'] = '51'
-
-            xmldict['provider_amt'] = 100 * provider_amt
-            xmldict['joint_venture_amt'] = 100 * joint_venture_amt
-            xmldict['aaue_share_amt'] = 100 * aaue_share_amt
-            xmldict['lms_sund_amt'] = 100 * lms_sund_amt
-            if self.context.p_item == 'Balance':
-                xmldict['institution_amt'] = 100 * (
-                    gateway_net_amt(self.context.amount_auth))
-            elif self.context.p_category == 'schoolfee_2':
-                xmldict['institution_amt'] = 100 * gateway_net_amt(
-                    self.context.amount_auth)
+                if student.faccode in ('FAG', 'FAT', 'FBM', 'FMLS', 'fac1'):
+                    bank = BANK_ACCOUNTS['fac1']
+                elif student.faccode in ('FCS', 'FED', 'FES', 'FET'):
+                    bank = BANK_ACCOUNTS['fac2']
+                elif student.faccode in ('FLS', 'FLW', 'FMS', 'FPS', 'FSS'):
+                    bank = BANK_ACCOUNTS['fac3']
+                xmldict['institution_acct'] = bank[0]
+                xmldict['institution_bank_id'] = bank[1]
+
+
+        # Clearance (acceptance) fee
+
+        if category.startswith('clearance'):
+            # collect additional fees
+            if self.context.p_category == 'clearance_incl':
                 xmltext = """<payment_item_detail>
+<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">""" % xmldict
+                item_id = 1
+                for item in ACCEPTANCEFEES[student.certcode].items():
+                    try:
+                        item_amt = 100 * int(item[1])
+                        bank = BANK_ACCOUNTS[item[0]]
+                        acct_num = bank[0]
+                        bank_id = bank[1]
+                        item_name = "%s (%s)" % (bank[2], item[0])
+                        xmltext += """
+<item_detail item_id="%s" item_name="%s" item_amt="%d" bank_id="%s" acct_num="%s" />""" % (item_id, item_name, item_amt, bank_id, acct_num)
+                        item_id += 1
+                    except:
+                        pass
+                xmldict['item_id'] = item_id
+                xmltext += """
+<item_detail item_id="%(item_id)d" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
+</item_details>
+</payment_item_detail>""" % xmldict
+            # no additional charges, determine faculty bank only
+            else:
+                bank = BANK_ACCOUNTS['acceptance']
+                xmldict['institution_acct'] = bank[0]
+                xmldict['institution_bank_id'] = bank[1]
+
+        # Other fees
+
+
+        if not xmltext and provider_amt == 0:
+            xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
 <item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
 </item_details>
 </payment_item_detail>""" % xmldict
-            elif self.context.p_category in ('schoolfee_incl', 'schoolfee_1') \
-                and student.current_mode != 'ijmbe':
-                # Schoolfee including additional fees
-                xmldict['student_union_due_amt'] = 100 * student_union_due_amt
-                xmldict['student_welfare_assurance_amt'] = 100 * student_welfare_assurance_amt
-
-                if student.entry_session >= 2018 and student.is_fresh:
-                    xmldict['sports_amt'] = 100 * sports_amt
-                    if student.is_postgrad:
-                        xmldict['library_amt'] = 100 * library_amt_pg
-                    else:
-                        xmldict['library_amt'] = 100 * library_amt
-                    xmldict['institution_amt'] = 100 * (
-                        gateway_net_amt(self.context.amount_auth)
-                        - provider_amt
-                        - student_union_due_amt
-                        - student_welfare_assurance_amt
-                        - sports_amt
-                        - library_amt
-                        - lms_sund_amt)
-                    xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
-<item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="5" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="6" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />
-</item_details>
-</payment_item_detail>""" % xmldict
-                    if contr_agreement_student(student) == 'second':
-                        xmldict['institution_amt'] = 100 * (
-                            gateway_net_amt(self.context.amount_auth)
-                            - provider_amt
-                            - joint_venture_amt
-                            - aaue_share_amt
-                            - student_union_due_amt
-                            - student_welfare_assurance_amt
-                            - sports_amt
-                            - library_amt) 
-                        xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
-<item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="5" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="6" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />
-<item_detail item_id="7" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" />
-<item_detail item_id="8" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-                    if student.entry_session >= 2021 and student.current_mode == 'ug_ft':
-                        xmldict['institution_amt'] = 100 * (
-                            gateway_net_amt(self.context.amount_auth)
-                            - provider_amt
-                            - joint_venture_amt
-                            - aaue_share_amt
-                            - student_union_due_amt
-                            - student_welfare_assurance_amt
-                            - sports_amt
-                            - library_amt
-                            - lms_sund_amt)  
-                        xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
-<item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="5" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="6" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />
-<item_detail item_id="7" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" />
-<item_detail item_id="8" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" />
-<item_detail item_id="9" item_name="LMS plus Sundry Fees" item_amt="%(lms_sund_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-                else:
-                    xmldict['institution_amt'] = 100 * (
-                        gateway_net_amt(self.context.amount_auth)
-                        - provider_amt
-                        - student_union_due_amt
-                        - student_welfare_assurance_amt)
-                    xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
-<item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />
-</item_details>
-</payment_item_detail>""" % xmldict
-                    if contr_agreement_student(student) == 'second':
-                        xmldict['institution_amt'] = 100 * (
-                            gateway_net_amt(self.context.amount_auth)
-                            - provider_amt
-                            - joint_venture_amt
-                            - aaue_share_amt
-                            - student_union_due_amt
-                            - student_welfare_assurance_amt)                    
-                        xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Student Union" item_amt="%(student_union_due_amt)d" bank_id="%(student_union_bank_id)s" acct_num="%(student_union_acct)s" />
-<item_detail item_id="4" item_name="Student Welfare Assurance" item_amt="%(student_welfare_assurance_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="5" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" />
-<item_detail item_id="6" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-            elif contr_agreement_student(student) == 'second':
-                # Schoolfee without Student Union Fee ands Student Welfare Assurance
-                xmldict['institution_amt'] = 100 * (
-                    gateway_net_amt(self.context.amount_auth)
-                    - provider_amt
-                    - joint_venture_amt
-                    - aaue_share_amt)
-                xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-<item_detail item_id="3" item_name="Joint Venture" item_amt="%(joint_venture_amt)d" bank_id="%(joint_venture_bank_id)s" acct_num="%(joint_venture_acct)s" />
-<item_detail item_id="4" item_name="AAUE Share" item_amt="%(aaue_share_amt)d" bank_id="%(aaue_share_bank_id)s" acct_num="%(aaue_share_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-            else:
-                xmldict['institution_amt'] = 100 * (
-                    gateway_net_amt(self.context.amount_auth)
-                    - provider_amt)
-                xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-        # Clearance
-        elif self.context.p_category.startswith('clearance'):
-            xmldict['institution_acct'] = '1010835352'
-            provider_amt = 0.0
-            if contr_agreement_student(student) == 'first':
-                # First agreement
-                xmldict['institution_acct'] = '1014847058'
-                xmldict['institution_bank_id'] = '7'
-                self.pay_item_id = '104'
-                if student.current_mode == 'found':
-                    self.pay_item_id = '102'
-                elif student.current_mode == 'ijmbe':
-                    self.pay_item_id = '102'
-                    xmldict['institution_bank_id'] = '123'
-                    xmldict['institution_acct'] = '1012278272'
-            else:
-                # Second agreement
-                self.pay_item_id = '102'
-                if student.is_postgrad:
-                    self.pay_item_id = '110'
-                    xmldict['institution_acct'] = '5210006575'
-                    xmldict['institution_bank_id'] = '51'
-                # ivama: Acceptance fee split is unique to "ug_ft"
-                # The reason for split is perculiar to them only...
-                # That amount was deducted from UTME application fee because
-                # some regulatory body have pegged the application fee which
-                # didn't affect another programmes.
-                if student.current_mode == 'ug_ft':
-                    provider_amt = 1500.0
-            xmldict['provider_amt'] = 100 * provider_amt
-            if self.context.p_category.endswith('_incl'):
-                # Clearance including additional fees
-                gown_fee_amt = gateway_net_amt(academic_session.matric_gown_fee)
-                aaue_lf_fee_amt = gateway_net_amt(academic_session.lapel_fee)
-                xmldict['gown_fee_amt'] = 100 * gown_fee_amt
-                xmldict['aaue_lf_fee_amt'] = 100 * aaue_lf_fee_amt
-                xmldict['institution_amt'] = 100 * (
-                    gateway_net_amt(self.context.amount_auth)
-                    - gown_fee_amt
-                    - aaue_lf_fee_amt
-                    - provider_amt)
-                xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-<item_detail item_id="2" item_name="Matriculation Gown Fee" item_amt="%(gown_fee_amt)d" bank_id="117" acct_num="1010835352" />
-<item_detail item_id="3" item_name="AAU File-Lapel Fee" item_amt="%(aaue_lf_fee_amt)d" bank_id="117" acct_num="1010835352" />""" % xmldict
-                if provider_amt:
-                    xmltext += """"
-<item_detail item_id="4" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-                else:
-                    xmltext += """"
-</item_details>
-</payment_item_detail>"""
-
-            elif student.current_mode == 'bridge':
-                # Clearance without any surcharge
-                xmldict['institution_amt'] = 100 * gateway_net_amt(
-                    self.context.amount_auth)
-                xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-            else:
-                # Clearance without additional fees
-                xmldict['institution_amt'] = 100 * (
-                    gateway_net_amt(self.context.amount_auth)
-                    - provider_amt)
-                xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />""" % xmldict
-                if provider_amt:
-                        xmltext += """"
-<item_detail item_id="2" item_name="%(provider_item_name)s" item_amt="%(provider_amt)d" bank_id="%(provider_bank_id)s" acct_num="%(provider_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
-                else:
-                        xmltext += """"
-</item_details>
-</payment_item_detail>""" 
-
-        # Union Dues
-        elif self.context.p_category == 'union':
-            self.pay_item_id = '103'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-            if contr_agreement_student(student) == 'first':
-                # First agreement
-                xmldict['institution_acct'] = '0051005007'
-                xmldict['institution_bank_id'] = '31'
-            else:
-                # Second agreement
-                xmldict['institution_bank_id'] = '7'
-                xmldict['institution_acct'] = '1019763348'
-
-        # Lapel/File
-        elif self.context.p_category == 'lapel':
-            self.pay_item_id = '104'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Welfare Assurance
-        elif self.context.p_category == 'welfare':
-            self.pay_item_id = '105'
-            xmldict['institution_acct'] = '1006407792'
-            xmldict['institution_bank_id'] = '123'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # ID Card
-        elif self.context.p_category == 'id_card':
-            self.pay_item_id = '000'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Matric Gown
-        elif self.context.p_category == 'matric_gown':
-            self.pay_item_id = '106'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Concessional
-        elif self.context.p_category == 'concessional':
-            self.pay_item_id = '107'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Hostel Maintenance
-        elif self.context.p_category == 'hostel_maintenance':
-            provider_amt = 500.0
-            self.pay_item_id = '109'
-            xmldict['institution_acct'] = '1006406795'
-            xmldict['institution_bank_id'] = '123'
-            xmldict['provider_amt'] = 100 * provider_amt
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth) - provider_amt)
+        elif not xmltext:
             xmltext = """<payment_item_detail>
 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
@@ -658,122 +311,5 @@
 </item_details>
 </payment_item_detail>""" % xmldict
-
-        # GST Fees
-        elif self.context.p_category.startswith('gst_'):
-            if contr_agreement_student(student) == 'first':
-                self.pay_item_id = '115'
-            else:
-                self.pay_item_id = '116'
-            xmldict['institution_acct'] = '1010893123'
-            xmldict['institution_bank_id'] = '117'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # ENT Fees
-        elif self.context.p_category.startswith('ent_'):
-            if contr_agreement_student(student) == 'first':
-                self.pay_item_id = '114'
-            else:
-                self.pay_item_id = '118'
-            xmldict['institution_acct'] = '6220029828'
-            xmldict['institution_bank_id'] = '51'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Faculty and Departmental Dues
-        elif self.context.p_category == 'fac_dep':
-            xmldict['institution_acct'] = '1016425386'
-            xmldict['institution_bank_id'] = '117'
-            self.pay_item_id = '117'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Restitution Fee
-        elif self.context.p_category == 'restitution':
-            self.pay_item_id = '117'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Faculty Laboratory Due
-        elif self.context.p_category in ('lab_1', 'lab_2'):
-            xmldict['institution_acct'] = '1016425386'
-            xmldict['institution_bank_id'] = '117'
-            self.pay_item_id = '117'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Sports Fee
-        #elif self.context.p_category == 'sports':
-        #    self.pay_item_id = '105'
-        #    xmldict['institution_amt'] = 100 * (
-        #        gateway_net_amt(self.context.amount_auth))
-
-        # Library Fee
-        #elif self.context.p_category == 'library':
-        #    self.pay_item_id = '105'
-        #    xmldict['institution_amt'] = 100 * (
-        #        gateway_net_amt(self.context.amount_auth))
-
-        # Library PG Fee
-        #elif self.context.p_category == 'library_pg':
-        #    self.pay_item_id = '105'
-        #    xmldict['institution_amt'] = 100 * (
-        #        gateway_net_amt(self.context.amount_auth))
-
-        # Exam Fee
-        elif self.context.p_category == 'exam':
-            self.pay_item_id = '103'
-            xmldict['institution_acct'] = '1012278272'
-            xmldict['institution_bank_id'] = '123'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Access Card Fee
-        elif self.context.p_category == 'access_card':
-            self.pay_item_id = '103'
-            xmldict['institution_acct'] = '1012688013'
-            xmldict['institution_bank_id'] = '123'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # LMS + Sundry Fees
-        elif self.context.p_category == 'lms_sund':
-            self.pay_item_id = '103'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-
-        # Sports & Library Fee    temporarily in 2020
-        elif self.context.p_category == 'sports_library':
-            self.pay_item_id = '105'
-            xmldict['sports_amt'] = 100 * 3000.0
-            xmldict['library_amt'] = 100 * 1000.0
-            xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="Sports Development Fee" item_amt="%(sports_amt)d" bank_id="123" acct_num="1006407792" />
-<item_detail item_id="2" item_name="Library Development Fee" item_amt="%(library_amt)d" bank_id="8" acct_num="2000122995" />
-</item_details>
-</payment_item_detail>""" % xmldict
-
-        # Late Registration Fee
-        elif self.context.p_category == 'late_registration':
-            if contr_agreement_student(student) == 'first':
-                self.pay_item_id = '113'
-            else:
-                self.pay_item_id = '123'
-            xmldict['institution_amt'] = 100 * (
-                gateway_net_amt(self.context.amount_auth))
-            if student.is_postgrad:
-                xmldict['institution_acct'] = '5210006575'
-                xmldict['institution_bank_id'] = '51'
-        if not xmltext:
-            xmltext = """<payment_item_detail>
-<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
-<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" />
-</item_details>
-</payment_item_detail>""" % xmldict
         self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
-        self.context.provider_amt = provider_amt
-        self.context.gateway_amt = self.context.amount_auth - gateway_net_amt(
-            self.context.amount_auth)
         xmlitems = ''
         xmldoc = minidom.parseString(xmltext)
@@ -789,12 +325,13 @@
                 )
         self.context.p_split_data = xmlitems
+        self.context.provider_amt = provider_amt
         self.amount_auth = int(100 * self.context.amount_auth)
         hashargs = (
             self.context.p_id +
-            self.product_id +
+            PRODUCT_ID +
             self.pay_item_id +
             str(int(self.amount_auth)) +
             self.site_redirect_url +
-            self.mac)
+            MAC)
         self.hashvalue = hashlib.sha512(hashargs).hexdigest()
         return
@@ -810,16 +347,4 @@
     https = HTTPS
 
-    @property
-    def mac(self):
-        if contr_agreement_applicant(self.context.__parent__) == 'first':
-            return MAC_PT
-        return MAC_REGULAR
-
-    @property
-    def product_id(self):
-        if contr_agreement_applicant(self.context.__parent__) == 'first':
-            return PRODUCT_ID_PT
-        return PRODUCT_ID_REGULAR
-
 class CustomInterswitchPaymentVerifyWebservicePageApplicant(
     InterswitchPaymentVerifyWebservicePageApplicant):
@@ -830,16 +355,6 @@
     gateway_url = URL
     https = HTTPS
-
-    @property
-    def mac(self):
-        if contr_agreement_applicant(self.context.__parent__) == 'first':
-            return MAC_PT
-        return MAC_REGULAR
-
-    @property
-    def product_id(self):
-        if contr_agreement_applicant(self.context.__parent__) == 'first':
-            return PRODUCT_ID_PT
-        return PRODUCT_ID_REGULAR
+    mac = MAC
+    product_id = PRODUCT_ID
 
 class CustomInterswitchPaymentRequestWebservicePageStudent(
@@ -851,16 +366,6 @@
     gateway_url = URL
     https = HTTPS
-
-    @property
-    def mac(self):
-        if contr_agreement_student(self.context.student) == 'first':
-            return MAC_PT
-        return MAC_REGULAR
-
-    @property
-    def product_id(self):
-        if contr_agreement_student(self.context.student) == 'first':
-            return PRODUCT_ID_PT
-        return PRODUCT_ID_REGULAR
+    mac = MAC
+    product_id = PRODUCT_ID
 
 class CustomInterswitchPaymentVerifyWebservicePageStudent(
@@ -872,14 +377,4 @@
     gateway_url = URL
     https = HTTPS
-
-    @property
-    def mac(self):
-        if contr_agreement_student(self.context.student) == 'first':
-            return MAC_PT
-        return MAC_REGULAR
-
-    @property
-    def product_id(self):
-        if contr_agreement_student(self.context.student) == 'first':
-            return PRODUCT_ID_PT
-        return PRODUCT_ID_REGULAR
+    mac = MAC
+    product_id = PRODUCT_ID
Index: /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py	(revision 17431)
@@ -71,5 +71,5 @@
         self.browser.getControl("Save").click()
 
-    def test_interswitch_form_regular(self):
+    def deactivated_test_interswitch_form_regular(self):
         self.browser.getControl("Add online").click()
         self.assertTrue('ticket created' in self.browser.contents)
@@ -101,5 +101,5 @@
             in self.browser.contents)
 
-    def test_interswitch_form_pg(self):
+    def deactivated_test_interswitch_form_pg(self):
         self.applicant.applicant_id = u'pg_anything'
         self.browser.getControl("Add online").click()
@@ -135,5 +135,5 @@
             in self.browser.contents)
 
-    def test_interswitch_form_utme(self):
+    def deactivated_test_interswitch_form_utme(self):
         self.applicant.applicant_id = u'utme_anything'
         self.browser.getControl("Add online").click()
@@ -166,5 +166,5 @@
             in self.browser.contents)
 
-    def test_interswitch_form_bridge(self):
+    def deactivated_test_interswitch_form_bridge(self):
         self.applicant.applicant_id = u'bridge_xyz'
         self.browser.getControl("Add online").click()
@@ -205,5 +205,5 @@
         self.app['configuration']['2004'].interswitch_enabled = True
 
-    def test_interswitch_form_pt_school_fees(self):
+    def disabled_test_interswitch_form_pt_school_fees(self):
         self.certificate.study_mode = 'ug_pt'
         self.student['studycourse'].entry_session = 2013
@@ -232,6 +232,4 @@
         self.student['payments']['xyz'] = acc_payment
         self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="105" />'
-                        in self.browser.contents)
         self.assertTrue('Total Amount Authorized:' in self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_pt')
@@ -246,6 +244,6 @@
     def test_interswitch_form_regular_school_fees(self):
         self.certificate.study_mode = 'ug_ft'
-        self.student['studycourse'].entry_session = 2013
-        self.student['studycourse'].certificate.school_fee_3 = 51750.0
+        #self.student['studycourse'].entry_session = 2013
+        #self.student['studycourse'].certificate.school_fee_3 = 51750.0
         # Manager can access InterswitchForm
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -260,27 +258,70 @@
         self.assertTrue('Amount Authorized' in
                            self.browser.contents)
-        self.assertTrue('<span>51750.0</span>' in self.browser.contents)
-        self.payment_url = self.browser.url
-        self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue(
-            'Please pay acceptance fee first' in self.browser.contents)
-        acc_payment = createObject('waeup.StudentOnlinePayment')
-        acc_payment.p_state = 'paid'
-        acc_payment.p_category = 'clearance'
-        self.student['payments']['xyz'] = acc_payment
-        self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="107" />'
-                        in self.browser.contents)
+        self.assertTrue('<span>239500.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        #self.assertTrue(
+        #    'Please pay acceptance fee first' in self.browser.contents)
+        #acc_payment = createObject('waeup.StudentOnlinePayment')
+        #acc_payment.p_state = 'paid'
+        #acc_payment.p_category = 'clearance'
+        #self.student['payments']['xyz'] = acc_payment
+        #self.browser.getLink("Pay via Interswitch", index=0).click()
         self.assertTrue('Total Amount Authorized:'
                         in self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_ft')
         self.assertTrue(
-            '<input type="hidden" name="amount" value="5175000" />'
-            in self.browser.contents)
-        self.assertTrue(
-            'item_name="School Fee Plus" item_amt="4755000" bank_id="117" '
-            'acct_num="1010827641"' in self.browser.contents)
-
-    def test_interswitch_form_pt_acceptance_fees(self):
+            '<input type="hidden" name="amount" value="24220000" />'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="Faculty Fee (tuition)" item_amt="18400000" bank_id="7" '
+            'acct_num="1022438743"' in self.browser.contents)
+
+        self.student['studycourse'].entry_session = 2015
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
+        self.browser.getControl("Create ticket").click()
+        self.assertTrue('ticket created' in
+                           self.browser.contents)
+        self.assertTrue('<span>92000.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="9220000" />'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="School Fee (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
+
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
+        self.browser.getControl("Create ticket").click()
+        self.assertTrue('ticket created' in
+                           self.browser.contents)
+        self.assertTrue('<span>147500.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="15020000" />'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="Faculty Fee (lmsplus)" item_amt="2000000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
+        self.assertTrue(
+            'item_name="Faculty Fee (tuition)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
+
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
+        self.browser.getControl("Create ticket").click()
+        self.assertTrue('ticket created' in
+                           self.browser.contents)
+        self.assertTrue('<span>92000.0</span>' in self.browser.contents)
+        self.payment_url = self.browser.url
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="9220000" />'
+            in self.browser.contents)
+        self.assertTrue(
+            'item_name="School Fee (2nd instalment)" item_amt="9200000" bank_id="7" acct_num="1022438743"' in self.browser.contents)
+
+    def disabled_test_interswitch_form_pt_acceptance_fees(self):
         self.certificate.study_mode = 'ug_pt'
         self.app['configuration']['2004'].clearance_fee_ug_pt = 40200.0
@@ -301,6 +342,4 @@
         self.payment_url = self.browser.url
         self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="104" />' in
-                           self.browser.contents)
         self.assertTrue('Total Amount Authorized:' in self.browser.contents)
         self.assertTrue(
@@ -314,5 +353,5 @@
     def test_interswitch_form_regular_acceptance_fees(self):
         self.certificate.study_mode = 'ug_ft'
-        self.app['configuration']['2004'].clearance_fee = 43050.0
+        #self.app['configuration']['2004'].clearance_fee = 43050.0
         # Manager can access InterswitchForm
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -325,18 +364,33 @@
         self.assertTrue('ticket created' in self.browser.contents)
         self.assertTrue('Amount Authorized' in self.browser.contents)
-        self.assertTrue('<span>43050.0</span>' in self.browser.contents)
-        self.payment_url = self.browser.url
-        self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="102" />'
-                        in self.browser.contents)
-        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
-        self.assertTrue(
-            '<input type="hidden" name="amount" value="4305000" />'
-            in self.browser.contents)
-        self.assertTrue(
-            'item_name="Acceptance Fee Plus" item_amt="4135000" bank_id="117" '
-            'acct_num="1010835352"' in self.browser.contents)
-
-    def test_interswitch_form_concessional_fees(self):
+        self.assertTrue('<span>16800.0</span>' in self.browser.contents)
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="1850000" />'
+            in self.browser.contents)
+        self.assertTrue(self.student['payments'].values()[0].net_amt == 16800)
+        self.assertTrue(
+            'item_name="Acceptance Fee (acceptance)" item_amt="1400000" bank_id="8" '
+            'acct_num="2000249757"' in self.browser.contents)
+
+        self.certificate.study_mode = 'bridge'
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['clearance']
+        self.browser.getControl("Create ticket").click()
+        self.assertTrue('ticket created' in self.browser.contents)
+        self.assertTrue('Amount Authorized' in self.browser.contents)
+        self.assertTrue('<span>14000.0</span>' in self.browser.contents)
+        self.browser.getLink("Pay via Interswitch", index=0).click()
+        self.assertTrue('Total Amount Authorized:' in self.browser.contents)
+        self.assertTrue(
+            '<input type="hidden" name="amount" value="1570000" />'
+            in self.browser.contents)
+        self.assertTrue(self.student['payments'].values()[1].net_amt == 14000)
+        self.assertTrue(
+            'item_name="Acceptance Fee" item_amt="1400000" bank_id="8" '
+            'acct_num="2000249757"' in self.browser.contents)
+
+    def deactivated_test_interswitch_form_concessional_fees(self):
         self.certificate.study_mode = 'ug_ft'
         self.app['configuration']['2004'].concessional_fee = 1567.0
@@ -356,6 +410,4 @@
         self.certificate.study_mode = 'ug_ft'
         self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="107" />'
-                           in self.browser.contents)
         self.assertTrue('Total Amount Authorized:' in self.browser.contents)
         self.assertTrue(
@@ -367,5 +419,5 @@
             in self.browser.contents)
 
-    def test_interswitch_form_ticket_expired(self):
+    def deactivated_test_interswitch_form_ticket_expired(self):
         self.certificate.study_mode = 'ug_pt'
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -380,6 +432,4 @@
         self.browser.open(self.payments_path + '/xyz')
         self.browser.getLink("Pay via Interswitch", index=0).click()
-        self.assertTrue('<input type="hidden" name="pay_item_id" value="104" />'
-                        in self.browser.contents)
         self.assertTrue('Total Amount Authorized:' in self.browser.contents)
         self.assertEqual(self.student.current_mode, 'ug_pt')
Index: /main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po	(revision 17431)
@@ -127,13 +127,13 @@
 #: school_fee_1
 msgid "Initial School Fee"
-msgstr "Current School Fees"
+msgstr "School Fees 1 (not used)"
 
 #: school_fee_2
 msgid "Returning School Fee"
-msgstr "School Fees 2015-2020"
+msgstr "School Fees 2 (not used)"
 
 #: school_fee_3
 msgid "Foreigner Initial School Fee"
-msgstr "School Fees till 2015"
+msgstr "School Fees 3 (not used)"
 
 #: school_fee_4
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/acceptancefees.csv
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/acceptancefees.csv	(revision 17431)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/acceptancefees.csv	(revision 17431)
@@ -0,0 +1,95 @@
+code,faculty_code,department_code,session,acceptance,matricgown,lapel
+CERT1,FAG,ANS,#2022,14000,2000,800
+BAGRANS,FAG,ANS,#2022,62400,2000,800
+BAGRCRS,FAG,CRS,#2022,62400,2000,800
+BAGREES,FAG,EES,#2022,62400,2000,800
+BAGRSOS,FAG,SOS,#2022,62400,2000,800
+BAENG,FAT,ENG,#2022,62400,2000,800
+BAFRN,FAT,FRN,#2022,62400,2000,800
+BAHIS,FAT,HIS,#2022,62400,2000,800
+BAISD,FAT,HIS,#2022,62400,2000,800
+BAMAC,FAT,MAC,#2022,62400,2000,800
+BAPHI,FAT,PHI,#2022,62400,2000,800
+BARCS,FAT,RCS,#2022,62400,2000,800
+BARST,FAT,RCS,#2022,62400,2000,800
+BATMA,FAT,TMA,#2022,62400,2000,800
+BSCANA,FBM,ANA,#2022,62400,2000,800
+BMLS,FBM,MLS,#2022,67400,2000,800
+BMLSCHMP,FBM,MLS,#2022,67400,2000,800
+BMLSHBTS,FBM,MLS,#2022,67400,2000,800
+BMLSHIST,FBM,MLS,#2022,67400,2000,800
+BMLSMMCB,FBM,MLS,#2022,67400,2000,800
+BSCNSG,FBM,NSG,#2022,67400,2000,800
+BSCPHS,FBM,PHS,#2022,62400,2000,800
+BSCPYS,FBM,PYS,#2022,62400,2000,800
+MBBS,FCS,MED,#2022,77400,2000,800
+BEDACC,FED,BED,#2022,62400,2000,800
+BEDOTM,FED,BED,#2022,62400,2000,800
+BEDSEC,FED,BED,#2022,62400,2000,800
+BEDBIO,FED,CAI,#2022,62400,2000,800
+BEDCHM,FED,CAI,#2022,62400,2000,800
+BEDCSC,FED,CAI,#2022,62400,2000,800
+BEDENG,FED,CAI,#2022,62400,2000,800
+BEDFRN,FED,CAI,#2022,62400,2000,800
+BEDMTH,FED,CAI,#2022,62400,2000,800
+BEDPHY,FED,CAI,#2022,62400,2000,800
+BEDPPE,FED,CAI,#2022,62400,2000,800
+BEDSSE,FED,CAI,#2022,62400,2000,800
+CAI,FED,CAI,#2022,62400,2000,800
+BEDEDM,FED,EFM,#2022,62400,2000,800
+BEDHIS,FED,EFM,#2022,62400,2000,800
+BEDRSE,FED,EFM,#2022,62400,2000,800
+EFM,FED,EFM,#2022,62400,2000,800
+BEDECO,FED,GAC,#2022,62400,2000,800
+BEDGAC,FED,GAC,#2022,62400,2000,800
+BEDGEO,FED,GAC,#2022,62400,2000,800
+BEDPOL,FED,GAC,#2022,62400,2000,800
+BEDHED,FED,HKH,#2022,62400,2000,800
+BEDHKE,FED,HKH,#2022,62400,2000,800
+BEDPHE,FED,HKH,#2022,62400,2000,800
+BSCLIS,FED,LIS,#2022,62400,2000,800
+BEDAGR,FED,VTE,#2022,62400,2000,800
+BEDHECO,FED,VTE,#2022,62400,2000,800
+BEDTEC,FED,VTE,#2022,62400,2000,800
+VTE,FED,VTE,#2022,62400,2000,800
+BSCARC,FES,ARC,#2022,62400,2000,800
+BSCBLD,FES,BLD,#2022,62400,2000,800
+BFA,FES,FAA,#2022,62400,2000,800
+BFAGRH,FES,FAA,#2022,62400,2000,800
+BFAPNT,FES,FAA,#2022,62400,2000,800
+BFASC,FES,FAA,#2022,62400,2000,800
+BFATD,FES,FAA,#2022,62400,2000,800
+BSCFAA,FES,FAA,#2022,62400,2000,800
+BSCGEM,FES,GEM,#2022,62400,2000,800
+BSCGRP,FES,GEM,#2022,62400,2000,800
+BENGAGE,FET,AGE,#2022,62400,2000,800
+BENGCIE,FET,CIE,#2022,62400,2000,800
+BENGELE,FET,ELE,#2022,62400,2000,800
+BENGIPE,FET,IPE,#2022,62400,2000,800
+BENGMPE,FET,IPE,#2022,62400,2000,800
+BENGPE,FET,IPE,#2022,62400,2000,800
+BENGMEE,FET,MEE,#2022,62400,2000,800
+BENGMME,FET,MME,#2022,62400,2000,800
+BSCBCH,FLS,BCH,#2022,62400,2000,800
+BSCBOT,FLS,BOT,#2022,62400,2000,800
+BSCHND,FLS,HND,#2022,62400,2000,800
+BSCMCB,FLS,MCB,#2022,62400,2000,800
+BSCPSB,FLS,PSB,#2022,62400,2000,800
+BSCZOO,FLS,ZOO,#2022,62400,2000,800
+LLB,FLW,LAW,#2022,67400,2000,800
+BSCACC,FMS,ACC,#2022,62400,2000,800
+BSCBAF,FMS,BAF,#2022,62400,2000,800
+BSCBUS,FMS,BUS,#2022,62400,2000,800
+BSCPUB,FMS,PUB,#2022,62400,2000,800
+BSCCHM,FPS,CHM,#2022,62400,2000,800
+BSCICH,FPS,CHM,#2022,62400,2000,800
+BSCCSC,FPS,CSC,#2022,62400,2000,800
+BSCIMTH,FPS,MTH,#2022,62400,2000,800
+BSCMTH,FPS,MTH,#2022,62400,2000,800
+BSCSTA,FPS,MTH,#2022,62400,2000,800
+BSCAPHY,FPS,PHY,#2022,62400,2000,800
+BSCPHY,FPS,PHY,#2022,62400,2000,800
+BSCECO,FSS,ECO,#2022,62400,2000,800
+BSCPOL,FSS,POL,#2022,62400,2000,800
+BSCPSY,FSS,PSY,#2022,62400,2000,800
+BSCSOC,FSS,SOC,#2022,62400,2000,800
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 17431)
@@ -90,5 +90,4 @@
     ICustomStudentBase,
     ICustomStudentStudyCourse)
-from waeup.aaue.interswitch.browser import gateway_net_amt
 from waeup.aaue.interfaces import MessageFactory as _
 
@@ -340,6 +339,4 @@
         if self.context.p_category in ('schoolfee_incl', 'schoolfee_1') \
             and academic_session:
-            #welfare_fee = gateway_net_amt(academic_session.welfare_fee)
-            #union_fee = gateway_net_amt(academic_session.union_fee)
             if self.context.student.entry_session == 2016 \
                 and self.context.student.entry_mode == 'ug_ft' \
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/schoolfees.csv
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/schoolfees.csv	(revision 17431)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/schoolfees.csv	(revision 17431)
@@ -0,0 +1,95 @@
+code,faculty_code,department_code,session,tuition,edohis,union,access,notebook,sport,library,lmsplus,nuga
+CERT1,FAG,ANS,#2022,184000,16000,1000,4500,9000,3000,1000,20000,1000
+BAGRANS,FAG,ANS,#2022,184000,16000,1000,4500,9000,3000,1000,20000,1000
+BAGRCRS,FAG,CRS,#2022,184000,16000,1000,4500,9000,3000,1000,20000,1000
+BAGREES,FAG,EES,#2022,184000,16000,1000,4500,9000,3000,1000,20000,1000
+BAGRSOS,FAG,SOS,#2022,184000,16000,1000,4500,9000,3000,1000,20000,1000
+BAENG,FAT,ENG,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BAFRN,FAT,FRN,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BAHIS,FAT,HIS,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BAISD,FAT,HIS,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BAMAC,FAT,MAC,#2022,248250,16000,1000,4500,9000,3000,1000,20000,1000
+BAPHI,FAT,PHI,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BARCS,FAT,RCS,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BARST,FAT,RCS,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BATMA,FAT,TMA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCANA,FBM,ANA,#2022,281000,16000,1000,4500,9000,3000,1000,20000,1000
+BMLS,FBM,MLS,#2022,554500,16000,1000,4500,9000,3000,1000,20000,1000
+BMLSCHMP,FBM,MLS,#2022,554500,16000,1000,4500,9000,3000,1000,20000,1000
+BMLSHBTS,FBM,MLS,#2022,554500,16000,1000,4500,9000,3000,1000,20000,1000
+BMLSHIST,FBM,MLS,#2022,554500,16000,1000,4500,9000,3000,1000,20000,1000
+BMLSMMCB,FBM,MLS,#2022,554500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCNSG,FBM,NSG,#2022,666000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPHS,FBM,PHS,#2022,204000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPYS,FBM,PYS,#2022,204000,16000,1000,4500,9000,3000,1000,20000,1000
+MBBS,FCS,MED,#2022,786000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDACC,FED,BED,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDOTM,FED,BED,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDSEC,FED,BED,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDBIO,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDCHM,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDCSC,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDENG,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDFRN,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDMTH,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDPHY,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDPPE,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDSSE,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+CAI,FED,CAI,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDEDM,FED,EFM,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDHIS,FED,EFM,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDRSE,FED,EFM,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+EFM,FED,EFM,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDECO,FED,GAC,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDGAC,FED,GAC,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDGEO,FED,GAC,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDPOL,FED,GAC,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDHED,FED,HKH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDHKE,FED,HKH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDPHE,FED,HKH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCLIS,FED,LIS,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BEDAGR,FED,VTE,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDHECO,FED,VTE,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BEDTEC,FED,VTE,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+VTE,FED,VTE,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCARC,FES,ARC,#2022,224500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCBLD,FES,BLD,#2022,224500,16000,1000,4500,9000,3000,1000,20000,1000
+BFA,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BFAGRH,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BFAPNT,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BFASC,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BFATD,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCFAA,FES,FAA,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCGEM,FES,GEM,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCGRP,FES,GEM,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BENGAGE,FET,AGE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGCIE,FET,CIE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGELE,FET,ELE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGIPE,FET,IPE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGMPE,FET,IPE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGPE,FET,IPE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGMEE,FET,MEE,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BENGMME,FET,MME,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCBCH,FLS,BCH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCBOT,FLS,BOT,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCHND,FLS,HND,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCMCB,FLS,MCB,#2022,224000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPSB,FLS,PSB,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCZOO,FLS,ZOO,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+LLB,FLW,LAW,#2022,657500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCACC,FMS,ACC,#2022,312500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCBAF,FMS,BAF,#2022,202500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCBUS,FMS,BUS,#2022,282500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPUB,FMS,PUB,#2022,282500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCCHM,FPS,CHM,#2022,264000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCICH,FPS,CHM,#2022,264000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCCSC,FPS,CSC,#2022,274500,16000,1000,4500,9000,3000,1000,20000,1000
+BSCIMTH,FPS,MTH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCMTH,FPS,MTH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCSTA,FPS,MTH,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCAPHY,FPS,PHY,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPHY,FPS,PHY,#2022,214000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCECO,FSS,ECO,#2022,232000,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPOL,FSS,POL,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCPSY,FSS,PSY,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
+BSCSOC,FSS,SOC,#2022,198250,16000,1000,4500,9000,3000,1000,20000,1000
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py	(revision 17431)
@@ -179,5 +179,5 @@
         cpt_value = ctrl.options[0]
         # School fee payment ticket can be added ...
-        self.student['studycourse'].certificate.school_fee_3 = 6666.0
+        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
         self.student.nationality = u'NG'
         self.browser.open(self.payments_path + '/addop')
@@ -222,8 +222,8 @@
                            self.browser.contents)
         self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['late_registration']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
+        #self.browser.getControl(name="form.p_category").value = ['late_registration']
+        #self.browser.getControl("Create ticket").click()
+        #self.assertMatches('...ticket created...',
+        #                   self.browser.contents)
         return
 
@@ -233,7 +233,7 @@
         self.app['configuration'].addSessionConfiguration(configuration_1)
         self.student['studycourse'].certificate.study_mode = 'ug_pt'
-        self.student['studycourse'].certificate.school_fee_2 = 6666.0
-        self.app['configuration']['2015'].union_fee = 1250.0
-        self.app['configuration']['2015'].welfare_fee = 750.0
+        #self.student['studycourse'].certificate.school_fee_2 = 6666.0
+        #self.app['configuration']['2015'].union_fee = 1250.0
+        #self.app['configuration']['2015'].welfare_fee = 750.0
         self.student.nationality = u'NG'
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -282,8 +282,6 @@
         self.assertEqual(self.student['payments'].values()[0].p_category, 'schoolfee_1')
         self.assertEqual(self.student['payments'].values()[1].p_category, 'schoolfee_2')
-        # (6666-200)/2 + 1250 + 750 - 400 + 200
-        self.assertEqual(self.student['payments'].values()[0].amount_auth, 5033.0)
-        # (6666-200)/2 + 200
-        self.assertEqual(self.student['payments'].values()[1].amount_auth, 3433.0)
+        self.assertEqual(self.student['payments'].values()[0].amount_auth, 147500.0)
+        self.assertEqual(self.student['payments'].values()[1].amount_auth, 92000.0)
         # The  two payments belong to the same session and level.
         self.assertEqual(self.student['payments'].values()[0].p_session, 2015)
@@ -296,7 +294,7 @@
         configuration_2.academic_session = 2016
         self.app['configuration'].addSessionConfiguration(configuration_2)
-        self.student['studycourse'].certificate.school_fee_2 = 5666.0
-        self.app['configuration']['2016'].union_fee = 1250.0
-        self.app['configuration']['2016'].welfare_fee = 750.0
+        #self.student['studycourse'].certificate.school_fee_2 = 5666.0
+        #self.app['configuration']['2016'].union_fee = 1250.0
+        #self.app['configuration']['2016'].welfare_fee = 750.0
         self.student.father_name = u'Albert'
         IWorkflowState(self.student).setState('returning')
@@ -317,8 +315,6 @@
         self.browser.getControl("Create ticket").click()
         self.assertTrue('ticket created' in self.browser.contents)
-        # (5666-200)/2 + 1250 + 750 - 400 + 200
-        self.assertEqual(self.student['payments'].values()[2].amount_auth, 4533.0)
-        # (5666-200)/2 + 200
-        self.assertEqual(self.student['payments'].values()[3].amount_auth, 2933.0)
+        self.assertEqual(self.student['payments'].values()[2].amount_auth, 147500.0)
+        self.assertEqual(self.student['payments'].values()[3].amount_auth, 92000.0)
         # The last two payments belong to the same session and level.
         self.assertEqual(self.student['payments'].values()[2].p_session, 2016)
@@ -329,5 +325,5 @@
 
     def test_manage_payments_bypass_ac_creation(self):
-        self.student['studycourse'].certificate.school_fee_3 = 6666.0
+        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
         self.student.nationality = u'NG'
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
@@ -365,5 +361,5 @@
         logcontent = open(logfile).read()
         self.assertTrue(
-            '"zope.mgr",E1000000,%s,schoolfee_incl,6666.0,AP,,,,,,\n' % value
+            '"zope.mgr",E1000000,%s,schoolfee_incl,239500.0,AP,,,,,,\n' % value
             in logcontent)
         # Student is in state school fee paid, no activation
@@ -563,5 +559,5 @@
 
     def test_payment_disabled(self):
-        self.student['studycourse'].certificate.school_fee_3 = 6666.0
+        #self.student['studycourse'].certificate.school_fee_3 = 6666.0
         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
         self.browser.open(self.payments_path)
@@ -621,5 +617,5 @@
         self.student['accommodation'].addBedTicket(bedticket)
 
-    def test_maintenance_fee_payment(self):
+    def deactivated_test_maintenance_fee_payment(self):
         self.certificate.study_mode = 'ug_ft'
         self.student['studycourse'].entry_session = 2013
@@ -649,5 +645,5 @@
         self.student['studycourse'].current_session = 2018
         self.student['studycourse'].entry_mode = 'ug_ft'
-        self.student['studycourse'].certificate.school_fee_2 = 50200.0
+        #self.student['studycourse'].certificate.school_fee_2 = 50200.0
         self.app['configuration']['2018'].union_fee = 1200.0
         self.app['configuration']['2018'].welfare_fee = 700.0
@@ -672,6 +668,5 @@
         self.browser.getLink(value).click()
         self.assertTrue('Amount Authorized' in self.browser.contents)
-        # 50200 + 1200 + 700 + 300 + 300- 800 = 51900
-        self.assertEqual(self.student['payments'][value].amount_auth, 51900.0)
+        self.assertEqual(self.student['payments'][value].amount_auth, 239500.0)
         self.student['payments'][value].r_company = u'interswitch'
         self.browser.getLink("Download").click()
@@ -692,5 +687,5 @@
         return
 
-    def test_late_registration(self):
+    def deactivated_test_late_registration(self):
         delta = timedelta(days=10)
         self.app['configuration'][
@@ -982,5 +977,5 @@
             in self.browser.contents)
         # 2nd instalment has to be paid first
-        self.certificate.school_fee_3 = 678.0
+        #self.certificate.school_fee_3 = 678.0
         self.browser.open(self.payments_path + '/addop')
         self.browser.getControl(name="form.p_category").value = ['schoolfee_2']
@@ -993,5 +988,5 @@
         return
 
-    def test_student_GST_registration(self):
+    def deactivated_test_student_GST_registration(self):
         configuration_1 = createObject('waeup.SessionConfiguration')
         configuration_1.academic_session = 2016
@@ -1087,5 +1082,5 @@
         return
 
-    def test_course_registration_forbidden_2(self):
+    def deactivated_test_course_registration_forbidden_2(self):
         IWorkflowState(self.student).setState('school fee paid')
         self.student['studycourse'].entry_session = 2004
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py	(revision 17431)
@@ -52,9 +52,9 @@
         self.app['configuration']['2004'].booking_fee = 150.0
         self.app['configuration']['2004'].maint_fee = 180.0
-        self.app['configuration']['2004'].clearance_fee_pg = 1234.0
-        self.app['configuration']['2004'].clearance_fee_fp = 3456.0
-        self.student['studycourse'].certificate.school_fee_1 = 6666.0
-        self.student['studycourse'].certificate.school_fee_2 = 7777.0
-        self.student['studycourse'].certificate.school_fee_3 = 8888.0
+        #self.app['configuration']['2004'].clearance_fee_pg = 1234.0
+        #self.app['configuration']['2004'].clearance_fee_fp = 3456.0
+        #self.student['studycourse'].certificate.school_fee_1 = 6666.0
+        #self.student['studycourse'].certificate.school_fee_2 = 7777.0
+        #self.student['studycourse'].certificate.school_fee_3 = 8888.0
         self.student['studycourse'].certificate.study_mode = 'special_pg_ft'
         self.student.nationality = u'NG'
@@ -74,5 +74,5 @@
         self.assertEqual(payment.p_level, 100)
         self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 28888.0)
+        self.assertEqual(payment.amount_auth, 204000.0) # tuition plus penalty
         self.assertEqual(payment.p_item, u'CERT1')
         self.assertEqual(error, None)
@@ -84,5 +84,5 @@
         self.student.lga = 'edo_afuze'
         error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.amount_auth, 8987.0)
+        self.assertEqual(payment.amount_auth, 184099.0)
         IWorkflowState(self.student).setState('returning')
         error, payment = utils.setPaymentDetails('schoolfee',self.student)
@@ -94,30 +94,5 @@
         self.assertEqual(payment.p_level, 200)
         self.assertEqual(payment.p_session, 2005)
-        self.assertEqual(payment.amount_auth, 8976.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        configuration = createObject('waeup.SessionConfiguration')
-        configuration.academic_session = 2016
-        self.app['configuration'].addSessionConfiguration(configuration)
-        configuration = createObject('waeup.SessionConfiguration')
-        configuration.academic_session = 2017
-        self.app['configuration'].addSessionConfiguration(configuration)
-        configuration = createObject('waeup.SessionConfiguration')
-        configuration.academic_session = 2018
-        self.app['configuration'].addSessionConfiguration(configuration)
-        self.student['studycourse'].current_session = 2017
-        self.student['studycourse'].entry_session = 2015
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.p_level, 200)
-        self.assertEqual(payment.p_session, 2018)
-        self.assertEqual(payment.amount_auth, 7777.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-        self.student['studycourse'].entry_session = 2014
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.p_level, 200)
-        self.assertEqual(payment.p_session, 2018)
-        self.assertEqual(payment.amount_auth, 8888.0)
+        self.assertEqual(payment.amount_auth, 184088.0)
         self.assertEqual(payment.p_item, u'CERT1')
         self.assertEqual(error, None)
@@ -133,27 +108,6 @@
         self.assertEqual(payment.p_level, 100)
         self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 1234.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        self.app['faculties']['fac1'].code = u'FP'
-        error, payment = utils.setPaymentDetails('clearance',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 3456.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('restitution',self.student)
-        self.assertEqual(error, 'Restitution fee payment not required.')
-        self.student['studycourse'].certificate.study_mode = 'ug_ft'
-        configuration = createObject('waeup.SessionConfiguration')
-        self.app['configuration']['2016'].restitution_fee = 1111.0
-        self.student['studycourse'].current_session = 2016
-        error, payment = utils.setPaymentDetails('restitution',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2016)
-        self.assertEqual(payment.amount_auth, 1111.0)
-        self.assertEqual(payment.p_item, u'')
+        self.assertEqual(payment.amount_auth, 14000.0)
+        self.assertEqual(payment.p_item, u'CERT1')
         self.assertEqual(error, None)
 
@@ -164,5 +118,5 @@
         self.assertEqual(payment.p_level, 100)
         self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 8888.0)
+        self.assertEqual(payment.amount_auth, 184099.0)
         self.assertEqual(payment.p_item, u'CERT1')
         self.assertEqual(error, None)
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py	(revision 17431)
@@ -17,4 +17,6 @@
 ##
 import grok
+import os
+import csv
 from time import time
 from zope.component import createObject, queryUtility
@@ -26,8 +28,16 @@
 from waeup.kofa.accesscodes import create_accesscode
 from waeup.kofa.students.utils import trans
-from waeup.aaue.interswitch.browser import gateway_net_amt, GATEWAY_AMT
 from waeup.aaue.interfaces import MessageFactory as _
 
 MINIMUM_UNITS_THRESHOLD = 15
+
+schoolfees_path = os.path.join(
+    os.path.dirname(__file__), 'schoolfees.csv')
+reader = csv.DictReader(open(schoolfees_path, 'rb'))
+SCHOOLFEES = {item['code']:(item['tuition'], item.values()) for item in reader}
+acceptancefees_path = os.path.join(
+    os.path.dirname(__file__), 'acceptancefees.csv')
+reader = csv.DictReader(open(acceptancefees_path, 'rb'))
+ACCEPTANCEFEES = {item['code']:(item['acceptance'], item.values()) for item in reader}
 
 class CustomStudentsUtils(NigeriaStudentsUtils):
@@ -312,10 +322,4 @@
             p_item = acco_details['bt']
             amount = academic_session.booking_fee
-        elif category == 'restitution':
-            if student.current_session != 2016 \
-                or student.current_mode not in ('ug_ft', 'dp_ft') \
-                or student.is_fresh:
-                return _(u'Restitution fee payment not required.'), None
-            amount = academic_session.restitution_fee
         elif category == 'hostel_maintenance':
             amount = 0.0
@@ -338,4 +342,9 @@
             if student.state not in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
                 return _(u'Acceptance Fee payments not allowed.'), None
+            try:
+                certificate = student['studycourse'].certificate
+                p_item = certificate.code
+            except (AttributeError, TypeError):
+                return _('Study course data are incomplete.'), None
             if student.current_mode in (
                 'ug_ft', 'ug_pt', 'de_ft', 'de_pt',
@@ -343,33 +352,19 @@
                 and category != 'clearance_incl':
                     return _("Additional fees must be included."), None
-            if student.current_mode == 'ijmbe':
-                amount = academic_session.clearance_fee_ijmbe
-            elif student.current_mode == 'bridge':
-                amount = academic_session.clearance_fee_bridge
-            elif student.current_mode == 'dp_ft':
-                amount = academic_session.clearance_fee_dp
-            elif student.faccode == 'FP':
-                amount = academic_session.clearance_fee_fp
-            elif student.current_mode in ('ug_pt', 'de_pt', 'ug_dsh', 'de_dsh'):
-                amount = academic_session.clearance_fee_ug_pt
-            elif student.current_mode == 'special_pg_pt':
-                amount = academic_session.clearance_fee_pg_pt
-            elif student.faccode == 'FCS':
-                # Students in clinical medical sciences pay the medical
-                # acceptance fee
-                amount = academic_session.clearance_fee_med
             elif student.current_mode == 'special_pg_ft':
                 if category != 'clearance':
                     return _("No additional fees required."), None
-                amount = academic_session.clearance_fee_pg
-            else:
-                amount = academic_session.clearance_fee
-            p_item = student['studycourse'].certificate.code
-            if amount in (0.0, None):
-                return _(u'Amount could not be determined.'), None
-            # Add Matric Gown Fee and Lapel Fee
+            try:
+                acceptancefees_entry = ACCEPTANCEFEES[student.certcode]
+            except KeyError:
+                return _('Acceptance fees not yet fixed.'), None
             if category == 'clearance_incl':
-                amount += gateway_net_amt(academic_session.matric_gown_fee) + \
-                    gateway_net_amt(academic_session.lapel_fee)
+                for item in acceptancefees_entry[1]:
+                    try:
+                        amount += int(item)
+                    except:
+                        pass
+            else:
+                amount = float(acceptancefees_entry[0])
         elif category == 'late_registration':
             if student.is_postgrad:
@@ -388,4 +383,8 @@
             except (AttributeError, TypeError):
                 return _('Study course data are incomplete.'), None
+            try:
+                schoolfees_entry = SCHOOLFEES[student.certcode]
+            except KeyError:
+                return _('School fees not yet fixed.'), None
             if student.is_postgrad and category != 'schoolfee':
                 return _("No additional fees required."), None
@@ -404,11 +403,12 @@
                     return _("You are not allowed "
                              "to pay by instalments."), None
-            # We determine the base amount first
-            if student.entry_session < 2015:
-                amount = getattr(certificate, 'school_fee_3', 0.0)
-            elif student.entry_session < 2021:
-                amount = getattr(certificate, 'school_fee_2', 0.0)
-            else:
-                amount = getattr(certificate, 'school_fee_1', 0.0)
+            additional = 0.0
+            for item in schoolfees_entry[1]:
+                try:
+                    additional += int(item)
+                except:
+                    pass
+            amount = float(schoolfees_entry[0])
+            additional -= amount
             if previous_session:
                 # Students can pay for previous sessions in all
@@ -419,5 +419,5 @@
                 # Cut school fee by 50%
                 if category in ('schoolfee_1', 'schoolfee_2') and amount:
-                    amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT
+                    amount /= 2
             elif student.state == RETURNING and category != 'schoolfee_2':
                 if not student.father_name:
@@ -434,26 +434,14 @@
                 # Cut school fee by 50%
                 if category == 'schoolfee_1' and amount:
-                    amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT
+                    amount /= 2
             elif category == 'schoolfee_2' and amount:
-                amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT
+                amount /= 2
             else:
                 return _('Wrong state.'), None
             if amount in (0.0, None):
                 return _(u'Amount could not be determined.'), None
-            # Add Student Union Fee, Student Id Card Fee, Sports Dev. Fee,
-            # Library Dev. Fee and Welfare Assurance
-            if category in ('schoolfee_incl', 'schoolfee_1') \
-                and student.current_mode != 'ijmbe':
-                amount += gateway_net_amt(academic_session.welfare_fee) + \
-                    gateway_net_amt(academic_session.union_fee)
-                if student.entry_session >= 2018 and student.is_fresh:
-                    amount += gateway_net_amt(academic_session.sports_fee)
-                    if student.is_postgrad:
-                        amount += gateway_net_amt(academic_session.library_pg_fee)
-                    else:
-                        amount += gateway_net_amt(academic_session.library_fee)
-                if student.entry_session >= 2021 \
-                    and student.current_mode == 'ug_ft':
-                    amount += gateway_net_amt(academic_session.lms_sund_fee)
+            # Add additional fees
+            if category in ('schoolfee_incl', 'schoolfee_1'):
+                amount += additional
             # Add non-indigenous fee and session specific penalty fees
             if student.is_postgrad:
@@ -463,23 +451,4 @@
             else:
                 amount += academic_session.penalty_ug
-        #elif category == ('fac_dep'):
-        #    if student.faccode in ('FAT', 'FED', 'FLW', 'FMS', 'FSS'):
-        #        amount = 4200.0
-        #    elif student.faccode in ('FAG', 'FBM', 'FCS',
-        #                             'FES', 'FET', 'FLS', 'FPS'):
-        #        amount = 5200.0
-        #    elif student.faccode == 'FAG' and student.current_level == 400:
-        #        amount = 10200.0
-        #    elif student.depcode == 'VTE':
-        #        amount = 5200.0
-        #    if student.entry_session >= 2019:
-        #        amount += gateway_net_amt(academic_session.ict_fee)
-        elif category == 'sports_library': # temporarily in 2020
-            if student.is_postgrad:
-                amount = academic_session.sports_fee + gateway_net_amt(
-                    academic_session.library_pg_fee)
-            else:
-                amount = academic_session.sports_fee + gateway_net_amt(
-                    academic_session.library_fee)
         elif not student.is_postgrad:
             fee_name = category + '_fee'
Index: /main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py	(revision 17430)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/utils/utils.py	(revision 17431)
@@ -93,42 +93,42 @@
         'clearance': 'Acceptance Fee without additional fees',
         'clearance_incl': 'Acceptance Fee incl. additional fees',
-        'hostel_maintenance': 'Hostel Accommodation Fee',
+        ##'hostel_maintenance': 'Hostel Accommodation Fee',
         #'application': 'Application Fee',
         #'bed_allocation': 'Bed Allocation Fee',
         #'transfer': 'Transfer Fee',
-        'transcript_local': 'Local Transcript Fee',
-        'transcript_inter': 'International Transcript Fee',
-        'late_registration': 'Late Course Registration Fee',
+        ##'transcript_local': 'Local Transcript Fee',
+        ##'transcript_inter': 'International 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',
+        ##'concessional': 'Concessional Fee',
         #'id_card': 'Student ID Card',
-        'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112',
-        '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',
-        'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
-        'gst_registration_2': 'Registration Fee GST222',
-        'ent_text_book_1': 'Text Book Fee ENT201',
-        'ent_text_book_2': 'Text Book Fee ENT211',
-        'ent_text_book_0': 'Text Book Fee for ENT201 and ENT211',
-        'ent_registration_1': 'Registration Fee ENT201',
-        'ent_registration_2': 'Registration Fee ENT211',
-        'ent_registration_0': 'Registration Fee for ENT201 and ENT211',
-        'ent_combined': 'Registration and Textbook Fee for ENT201 and ENT211',
-        #'fac_dep': 'Faculty and Departmental Dues (incl. ICT/Affidavit Dues)',
-        'ict': 'ICT/Affidavit Dues',
-        #'affidavit': 'Affidavit Dues',
-        'restitution': 'Restitution Fee',
-        'sports': 'Sports Fee',
-        'library': 'UG Library Fee',
-        'library_pg': 'PG Library Fee',
-        'sports_library': 'Sports Development and Library Fee',
-        'lab_1': 'Faculty Laboratory Due (CHM102/PHY103/CSC101)',
-        'lab_2': 'Laboratory Due (BIO101/BIO111)',
-        'lms_sund': 'LMS plus Sundry Fees (new UG students only)',
-        'access_card': 'AAU Access Card Fee',
+        ##'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112',
+        ##'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',
+        ##'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
+        ##'gst_registration_2': 'Registration Fee GST222',
+        ##'ent_text_book_1': 'Text Book Fee ENT201',
+        ##'ent_text_book_2': 'Text Book Fee ENT211',
+        ##'ent_text_book_0': 'Text Book Fee for ENT201 and ENT211',
+        ##'ent_registration_1': 'Registration Fee ENT201',
+        ##'ent_registration_2': 'Registration Fee ENT211',
+        ##'ent_registration_0': 'Registration Fee for ENT201 and ENT211',
+        ##'ent_combined': 'Registration and Textbook Fee for ENT201 and ENT211',
+        ##'fac_dep': 'Faculty and Departmental Dues (incl. ICT/Affidavit Dues)',
+        ##'ict': 'ICT/Affidavit Dues',
+        ##'affidavit': 'Affidavit Dues',
+        ##'restitution': 'Restitution Fee',
+        ##'sports': 'Sports Fee',
+        ##'library': 'UG Library Fee',
+        ##'library_pg': 'PG Library Fee',
+        ##'sports_library': 'Sports Development and Library Fee',
+        ##'lab_1': 'Faculty Laboratory Due (CHM102/PHY103/CSC101)',
+        ##'lab_2': 'Laboratory Due (BIO101/BIO111)',
+        ##'lms_sund': 'LMS plus Sundry Fees (new UG students only)',
+        ##'access_card': 'AAU Access Card Fee',
         }
 
@@ -141,9 +141,9 @@
         'clearance': 'Acceptance Fee',
         'schoolfee': 'School Fee',
-        'late_registration': 'Late Course Registration Fee',
-        'sports': 'Sports Fee',
-        'library': 'UG Library Fee',
-        'library_pg': 'PG Library Fee',
-        'sports_library': 'Sports Development and Library Fee',
+        ##'late_registration': 'Late Course Registration Fee',
+        ##'sports': 'Sports Fee',
+        ##'library': 'UG Library Fee',
+        ##'library_pg': 'PG Library Fee',
+        ##'sports_library': 'Sports Development and Library Fee',
         }
 
@@ -153,9 +153,9 @@
         'schoolfee_1': 'School Fee (1st instalment)',
         'schoolfee_2': 'School Fee (2nd instalment)',
-        'sports': 'Sports Fee',
-        'library': 'UG Library Fee',
-        'library_pg': 'PG Library Fee',
-        'sports_library': 'Sports Development and Library Fee',
-        'exam': 'IJMBE Examination Fee',
+        ##'sports': 'Sports Fee',
+        ##'library': 'UG Library Fee',
+        ##'library_pg': 'PG Library Fee',
+        ##'sports_library': 'Sports Development and Library Fee',
+        ##'exam': 'IJMBE Examination Fee',
         }
 
@@ -163,24 +163,24 @@
         'clearance_incl': 'Acceptance Fee Plus',
         'schoolfee_incl': 'School Fee Plus',
-        'ent_text_book_1': 'Text Book Fee ENT201',
-        'ent_text_book_2': 'Text Book Fee ENT211',
-        'ent_text_book_0': 'Text Book Fee for ENT201 and ENT211',
-        'ent_registration_1': 'Registration Fee ENT201',
-        'ent_registration_2': 'Registration Fee ENT211',
-        'ent_registration_0': 'Registration Fee for ENT201 and ENT211',
-        'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
-        'gst_registration_2': 'Registration Fee GST222',
-        'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112',
-        '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_combined': 'Registration and Textbook Fee for ENT201 and ENT211',
-        'late_registration': 'Late Course Registration Fee',
-        'sports': 'Sports Fee',
-        'library': 'UG Library Fee',
-        'library_pg': 'PG Library Fee',
-        'sports_library': 'Sports Development and Library Fee',
-        'lab_1': 'Faculty Laboratory Due (CHM102/PHY103/CSC101)',
-        'lab_2': 'Laboratory Due (BIO101/BIO111)',
+        ##'ent_text_book_1': 'Text Book Fee ENT201',
+        ##'ent_text_book_2': 'Text Book Fee ENT211',
+        ##'ent_text_book_0': 'Text Book Fee for ENT201 and ENT211',
+        ##'ent_registration_1': 'Registration Fee ENT201',
+        ##'ent_registration_2': 'Registration Fee ENT211',
+        ##'ent_registration_0': 'Registration Fee for ENT201 and ENT211',
+        ##'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112',
+        ##'gst_registration_2': 'Registration Fee GST222',
+        ##'gst_text_book_0': 'Text Book Fee GST101 GST102 GST111 GST112',
+        ##'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_combined': 'Registration and Textbook Fee for ENT201 and ENT211',
+        ##'late_registration': 'Late Course Registration Fee',
+        ##'sports': 'Sports Fee',
+        ##'library': 'UG Library Fee',
+        ##'library_pg': 'PG Library Fee',
+        ##'sports_library': 'Sports Development and Library Fee',
+        ##'lab_1': 'Faculty Laboratory Due (CHM102/PHY103/CSC101)',
+        ##'lab_2': 'Laboratory Due (BIO101/BIO111)',
         }
 
@@ -208,5 +208,7 @@
         }
 
-    BALANCE_PAYMENT_CATEGORIES = {
+    BALANCE_PAYMENT_CATEGORIES = {}
+
+    XXXBALANCE_PAYMENT_CATEGORIES = {
         'schoolfee': 'School Fee',
         'clearance': 'Acceptance Fee',
