Changeset 17182 for main


Ignore:
Timestamp:
30 Nov 2022, 14:09:18 (2 years ago)
Author:
Henrik Bettermann
Message:

p_session of bed allocation and maintenance fees is always the portal’s accommodation session and not the student’s current session.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r17176 r17182  
    22672267        # The hostel_application payment category is temporarily used
    22682268        # by Uniben.
    2269         if p_category in (
    2270                 'bed_allocation', 'hostel_application') and grok.getSite()[
    2271                     'hostels'].accommodation_session - student[
    2272                         'studycourse'].current_session > students_utils.ACCOMMODATION_SPAN:
     2269        accommodation_session = grok.getSite()['hostels'].accommodation_session
     2270        if p_category in ('bed_allocation', 'hostel_application') \
     2271            and accommodation_session - student[
     2272                'studycourse'].current_session > students_utils.ACCOMMODATION_SPAN:
    22732273                self.flash(
    22742274                    _('Your current session does not allow ' + \
     
    22762276                return
    22772277        if 'maintenance' in p_category:
    2278             current_session = str(student['studycourse'].current_session)
    2279             if not current_session in student['accommodation']:
     2278            if str(accommodation_session) not in student['accommodation']:
    22802279                self.flash(_('You have not yet booked accommodation.'),
    22812280                           type="warning")
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r17176 r17182  
    490490            amount = academic_session.clearance_fee
    491491        elif category == 'bed_allocation':
    492             p_item = self.getAccommodationDetails(student)['bt']
     492            acco_details = self.getAccommodationDetails(student)
     493            p_session = acco_details['booking_session']
     494            p_item = acco_details['bt']
    493495            amount = academic_session.booking_fee
    494496        elif category == 'hostel_maintenance':
    495497            amount = 0.0
    496             bedticket = student['accommodation'].get(
    497                 str(student.current_session), None)
     498            booking_session = grok.getSite()['hostels'].accommodation_session
     499            bedticket = student['accommodation'].get(str(booking_session), None)
    498500            if bedticket is not None and bedticket.bed is not None:
     501                p_session = booking_session
    499502                p_item = bedticket.bed_coordinates
    500503                if bedticket.bed.__parent__.maint_fee > 0:
Note: See TracChangeset for help on using the changeset viewer.