Changeset 15780 for main


Ignore:
Timestamp:
8 Nov 2019, 06:58:44 (5 years ago)
Author:
Henrik Bettermann
Message:

Second instalments can be paid in all registration states.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py

    r15773 r15780  
    9595                else:
    9696                    amount = getattr(certificate, 'school_fee_2', 0.0)
     97                if category == 'schoolfee40':
     98                    amount = 0.4*amount
     99                elif category == 'secondinstal':
     100                    amount = 0.6*amount
    97101            else:
    98                 if student.state == CLEARED:
    99                     amount = getattr(certificate, 'school_fee_1', 0.0)
    100                 elif student.state == RETURNING:
    101                     # In case of returning school fee payment the
    102                     # payment session and level contain the values of
    103                     # the session the student has paid for. Payment
    104                     # session is always next session.
    105                     p_session, p_level = self.getReturningData(student)
    106                     academic_session = self._getSessionConfiguration(p_session)
    107                     if academic_session == None:
    108                         return _(
    109                             u'Session configuration object is not available.'
    110                             ), None
    111                     amount = getattr(certificate, 'school_fee_2', 0.0)
    112                 elif student.is_postgrad and student.state == PAID:
    113                     # Returning postgraduate students also pay for the
    114                     # next session but their level always remains the
    115                     # same.
    116                     p_session += 1
    117                     academic_session = self._getSessionConfiguration(p_session)
    118                     if academic_session == None:
    119                         return _(
    120                             u'Session configuration object is not available.'
    121                             ), None
    122                     amount = getattr(certificate, 'school_fee_2', 0.0)
    123                 if amount and category == 'schoolfee40':
    124                     amount = 0.4*amount
    125                 elif amount and category == 'secondinstal':
    126                     amount = 0.6*amount
     102                if category == 'secondinstal':
     103                    if student.is_fresh:
     104                        amount = 0.6 * getattr(certificate, 'school_fee_1', 0.0)
     105                    else:
     106                        amount = 0.6 * getattr(certificate, 'school_fee_2', 0.0)
     107                else:
     108                    if student.state == CLEARED:
     109                        amount = getattr(certificate, 'school_fee_1', 0.0)
     110                    elif student.state == RETURNING:
     111                        # In case of returning school fee payment the
     112                        # payment session and level contain the values of
     113                        # the session the student has paid for. Payment
     114                        # session is always next session.
     115                        p_session, p_level = self.getReturningData(student)
     116                        academic_session = self._getSessionConfiguration(p_session)
     117                        if academic_session == None:
     118                            return _(
     119                                u'Session configuration object is not available.'
     120                                ), None
     121                        amount = getattr(certificate, 'school_fee_2', 0.0)
     122                    elif student.is_postgrad and student.state == PAID:
     123                        # Returning postgraduate students also pay for the
     124                        # next session but their level always remains the
     125                        # same.
     126                        p_session += 1
     127                        academic_session = self._getSessionConfiguration(p_session)
     128                        if academic_session == None:
     129                            return _(
     130                                u'Session configuration object is not available.'
     131                                ), None
     132                        amount = getattr(certificate, 'school_fee_2', 0.0)
     133                    if amount and category == 'schoolfee40':
     134                        amount = 0.4*amount
    127135        elif category == 'clearance':
    128136            try:
Note: See TracChangeset for help on using the changeset viewer.