Changeset 11913


Ignore:
Timestamp:
29 Oct 2014, 21:23:53 (10 years ago)
Author:
Henrik Bettermann
Message:

Add payment category 'NCE Third Semester Fee' which can be set in session configuration objects. Remove unused payment categories.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py

    r9628 r11913  
    6363        )
    6464
    65     gown_fee = schema.Float(
    66         title = _(u'Gown Fee'),
    67         default = 0.0,
    68         required = False,
    69         )
    70 
    71     transfer_fee = schema.Float(
    72         title = _(u'Transfer Fee'),
     65    third_semester_fee = schema.Float(
     66        title = _(u'NCE Third Semester Fee'),
    7367        default = 0.0,
    7468        required = False,
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r10876 r11913  
    8484    def test_manage_payments(self):
    8585        # Add missing configuration data
    86         self.app['configuration']['2004'].gown_fee = 150.0
    87         self.app['configuration']['2004'].transfer_fee = 90.0
     86        self.app['configuration']['2004'].third_semester_fee = 90.0
    8887        self.app['configuration']['2004'].clearance_fee = 120.0
    8988        self.app['configuration']['2004'].booking_fee = 150.0
     
    131130                           self.browser.contents)
    132131        self.browser.open(self.payments_path + '/addop')
    133         self.browser.getControl(name="form.p_category").value = ['gown']
    134         self.browser.getControl("Create ticket").click()
    135         self.assertMatches('...ticket created...',
    136                            self.browser.contents)
    137         self.browser.open(self.payments_path + '/addop')
    138         self.browser.getControl(name="form.p_category").value = ['transfer']
     132        self.browser.getControl(name="form.p_category").value = ['third_semester']
     133        self.browser.getControl("Create ticket").click()
     134        self.assertMatches('...could not be determined...',
     135                           self.browser.contents)
     136        self.certificate.study_mode = 'nce_ft'
     137        self.browser.open(self.payments_path + '/addop')
     138        self.browser.getControl(name="form.p_category").value = ['third_semester']
    139139        self.browser.getControl("Create ticket").click()
    140140        self.assertMatches('...ticket created...',
     
    214214
    215215    def test_set_payment_details(self):
    216         self.app['configuration']['2004'].gown_fee = 150.0
    217         self.app['configuration']['2004'].transfer_fee = 90.0
     216        self.app['configuration']['2004'].third_semester_fee = 90.0
    218217        self.app['configuration']['2004'].booking_fee = 150.0
    219218        self.app['configuration']['2004'].maint_fee = 180.0
     
    274273        self.assertEqual(error, None)
    275274
    276         error, payment = utils.setPaymentDetails('gown',self.student)
    277         self.assertEqual(payment.p_level, 100)
    278         self.assertEqual(payment.p_session, 2004)
    279         self.assertEqual(payment.amount_auth, 300.0)
    280         self.assertEqual(payment.p_item, u'')
    281         self.assertEqual(error, None)
    282 
    283275        self.student['studycourse'].current_session = 2005
    284276        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     
    294286        self.assertEqual(error, None)
    295287
     288        error, payment = utils.setPaymentDetails('third_semester',self.student)
     289        self.assertEqual(payment.p_level, 100)
     290        self.assertEqual(payment.p_session, 2004)
     291        self.assertEqual(payment.amount_auth, 240.0)
     292        self.assertEqual(payment.p_item, u'')
     293        self.assertEqual(error, None)
     294
    296295        self.certificate.study_mode = u'nce_sw'
    297296        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     
    306305        self.assertEqual(payment.p_session, 2004)
    307306        self.assertEqual(payment.amount_auth, 300.0)
    308         self.assertEqual(payment.p_item, u'')
    309         self.assertEqual(error, None)
    310 
    311         error, payment = utils.setPaymentDetails('transfer',self.student)
    312         self.assertEqual(payment.p_level, 100)
    313         self.assertEqual(payment.p_session, 2004)
    314         self.assertEqual(payment.amount_auth, 240.0)
    315307        self.assertEqual(payment.p_item, u'')
    316308        self.assertEqual(error, None)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r11882 r11913  
    138138            except (AttributeError, TypeError):
    139139                return _('Study course data are incomplete.'), None
     140        elif category == 'third_semester' and student.current_mode == 'nce_ft':
     141            amount = academic_session.third_semester_fee
    140142        elif category == 'schoolfee':
    141143            try:
  • main/waeup.fceokene/trunk/src/waeup/fceokene/utils/utils.py

    r10570 r11913  
    1818"""Customize general helper utilities for Kofa.
    1919"""
     20from copy import deepcopy
    2021from kofacustom.nigeria.utils.utils import NigeriaKofaUtils
    2122from waeup.fceokene.interfaces import MessageFactory as _
     
    3637        }
    3738
     39
     40    PAYMENT_CATEGORIES = {
     41        'schoolfee': 'School Fee',
     42        'clearance': 'Acceptance Fee',
     43        'bed_allocation': 'Bed Allocation Fee',
     44        'hostel_maintenance': 'Hostel Maintenance Fee',
     45        #'transfer': 'Transfer Fee',
     46        #'gown': 'Gown Hire Fee',
     47        'application': 'Application Fee',
     48        #'transcript': 'Transcript Fee',
     49        'third_semester': 'NCE Third Semester Fee',
     50        }
     51
     52    SELECTABLE_PAYMENT_CATEGORIES = deepcopy(PAYMENT_CATEGORIES)
     53
    3854    def getPaymentItem(self, payment):
    3955        """Return payment item.
Note: See TracChangeset for help on using the changeset viewer.