Ignore:
Timestamp:
22 Mar 2019, 11:07:57 (6 years ago)
Author:
Henrik Bettermann
Message:

Student must pay school fee only in states cleared and returning.

File:
1 edited

Legend:

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

    r15344 r15361  
    9292        req_payments = ('ict_entre', 'logbook_combo')
    9393        req_payments_titles = 'ICT and Logbook'
     94        # All ND and HND part time do not pay for LOGBOOK
     95        if student.current_mode.endswith('_pt'):
     96            req_payments = ('ict_entre',)
     97            req_payments_titles = 'ICT'
     98        # HND1 and HND2 full time do not pay for LOGBOOK
     99        elif student.current_mode == 'hnd_ft' and student.state in (
     100            CLEARED, RETURNING):
     101            req_payments = ('ict_entre',)
     102            req_payments_titles = 'ICT'
     103        # ND2 FULL TIME do not pay LOGBOOK
     104        elif student.current_mode == 'nd_ft' and student.state == RETURNING:
     105            req_payments = ('ict_entre',)
     106            req_payments_titles = 'ICT'
     107        num = 0
    94108        if len(student['payments']):
    95             # All ND and HND part time do not pay for LOGBOOK
    96             if student.current_mode.endswith('_pt'):
    97                 req_payments = ('ict_entre',)
    98                 req_payments_titles = 'ICT'
    99             # HND1 and HND2 full time do not pay for LOGBOOK
    100             elif student.current_mode == 'hnd_ft' and student.state in (
    101                 CLEARED, RETURNING):
    102                 req_payments = ('ict_entre',)
    103                 req_payments_titles = 'ICT'
    104             # ND2 FULL TIME do not pay LOGBOOK
    105             elif student.current_mode == 'nd_ft' and student.state == RETURNING:
    106                 req_payments = ('ict_entre',)
    107                 req_payments_titles = 'ICT'
    108             num = 0
    109109            for ticket in student['payments'].values():
    110110                if ticket.p_state == 'paid' and \
     
    117117
    118118    def setPaymentDetails(self, category, student,
    119             previous_session, previous_level):
     119            previous_session=None, previous_level=None):
    120120        """Create a payment ticket and set the payment data of a
    121121        student for the payment category specified.
     
    141141            p_level = student['studycourse'].current_level
    142142            p_current = True
     143        # The following three fees are part of the school fee which must be
     144        # paid before tuition fee. They are paid for next session.
     145        if category in ('ict_entre', 'logbook_combo', 'siwess_combo') and \
     146            student.state == RETURNING and not previous_session:
     147            p_session, p_level = self.getReturningData(student)
    143148        academic_session = self._getSessionConfiguration(p_session)
    144149        if academic_session == None:
    145150            return _(u'Session configuration object is not available.'), None
    146151        # Determine fee.
    147         # The following three fees are part of the school fee which must be
    148         # paid before tuition fee.
    149         if category in ('ict_entre', 'logbook_combo', 'siwess_combo') and \
    150             student.state == RETURNING and not previous_session:
    151             p_session, p_level = self.getReturningData(student)
    152152        if category == 'schoolfee':
    153153            try:
     
    159159                amount = getattr(certificate, 'school_fee_1', 0.0)
    160160            else:
    161                 amount = getattr(certificate, 'school_fee_1', 0.0)
    162                 if student.state == RETURNING:
     161                if student.state == CLEARED:
     162                    amount = getattr(certificate, 'school_fee_1', 0.0)
     163                elif student.state == RETURNING:
     164                    amount = getattr(certificate, 'school_fee_1', 0.0)
    163165                    # In case of returning school fee payment the
    164166                    # payment session and level contain the values of
     
    171173                            u'Session configuration object is not available.'
    172174                            ), None
    173                    
    174175                elif student.is_postgrad and student.state == PAID:
    175176                    # Returning postgraduate students also pay for the
    176177                    # next session but their level always remains the
    177178                    # same.
     179                    amount = getattr(certificate, 'school_fee_1', 0.0)
    178180                    p_session += 1
    179181                    academic_session = self._getSessionConfiguration(p_session)
Note: See TracChangeset for help on using the changeset viewer.