Changeset 9404 for main/waeup.futminna


Ignore:
Timestamp:
24 Oct 2012, 09:38:33 (12 years ago)
Author:
Henrik Bettermann
Message:

Configure hostel maintenance fee.

Location:
main/waeup.futminna/trunk/src/waeup/futminna/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py

    r9403 r9404  
    149149        self.assertEqual(payment.amount_auth, 20000.0)
    150150
     151        error, payment = utils.setPaymentDetails('schoolfee',self.student, 2004, 100)
     152        self.assertEqual(error, u'Previous session payment not yet implemented.')
     153
    151154        error, payment = utils.setPaymentDetails('clearance',self.student)
    152155        self.assertEqual(payment.p_level, 100)
     
    156159        self.assertEqual(error, None)
    157160
    158         error, payment = utils.setPaymentDetails('schoolfee',self.student, 2004, 100)
    159         self.assertEqual(error, u'Previous session payment not yet implemented.')
     161        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     162        self.assertEqual(payment.p_level, 100)
     163        self.assertEqual(payment.p_session, 2004)
     164        self.assertEqual(payment.amount_auth, 15000.0)
     165        self.assertEqual(payment.p_item, u'sse_male_fr')
     166        self.assertEqual(error, None)
     167
     168        self.student['studycourse'].certificate = self.certificate
     169        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     170        self.assertEqual(payment.p_level, 100)
     171        self.assertEqual(payment.p_session, 2004)
     172        self.assertEqual(payment.amount_auth, 10000.0)
     173        self.assertEqual(payment.p_item, u'regular_male_fr')
     174        self.assertEqual(error, None)
     175
     176        self.app['hostels'].accommodation_session = 2009
     177        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     178        self.assertEqual(error,
     179            'Current session does not match accommodation session.')
     180        self.assertEqual(payment, None)
    160181        return
    161182
     
    185206        self.browser.getControl("Create bed ticket").click()
    186207        # Bed is randomly selected but, since there is only
    187         # one bed for this student, we know that
     208        # one bed for this student, we know that ...
    188209        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
    189210                           self.browser.contents)
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r9403 r9404  
    115115            else:
    116116                amount = 20000.0
     117        elif category == 'hostel_maintenance':
     118            acc_details = self.getAccommodationDetails(student)
     119            if student['studycourse'].current_session != acc_details[
     120                'booking_session']:
     121                return _(u'Current session does not match accommodation session.'), None
     122            if student.faccode == 'SSE':
     123                amount = 15000.0
     124            elif student.current_level  in ('100','200','300','400','500') and \
     125                student.faccode in ('EET','SET','AAT','ICT','EMT'):
     126                amount = 12000.0
     127            else:
     128                amount = 10000.0
     129            p_item = acc_details['bt']
    117130        elif category == 'bed_allocation':
    118131            p_item = self.getAccommodationDetails(student)['bt']
Note: See TracChangeset for help on using the changeset viewer.