Changeset 9724


Ignore:
Timestamp:
26 Nov 2012, 14:41:57 (12 years ago)
Author:
Henrik Bettermann
Message:

Implement carry-over fee payment.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py

    r9710 r9724  
    241241        xmldict['dalash_amt'] = 0
    242242        self.pay_item_id = '000'
    243         if self.context.p_category == 'schoolfee':
     243        if self.context.p_category in ('schoolfee', 'co1', 'co2', 'co3'):
    244244            self.pay_item_id = '101'
    245245            # Dalash data
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py

    r9568 r9724  
    129129                           self.browser.contents)
    130130        self.browser.open(self.payments_path + '/addop')
    131         self.browser.getControl(name="form.p_category").value = ['gown']
    132         self.browser.getControl("Create ticket").click()
    133         self.assertMatches('...ticket created...',
    134                            self.browser.contents)
    135         self.browser.open(self.payments_path + '/addop')
    136         self.browser.getControl(name="form.p_category").value = ['transfer']
     131        self.browser.getControl(name="form.p_category").value = ['co1']
     132        self.browser.getControl("Create ticket").click()
     133        self.assertMatches('...ticket created...',
     134                           self.browser.contents)
     135        self.browser.open(self.payments_path + '/addop')
     136        self.browser.getControl(name="form.p_category").value = ['co2']
     137        self.browser.getControl("Create ticket").click()
     138        self.assertMatches('...ticket created...',
     139                           self.browser.contents)
     140        self.browser.open(self.payments_path + '/addop')
     141        self.browser.getControl(name="form.p_category").value = ['co3']
    137142        self.browser.getControl("Create ticket").click()
    138143        self.assertMatches('...ticket created...',
     
    251256        self.assertEqual(error, None)
    252257
    253         error, payment = utils.setPaymentDetails('gown',self.student)
     258        error, payment = utils.setPaymentDetails('co1',self.student)
     259        self.assertEqual(payment.p_level, 100)
     260        self.assertEqual(payment.p_session, 2004)
     261        self.assertEqual(payment.amount_auth, 6000.0)
     262        self.assertEqual(payment.p_item, u'')
     263        self.assertEqual(error, None)
     264
     265        error, payment = utils.setPaymentDetails('co2',self.student)
     266        self.assertEqual(payment.p_level, 100)
     267        self.assertEqual(payment.p_session, 2004)
     268        self.assertEqual(payment.amount_auth, 7000.0)
     269        self.assertEqual(payment.p_item, u'')
     270        self.assertEqual(error, None)
     271
     272        error, payment = utils.setPaymentDetails('co3',self.student)
     273        self.assertEqual(payment.p_level, 100)
     274        self.assertEqual(payment.p_session, 2004)
     275        self.assertEqual(payment.amount_auth, 8000.0)
     276        self.assertEqual(payment.p_item, u'')
     277        self.assertEqual(error, None)
     278
     279        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     280        self.assertEqual(payment.p_level, 100)
     281        self.assertEqual(payment.p_session, 2004)
     282        self.assertEqual(payment.amount_auth, 180.0)
     283        self.assertEqual(payment.p_item, u'')
     284        self.assertEqual(error, None)
     285
     286        error, payment = utils.setPaymentDetails('bed_allocation',self.student)
    254287        self.assertEqual(payment.p_level, 100)
    255288        self.assertEqual(payment.p_session, 2004)
    256289        self.assertEqual(payment.amount_auth, 150.0)
    257         self.assertEqual(payment.p_item, u'')
    258         self.assertEqual(error, None)
    259 
    260         error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
    261         self.assertEqual(payment.p_level, 100)
    262         self.assertEqual(payment.p_session, 2004)
    263         self.assertEqual(payment.amount_auth, 180.0)
    264         self.assertEqual(payment.p_item, u'')
    265         self.assertEqual(error, None)
    266 
    267         error, payment = utils.setPaymentDetails('bed_allocation',self.student)
    268         self.assertEqual(payment.p_level, 100)
    269         self.assertEqual(payment.p_session, 2004)
    270         self.assertEqual(payment.amount_auth, 150.0)
    271         self.assertEqual(payment.p_item, u'')
    272         self.assertEqual(error, None)
    273 
    274         error, payment = utils.setPaymentDetails('transfer',self.student)
    275         self.assertEqual(payment.p_level, 100)
    276         self.assertEqual(payment.p_session, 2004)
    277         self.assertEqual(payment.amount_auth, 90.0)
    278290        self.assertEqual(payment.p_item, u'')
    279291        self.assertEqual(error, None)
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r9614 r9724  
    164164                         p_level)
    165165                        )
     166        elif category == 'co1':
     167            amount = 6000.0
     168        elif category == 'co2':
     169            amount = 7000.0
     170        elif category == 'co3':
     171            amount = 8000.0
    166172        if amount in (0.0, None):
    167173            return _(u'Amount could not be determined.'), None
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py

    r9361 r9724  
    4040        'prend': 'Pre-ND',
    4141        }
     42
     43    PAYMENT_CATEGORIES = {
     44        'schoolfee': 'School Fee',
     45        'co1': '1 Carry-Over',
     46        'co2': '2 Carry-Overs',
     47        'co3': '3 Carry-Overs',
     48        'clearance': 'Acceptance Fee',
     49        'bed_allocation': 'Bed Allocation Fee',
     50        'hostel_maintenance': 'Hostel Maintenance Fee',
     51        'application': 'Application Fee'
     52        }
Note: See TracChangeset for help on using the changeset viewer.