Changeset 17391 for main


Ignore:
Timestamp:
26 Apr 2023, 12:20:53 (20 months ago)
Author:
Henrik Bettermann
Message:

Student union dues must be paid before tuition fee.

Location:
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interswitch/tests.py

    r16326 r17391  
    6262        self.browser.getControl("Create ticket").click()
    6363        self.assertTrue(
    64             'Pay ICT and Logbook fee(s) first.' in self.browser.contents)
     64            'Pay ICT, Student Union and Logbook fee(s) first.' in self.browser.contents)
    6565
    6666        # Add required payments first.
     
    8383        payment.p_session = 2004
    8484        self.student['payments']['345'] = payment
     85        payment = createObject('waeup.StudentOnlinePayment')
     86        payment.p_state = 'paid'
     87        payment.p_category = 'union'
     88        payment.p_id = '567'
     89        payment.p_session = 2004
     90        self.student['payments']['567'] = payment
    8591
    8692        self.browser.open(self.payments_path + '/addop')
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/tests/test_utils.py

    r17102 r17391  
    7171        self.app['configuration']['2004'].ict_entre_fee = 4170.0
    7272        self.app['configuration']['2005'].ict_entre_fee = 2180.0
     73        self.app['configuration']['2004'].union_fee = 1234.0
     74        self.app['configuration']['2005'].union_fee = 1434.0
    7375        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    74         self.assertEqual(error, u'Pay ICT fee(s) first.')
     76        self.assertEqual(error, u'Pay Student Union and ICT fee(s) first.')
    7577        error, payment = utils.setPaymentDetails('ict_entre',self.student)
    7678        self.assertEqual(error, None)
     
    8082        payment.p_state = 'paid'
    8183        self.student['payments']['any_key'] = payment
     84        error, payment = utils.setPaymentDetails('union',self.student)
     85        self.assertEqual(error, None)
     86        self.assertEqual(payment.p_level, 200)
     87        self.assertEqual(payment.p_session, 2005)
     88        self.assertEqual(payment.amount_auth, 1434.0)
     89        payment.p_state = 'paid'
     90        self.student['payments']['any_key_2'] = payment
    8291        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    8392        self.assertEqual(error, None)
     
    93102        self.assertEqual(payment.amount_auth, 4170.0)
    94103        payment.p_state = 'paid'
    95         self.student['payments']['any_key_2'] = payment
     104        self.student['payments']['any_key_3'] = payment
     105        error, payment = utils.setPaymentDetails('union',self.student)
     106        self.assertEqual(error, None)
     107        self.assertEqual(payment.p_level, 100)
     108        self.assertEqual(payment.p_session, 2004)
     109        self.assertEqual(payment.amount_auth, 1234.0)
     110        payment.p_state = 'paid'
     111        self.student['payments']['any_key_4'] = payment
    96112        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    97113        self.assertEqual(error, None)
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py

    r17265 r17391  
    9090    def _requiredPaymentsMade(self, student, session):
    9191        # SIWESS fee requirement removed on 18/01/2019
    92         req_payments = ('ict_entre', 'logbook_combo')
    93         req_payments_titles = 'ICT and Logbook'
     92        req_payments = ('ict_entre', 'logbook_combo','union')
     93        req_payments_titles = 'ICT, Student Union and Logbook'
    9494        # All ND and HND part time do not pay for LOGBOOK
    9595        if student.current_mode.endswith('_pt'):
    96             req_payments = ('ict_entre',)
    97             req_payments_titles = 'ICT'
     96            req_payments = ('ict_entre', 'union')
     97            req_payments_titles = 'Student Union and ICT'
    9898        # HND1 and HND2 full time do not pay for LOGBOOK
    9999        elif student.current_mode == 'hnd_ft' and student.state in (
    100100            CLEARED, RETURNING):
    101             req_payments = ('ict_entre',)
    102             req_payments_titles = 'ICT'
     101            req_payments = ('ict_entre', 'union')
     102            req_payments_titles = 'Student Union and ICT'
    103103        # ND2 FULL TIME do not pay LOGBOOK
    104104        elif student.current_mode == 'nd_ft' and student.state == RETURNING:
    105             req_payments = ('ict_entre',)
    106             req_payments_titles = 'ICT'
     105            req_payments = ('ict_entre', 'union')
     106            req_payments_titles = 'Student Union and ICT'
    107107        num = 0
    108108        if len(student['payments']):
     
    153153            p_level = student['studycourse'].current_level
    154154            p_current = True
    155         # The following three fees are part of the school fee which must be
     155        # The following fout fees are part of the school fee which must be
    156156        # paid before tuition fee. They are paid for next session.
    157         if category in ('ict_entre', 'logbook_combo', 'siwess_combo') and \
     157        if category in ('ict_entre', 'logbook_combo', 'siwess_combo', 'union') and \
    158158            student.state == RETURNING and not previous_session:
    159159            p_session, p_level = self.getReturningData(student)
Note: See TracChangeset for help on using the changeset viewer.