Changeset 11919 for main/waeup.fceokene


Ignore:
Timestamp:
30 Oct 2014, 21:20:11 (10 years ago)
Author:
Henrik Bettermann
Message:

Configure third semester payment in setPaymentDetails. Session configuration field is is no longer needed.

Location:
main/waeup.fceokene/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/CHANGES.txt

    r11776 r11919  
    441.2dev (unreleased)
    55===================
     6
     7* Add new payment category 'third_semester'.
    68
    79* Make jamb_reg_number a requird field.
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py

    r11913 r11919  
    6363        )
    6464
    65     third_semester_fee = schema.Float(
    66         title = _(u'NCE Third Semester Fee'),
    67         default = 0.0,
    68         required = False,
    69         )
    70 
    7165    def getSessionString():
    7266        """Returns the session string from the vocabulary.
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py

    r11649 r11919  
    7878        xmldict['institution_item_name'] = self.category
    7979        xmldict['institution_name'] = INSTITUTION_NAME
    80         if self.context.p_category == 'schoolfee':
     80        if self.context.p_category in ('schoolfee', 'third_semester'):
    8181            self.pay_item_id = '8302'
    8282            if student.current_mode in ('nce_sw','prence',):
     
    119119
    120120        # Interswitch amount is not part of the xml data
    121         if self.context.p_category == 'schoolfee':
     121        if self.context.p_category in ('schoolfee', 'third_semester'):
    122122            xmltext = """<payment_item_detail>
    123123<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py

    r11775 r11919  
    106106            in self.browser.contents)
    107107
     108        # Third semester payment
     109        self.app['configuration']['2004'].third_semester_fee = 10000.0
     110        self.browser.open(self.payments_path)
     111        self.browser.open(self.payments_path + '/addop')
     112        self.browser.getControl(
     113            name="form.p_category").value = ['third_semester']
     114        self.browser.getControl("Create ticket").click()
     115        ctrl = self.browser.getControl(name='val_id')
     116        value = ctrl.options[1]
     117        self.browser.getLink(value).click()
     118        self.browser.getLink("CollegePAY", index=0).click()
     119
     120        self.assertTrue(
     121            '<input type="hidden" name="amount" value="691300" />'
     122            in self.browser.contents)
     123        self.assertTrue(
     124            'item_name="NCE Third Semester Fee" item_amt="376300" bank_id="117" acct_num="1012044015"'
     125            in self.browser.contents)
     126        self.assertTrue(
     127            'item_name="FCEOkene Split" item_amt="140000" bank_id="117" acct_num="1012044039"'
     128            in self.browser.contents)
     129        self.assertTrue(
     130            'item_name="BT Education" item_amt="160000" bank_id="31" acct_num="0026781725"'
     131            in self.browser.contents)
     132
    108133        # Maintenance fee payment
    109134
     
    136161                           self.browser.contents)
    137162        ctrl = self.browser.getControl(name='val_id')
    138         value = ctrl.options[1]
     163        value = ctrl.options[2]
    139164        self.browser.getLink(value).click()
    140165        self.assertMatches('...Amount Authorized...',
     
    192217                           self.browser.contents)
    193218        ctrl = self.browser.getControl(name='val_id')
    194         value = ctrl.options[2]
     219        value = ctrl.options[3]
    195220        self.browser.getLink(value).click()
    196221        self.assertMatches('...Amount Authorized...',
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r11913 r11919  
    8484    def test_manage_payments(self):
    8585        # Add missing configuration data
    86         self.app['configuration']['2004'].third_semester_fee = 90.0
    8786        self.app['configuration']['2004'].clearance_fee = 120.0
    8887        self.app['configuration']['2004'].booking_fee = 150.0
     
    214213
    215214    def test_set_payment_details(self):
    216         self.app['configuration']['2004'].third_semester_fee = 90.0
    217215        self.app['configuration']['2004'].booking_fee = 150.0
    218216        self.app['configuration']['2004'].maint_fee = 180.0
     
    289287        self.assertEqual(payment.p_level, 100)
    290288        self.assertEqual(payment.p_session, 2004)
    291         self.assertEqual(payment.amount_auth, 240.0)
     289        self.assertEqual(payment.amount_auth, 6913.0)
    292290        self.assertEqual(payment.p_item, u'')
    293291        self.assertEqual(error, None)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r11913 r11919  
    2828from waeup.kofa.students.utils import trans
    2929from waeup.fceokene.interswitch.browser import GATEWAY_AMT
     30
     31# Very special school fee configuration, should be moved to
     32# a seperate file.
     33
     34ARTS = ('CRS','ISS','HIS','MUS','ECO','GEO','POL','SOS','CCA','ECU',
     35        'THA','GED','GSE','PES','SPC','ENG','FRE','ARB','HAU','IGB',
     36        'YOR','NCRS','NISS','NHIS','NMUS','NECO','NGEO','NPOL',
     37        'NCCA','NECU','NTHA','NGED','NGSE','NPES','NSPC','NENG',
     38        'NFRE','NARB','NHAU','NIGB','NYOR','NSOS')
    3039
    3140class CustomStudentsUtils(NigeriaStudentsUtils):
     
    139148                return _('Study course data are incomplete.'), None
    140149        elif category == 'third_semester' and student.current_mode == 'nce_ft':
    141             amount = academic_session.third_semester_fee
     150            if student.depcode in ARTS:
     151                amount = 5835
     152            else:
     153                amount = 6763
    142154        elif category == 'schoolfee':
    143155            try:
     
    146158            except (AttributeError, TypeError):
    147159                return _('Study course data are incomplete.'), None
    148 
    149             # Very special school fee configuration, should be moved to
    150             # a seperate file.
    151 
    152             ARTS = ('CRS','ISS','HIS','MUS','ECO','GEO','POL','SOS','CCA','ECU',
    153                     'THA','GED','GSE','PES','SPC','ENG','FRE','ARB','HAU','IGB',
    154                     'YOR','NCRS','NISS','NHIS','NMUS','NECO','NGEO','NPOL',
    155                     'NCCA','NECU','NTHA','NGED','NGSE','NPES','NSPC','NENG',
    156                     'NFRE','NARB','NHAU','NIGB','NYOR','NSOS')
    157160
    158161            if student.state not in (CLEARED, RETURNING):
Note: See TracChangeset for help on using the changeset viewer.