Ignore:
Timestamp:
7 Feb 2015, 10:25:56 (10 years ago)
Author:
Henrik Bettermann
Message:

Add new application category and type (ticket #966).

Implement hostel application fee payment (ticket #959). Uniben is still waiting for an agrrement with Interwsicth.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
5 edited

Legend:

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

    r11827 r12566  
    4747        'pgpt': ['Postgraduate Part-Time Programmes', 'PG'],
    4848        'pgnew': ['New Postgraduate Programmes', 'NEWPG'],
     49        'pgnewtwo': ['New Postgraduate Programmes (#2)', 'NEWPG'],
    4950        'pgext': ['Postgraduate Programmes (extended application)', 'PG']
    5051        }
  • main/waeup.uniben/trunk/src/waeup/uniben/interswitch/tests.py

    r11787 r12566  
    202202            'item_name="BT Education"' in self.browser.contents)
    203203
     204        # Create hostel application ticket
     205        self.browser.open(self.payments_path + '/addop')
     206        self.browser.getControl(name="form.p_category").value = ['hostel_application']
     207        self.browser.getControl("Create ticket").click()
     208        ctrl = self.browser.getControl(name='val_id')
     209        value = ctrl.options[3]
     210        self.browser.getLink(value).click()
     211        self.assertMatches(
     212            '...<span>1000.0</span>...',
     213            self.browser.contents)
     214        self.student['payments'][value].approve()
     215
    204216        # Create temp maint fee ticket
    205217        self.browser.open(self.payments_path + '/addop')
     
    207219        self.browser.getControl("Create ticket").click()
    208220        ctrl = self.browser.getControl(name='val_id')
    209         value = ctrl.options[3]
     221        value = ctrl.options[4]
    210222        self.browser.getLink(value).click()
    211223        self.assertMatches(
     
    224236            self.browser.contents)
    225237        self.assertMatches(
    226             '...<item_detail item_id="1" item_name="Hostel Maintenance Fee" item_amt="800000" bank_id="17" acct_num="0009598925" />...',
     238            '...<item_detail item_id="1" item_name="Hostel Maintenance Fee" item_amt="800000" bank_id="129" acct_num="0014419432" />...',
    227239            self.browser.contents)
    228240        self.assertFalse(
     
    269281        self.browser.getControl("Create ticket").click()
    270282        ctrl = self.browser.getControl(name='val_id')
    271         value = ctrl.options[4]
     283        value = ctrl.options[5]
    272284        self.browser.getLink(value).click()
    273285        self.assertMatches(
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r12122 r12566  
    249249            name="form.p_category").value = ['tempmaint_1']
    250250        self.browser.getControl("Create ticket").click()
     251        self.assertMatches('...You have not yet paid the hostel application fee...',
     252                           self.browser.contents)
     253        self.browser.open(self.payments_path + '/addop')
     254        self.browser.getControl(name="form.p_category").value = ['hostel_application']
     255        self.browser.getControl("Create ticket").click()
     256        self.assertMatches('...ticket created...',
     257                           self.browser.contents)
     258        ha_ticket = self.student['payments'].values()[2]
     259        ha_ticket.approve()
     260        self.browser.open(self.payments_path + '/addop')
     261        self.browser.getControl(
     262            name="form.p_category").value = ['tempmaint_1']
     263        self.browser.getControl("Create ticket").click()
    251264        self.assertMatches('...ticket created...',
    252265                           self.browser.contents)
     
    579592        self.assertEqual(error, None)
    580593
    581         error, payment = utils.setPaymentDetails('hostel_maintenance',
     594        #error, payment = utils.setPaymentDetails('hostel_maintenance',
     595        #    self.student, None, None)
     596        #self.assertEqual(payment.p_level, 100)
     597        #self.assertEqual(payment.p_session, 2004)
     598        #self.assertEqual(payment.amount_auth, 180.0)
     599        #self.assertEqual(payment.p_item, u'')
     600        #self.assertEqual(error, None)
     601
     602        #error, payment = utils.setPaymentDetails('bed_allocation',
     603        #    self.student, None, None)
     604        #self.assertEqual(payment.p_level, 100)
     605        #self.assertEqual(payment.p_session, 2004)
     606        #self.assertEqual(payment.amount_auth, 150.0)
     607        #self.assertEqual(payment.p_item, u'')
     608        #self.assertEqual(error, None)
     609
     610        error, payment = utils.setPaymentDetails('hostel_application',
    582611            self.student, None, None)
    583612        self.assertEqual(payment.p_level, 100)
    584613        self.assertEqual(payment.p_session, 2004)
    585         self.assertEqual(payment.amount_auth, 180.0)
     614        self.assertEqual(payment.amount_auth, 1000.0)
    586615        self.assertEqual(payment.p_item, u'')
    587616        self.assertEqual(error, None)
    588617
    589         error, payment = utils.setPaymentDetails('bed_allocation',
    590             self.student, None, None)
    591         self.assertEqual(payment.p_level, 100)
    592         self.assertEqual(payment.p_session, 2004)
    593         self.assertEqual(payment.amount_auth, 150.0)
    594         self.assertEqual(payment.p_item, u'')
    595         self.assertEqual(error, None)
     618        payment.approve()
     619        self.student['payments'][payment.p_id] = payment
    596620
    597621        error, payment = utils.setPaymentDetails('tempmaint_1',
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r11773 r12566  
    5353                if ticket.p_state == 'paid' and \
    5454                    ticket.p_category == 'schoolfee' and \
     55                    ticket.p_session == session:
     56                    return True
     57        return False
     58
     59    def _hostelApplicationPaymentMade(self, student, session):
     60        if len(student['payments']):
     61            for ticket in student['payments'].values():
     62                if ticket.p_state == 'paid' and \
     63                    ticket.p_category == 'hostel_application' and \
    5564                    ticket.p_session == session:
    5665                    return True
     
    93102        elif category == 'gown':
    94103            amount = academic_session.gown_fee
    95         elif category == 'bed_allocation':
    96             amount = academic_session.booking_fee
    97         elif category == 'hostel_maintenance':
    98             amount = academic_session.maint_fee
    99         elif category == 'tempmaint_1':
    100             amount = 8150.0
    101         elif category == 'tempmaint_2':
    102             amount = 12650.0
    103         elif category == 'tempmaint_3':
    104             amount = 9650.0
     104        #elif category == 'bed_allocation':
     105        #    amount = academic_session.booking_fee
     106        #elif category == 'hostel_maintenance':
     107        #    amount = academic_session.maint_fee
     108        elif category == 'hostel_application':
     109            amount = 1000.0
     110        elif category.startswith('tempmaint'):
     111            if not self._hostelApplicationPaymentMade(
     112                student, student.current_session):
     113                return _(
     114                    'You have not yet paid the hostel application fee.'), None
     115            if category == 'tempmaint_1':
     116                amount = 8150.0
     117            elif category == 'tempmaint_2':
     118                amount = 12650.0
     119            elif category == 'tempmaint_3':
     120                amount = 9650.0
    105121        elif category == 'clearance':
    106122            p_item = student.certcode
     
    196212        elif category == 'schoolfee':
    197213            amount += academic_session.penalty_ug
    198         # XXX: Obsolete in 2013
    199214        if category.startswith('tempmaint'):
    200215            p_item = getUtility(IKofaUtils).PAYMENT_CATEGORIES[category]
    201216            p_item = unicode(p_item)
    202217            # Now we change the category because tempmaint payments
    203             # will be obsolete in 2013
     218            # will be obsolete when Uniben returns to Kofa bed allocation.
    204219            category = 'hostel_maintenance'
    205220        # Create ticket.
  • main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py

    r12407 r12566  
    3535        'cest': 'Part-Time, Diploma, Certificate',
    3636        'pg_new': 'Supplementary PG Application',
     37        'pg_new2': 'Supplementary PG Application (#2)',
    3738        'dp_ft': 'Diploma Full-Time Programmes',
    3839        'pg': 'Postgraduate',
     
    5556        'schoolfee': 'School Fee',
    5657        'clearance': 'Acceptance Fee',
    57         'bed_allocation': 'Bed Allocation Fee',
     58        #'bed_allocation': 'Bed Allocation Fee',
     59        'hostel_application': 'Hostel Application Fee',
    5860        'hostel_maintenance': 'Hostel Maintenance Fee',
    5961        'tempmaint_1': 'Hall 1-4 M/F Ekehuan',
     
    7072        'schoolfee': 'School Fee',
    7173        'clearance': 'Acceptance Fee',
     74        'hostel_application': 'Hostel Application Fee',
    7275        'tempmaint_1': 'Hall 1-4 M/F Ekehuan Maintenance Fee',
    7376        'tempmaint_2': 'Hall 5 M/F Maintenance Fee',
Note: See TracChangeset for help on using the changeset viewer.