Ignore:
Timestamp:
23 Jul 2022, 16:21:58 (2 years ago)
Author:
Henrik Bettermann
Message:

Revert changes in students section.

File:
1 edited

Legend:

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

    r17029 r17031  
    6060            return _(u'Session configuration object is not available.'), None
    6161        # Determine fee.
    62         if category in ('schoolfee_1', 'secondinstal'):
    63             if student.state == CLEARED:
    64                 pass
    65             elif student.state == RETURNING:
    66                 # In case of returning school fee payment the
    67                 # payment session and level contain the values of
    68                 # the session the student has paid for. Payment
    69                 # session is always next session.
    70                 p_session, p_level = self.getReturningData(student)
    71                 academic_session = self._getSessionConfiguration(p_session)
    72                 if academic_session == None:
    73                     return _(
    74                         u'Session configuration object is not available.'
    75                         ), None
    76             elif student.is_postgrad and student.state == PAID:
    77                 # Returning postgraduate students also pay for the
    78                 # next session but their level always remains the
    79                 # same.
    80                 p_session += 1
    81                 academic_session = self._getSessionConfiguration(p_session)
    82                 if academic_session == None:
    83                     return _(
    84                         u'Session configuration object is not available.'
    85                         ), None
     62        if category in ('schoolfee', 'schoolfee_1', 'secondinstal'):
     63            try:
     64                certificate = student['studycourse'].certificate
     65                p_item = certificate.code
     66            except (AttributeError, TypeError):
     67                return _('Study course data are incomplete.'), None
     68            if previous_session:
     69                # Students can pay for previous sessions in all
     70                # workflow states.  Fresh students are excluded by the
     71                # update method of the PreviousPaymentAddFormPage.
     72                amount = getattr(certificate, 'school_fee_1', 0.0)
    8673            else:
    87                 return _('School fee payment not allowed. Wrong state.'), None
    88             if category == 'schoolfee_1':
    89                 amount = 220000.0
    90             elif category == 'secondinstal':
    91                 amount = 100000.0
     74                if category == 'secondinstal':
     75                    amount = 0.34 * getattr(certificate, 'school_fee_1', 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_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.66
    92104        elif category == 'clearance':
    93105            try:
Note: See TracChangeset for help on using the changeset viewer.