Changeset 9611 for main/waeup.fceokene


Ignore:
Timestamp:
10 Nov 2012, 21:02:02 (12 years ago)
Author:
Henrik Bettermann
Message:

Check if bed has been booked and save bed coordinates in payment ticket.

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

Legend:

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

    r9525 r9611  
    253253        self.assertEqual(error, None)
    254254
     255        self.student['studycourse'].current_session = 2005
    255256        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
     257        self.assertEqual(payment, None)
     258        self.assertEqual(error, 'You have not yet booked accommodation.')
     259        self.student['studycourse'].current_session = 2004
     260
     261        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
    256262        self.assertEqual(payment.p_level, 100)
    257263        self.assertEqual(payment.p_session, 2004)
    258264        self.assertEqual(payment.amount_auth, 180.0)
    259         self.assertEqual(payment.p_item, u'')
     265        self.assertEqual(payment.p_item, u'My bed coordinates')
    260266        self.assertEqual(error, None)
    261267
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r9525 r9611  
    8282            amount = academic_session.booking_fee
    8383        elif category == 'hostel_maintenance':
     84            current_session = student['studycourse'].current_session
     85            bedticket = student['accommodation'].get(str(current_session), None)
     86            if bedticket is not None and bedticket.bed is not None:
     87                p_item = bedticket.bed_coordinates
     88            else:
     89                return _(u'You have not yet booked accommodation.'), None
     90            acc_details = self.getAccommodationDetails(student)
     91            if current_session != acc_details['booking_session']:
     92                return _(u'Current session does not match accommodation session.'), None
    8493            amount = academic_session.maint_fee
    8594        elif category == 'clearance':
Note: See TracChangeset for help on using the changeset viewer.