Ignore:
Timestamp:
26 Oct 2012, 20:59:03 (12 years ago)
Author:
Henrik Bettermann
Message:

Link maintenance payment with bedticket. This way we can forgo a secon maint. payment category. The amount depends now on the bed really booked.

File:
1 edited

Legend:

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

    r9409 r9431  
    116116                amount = 20000.0
    117117        elif category == 'hostel_maintenance':
     118            current_session = student['studycourse'].current_session
     119            bedticket = student['accommodation'].get(str(current_session), None)
     120            if bedticket:
     121                p_item = bedticket.bed_coordinates
     122            else:
     123                return _(u'You have not yet booked accommodation.'), None
    118124            acc_details = self.getAccommodationDetails(student)
    119             if student['studycourse'].current_session != acc_details[
    120                 'booking_session']:
     125            if current_session != acc_details['booking_session']:
    121126                return _(u'Current session does not match accommodation session.'), None
    122             if student.current_level  in ('100','200','300','400','500') and \
     127            if bedticket.bed.bed_id.startswith('block-h'):
     128                amount = 15000.0
     129            elif student.current_level  in (100,200,300,400,500) and \
    123130                student.faccode in ('EET','SET','AAT','ICT','EMT'):
    124131                amount = 12000.0
    125132            else:
    126133                amount = 10000.0
    127             p_item = acc_details['bt']
    128         elif category == 'block_h_maintenance':
    129             acc_details = self.getAccommodationDetails(student)
    130             if student['studycourse'].current_session != acc_details[
    131                 'booking_session']:
    132                 return _(u'Current session does not match accommodation session.'), None
    133             amount = 15000.0
    134             p_item = acc_details['bt']
    135134        elif category == 'bed_allocation':
    136135            p_item = self.getAccommodationDetails(student)['bt']
Note: See TracChangeset for help on using the changeset viewer.