Changeset 9888 for main/waeup.futminna


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

pg school fees are set in certificates (in contrast to ug fees). If a penalty fee is set 9999 school fee payment is disabled for the respective mode.

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

    r9732 r9888  
    145145        self.assertEqual(error, None)
    146146
     147        self.certificate2.study_mode = 'pg_ft'
     148        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     149        self.assertEqual(error, u'Amount could not be determined.')
     150        self.certificate2.school_fee_1 = 876.55
     151        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     152        self.assertEqual(payment.amount_auth, 876.55)
     153
    147154        self.certificate2.study_mode = 'jm_ft'
    148155        error, payment = utils.setPaymentDetails('schoolfee',self.student)
  • main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py

    r9732 r9888  
    7878            except (AttributeError, TypeError):
    7979                return _('Study course data are incomplete.'), None
    80             if student.current_mode.endswith('_ft'):
     80            if student.is_postgrad:
     81                if student.state == CLEARED:
     82                    if student.is_foreigner:
     83                        amount = getattr(certificate, 'school_fee_3', 0.0)
     84                    else:
     85                        amount = getattr(certificate, 'school_fee_1', 0.0)
     86                elif student.state == RETURNING:
     87                    if student.is_foreigner:
     88                        amount = getattr(certificate, 'school_fee_4', 0.0)
     89                    else:
     90                        amount = getattr(certificate, 'school_fee_2', 0.0)
     91            elif student.current_mode.endswith('_ft'):
    8192                # fresh remedial
    8293                if student.current_level == 10 and student.state == CLEARED:
     
    149160        # Add session specific penalty fee.
    150161        if category == 'schoolfee' and student.is_postgrad:
    151             amount += academic_session.penalty_pg
     162            if academic_session.penalty_pg == 9999.0:
     163                amount = 0.0
     164            else:
     165                amount += academic_session.penalty_pg
    152166        elif category == 'schoolfee':
    153             amount += academic_session.penalty_ug
     167            if academic_session.penalty_ug == 9999.0:
     168                amount = 0.0
     169            else:
     170                amount += academic_session.penalty_ug
    154171        payment = createObject(u'waeup.StudentOnlinePayment')
    155172        timestamp = ("%d" % int(time()*10000))[1:]
Note: See TracChangeset for help on using the changeset viewer.