Ignore:
Timestamp:
8 Nov 2021, 08:41:58 (3 years ago)
Author:
Henrik Bettermann
Message:

Implement payment by instalments.

File:
1 edited

Legend:

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

    r16702 r16704  
    7070                # workflow states.  Fresh students are excluded by the
    7171                # update method of the PreviousPaymentAddFormPage.
    72                 if previous_level == 100:
    73                     amount = getattr(certificate, 'school_fee_1', 0.0)
     72                amount = getattr(certificate, 'school_fee_1', 0.0)
     73            else:
     74                if category == 'secondinstal':
     75                    amount = 0.4 * getattr(certificate, 'school_fee_1', 0.0)
    7476                else:
    75                     amount = getattr(certificate, 'school_fee_2', 0.0)
    76             else:
    77                 if student.state == CLEARED:
    78                     amount = getattr(certificate, 'school_fee_1', 0.0)
    79                 elif student.state == RETURNING:
    80                     # In case of returning school fee payment the
    81                     # payment session and level contain the values of
    82                     # the session the student has paid for. Payment
    83                     # session is always next session.
    84                     p_session, p_level = self.getReturningData(student)
    85                     academic_session = self._getSessionConfiguration(p_session)
    86                     if academic_session == None:
    87                         return _(
    88                             u'Session configuration object is not available.'
    89                             ), None
    90                     amount = getattr(certificate, 'school_fee_2', 0.0)
    91                 elif student.is_postgrad and student.state == PAID:
    92                     # Returning postgraduate students also pay for the
    93                     # next session but their level always remains the
    94                     # same.
    95                     p_session += 1
    96                     academic_session = self._getSessionConfiguration(p_session)
    97                     if academic_session == None:
    98                         return _(
    99                             u'Session configuration object is not available.'
    100                             ), None
    101                     amount = getattr(certificate, 'school_fee_2', 0.0)
     77                    if student.state == CLEARED:
     78                        amount = getattr(certificate, 'school_fee_1', 0.0)
     79                    elif student.state == RETURNING:
     80                        # In case of returning school fee payment the
     81                        # payment session and level contain the values of
     82                        # the session the student has paid for. Payment
     83                        # session is always next session.
     84                        p_session, p_level = self.getReturningData(student)
     85                        academic_session = self._getSessionConfiguration(p_session)
     86                        if academic_session == None:
     87                            return _(
     88                                u'Session configuration object is not available.'
     89                                ), None
     90                        amount = getattr(certificate, 'school_fee_1', 0.0)
     91                    elif student.is_postgrad and student.state == PAID:
     92                        # Returning postgraduate students also pay for the
     93                        # next session but their level always remains the
     94                        # same.
     95                        p_session += 1
     96                        academic_session = self._getSessionConfiguration(p_session)
     97                        if academic_session == None:
     98                            return _(
     99                                u'Session configuration object is not available.'
     100                                ), None
     101                        amount = getattr(certificate, 'school_fee_1', 0.0)
     102                    if category == 'schoolfee_1':
     103                        amount *= 0.6
    102104        elif category == 'clearance':
    103105            try:
Note: See TracChangeset for help on using the changeset viewer.