Changeset 9889


Ignore:
Timestamp:
15 Jan 2013, 15:14:00 (12 years ago)
Author:
Henrik Bettermann
Message:

Add test for disabling school fee payment and fix method.

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

    r9888 r9889  
    176176
    177177        # Penalty fee is taken into consideration
     178        self.app['configuration']['2005'].penalty_ug = 9999.0
     179        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     180        self.assertEqual(error, u'School fee payment disabled.')
    178181        self.app['configuration']['2005'].penalty_ug = 3000.0
    179182        error, payment = utils.setPaymentDetails('schoolfee',self.student)
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r9888 r9889  
    149149            p_item = self.getAccommodationDetails(student)['bt']
    150150            amount = academic_session.booking_fee
     151        if 9999.0 in (academic_session.penalty_pg, academic_session.penalty_ug):
     152            return _('School fee payment disabled.'), None
    151153        if amount in (0.0, None):
    152154            return _('Amount could not be determined.'), None
     
    160162        # Add session specific penalty fee.
    161163        if category == 'schoolfee' and student.is_postgrad:
    162             if academic_session.penalty_pg == 9999.0:
    163                 amount = 0.0
    164             else:
    165                 amount += academic_session.penalty_pg
     164            amount += academic_session.penalty_pg
    166165        elif category == 'schoolfee':
    167             if academic_session.penalty_ug == 9999.0:
    168                 amount = 0.0
    169             else:
    170                 amount += academic_session.penalty_ug
     166            amount += academic_session.penalty_ug
    171167        payment = createObject(u'waeup.StudentOnlinePayment')
    172168        timestamp = ("%d" % int(time()*10000))[1:]
Note: See TracChangeset for help on using the changeset viewer.