Changeset 15178 for main/waeup.aaue


Ignore:
Timestamp:
26 Sep 2018, 14:15:21 (6 years ago)
Author:
Henrik Bettermann
Message:

https://aaue-trac.waeup.org/ticket/487#comment:4

The restitution was only for returning students of 2016/2017. Hence, it is only valid for 2016 payment session returning students.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r15090 r15178  
    139139
    140140        restitution_paid = True
    141         if self.student.entry_session < 2016 \
    142             and self.student.current_mode in ('ug_ft', 'dp_ft'):
     141        if self.student.current_session == 2016 \
     142            and self.student.current_mode in ('ug_ft', 'dp_ft') \
     143            and not self.student.is_fresh:
    143144            restitution_paid = False
    144145            for ticket in self.student['payments'].values():
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14944 r15178  
    617617
    618618    def test_late_registration(self):
    619         self.app['configuration']['2004'].restitution_fee = 9999.0
    620619        delta = timedelta(days=10)
    621620        self.app['configuration'][
     
    625624        # returning students.
    626625        self.student['studycourse'].entry_session = 2003
     626        self.student['studycourse'].current_session = 2016
    627627        # Login
    628628        self.browser.open(self.login_path)
     
    631631        self.browser.getControl("Login").click()
    632632        # Make restitution fee payment
     633        # Ivie: The restitution was only for returning students of 2016/2017.
     634        # Hence, it is only valid for 2016 payment session returning students.
     635        configuration = createObject('waeup.SessionConfiguration')
     636        configuration.academic_session = 2016
     637        self.app['configuration'].addSessionConfiguration(configuration)
     638        self.app['configuration']['2016'].restitution_fee = 9999.0
    633639        self.browser.open(self.payments_path + '/addop')
    634640        self.browser.getControl(name="form.p_category").value = ['restitution']
     
    636642        self.student['payments'].values()[0].approveStudentPayment()
    637643        # Make late registration fee fee payment
     644        self.student['studycourse'].current_session = 2004
    638645        self.browser.open(self.payments_path + '/addop')
    639646        self.browser.getControl(name="form.p_category").value = ['late_registration']
     
    10111018        IWorkflowState(self.student).setState('school fee paid')
    10121019        self.student['studycourse'].entry_session = 2004
    1013         self.student['studycourse'].current_session = 2004
     1020        self.student['studycourse'].current_session = 2016
    10141021        self.browser.open(self.login_path)
    10151022        self.browser.getControl(name="form.login").value = self.student_id
     
    10311038        self.assertTrue('Please pay restitution fee first'
    10321039            in self.browser.contents)
    1033         self.app['configuration']['2004'].restitution_fee = 9999.0
     1040        configuration = createObject('waeup.SessionConfiguration')
     1041        configuration.academic_session = 2016
     1042        self.app['configuration'].addSessionConfiguration(configuration)
     1043        self.app['configuration']['2016'].restitution_fee = 9999.0
    10341044        self.browser.open(self.payments_path + '/addop')
    10351045        self.browser.getControl(name="form.p_category").value = ['restitution']
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r15095 r15178  
    149149        self.assertEqual(error, 'Restitution fee payment not required.')
    150150        self.student['studycourse'].certificate.study_mode = 'ug_ft'
    151         self.app['configuration']['2004'].restitution_fee = 1111.0
     151        configuration = createObject('waeup.SessionConfiguration')
     152        self.app['configuration']['2016'].restitution_fee = 1111.0
     153        self.student['studycourse'].current_session = 2016
    152154        error, payment = utils.setPaymentDetails('restitution',self.student)
    153155        self.assertEqual(payment.p_level, 100)
    154         self.assertEqual(payment.p_session, 2004)
     156        self.assertEqual(payment.p_session, 2016)
    155157        self.assertEqual(payment.amount_auth, 1111.0)
    156158        self.assertEqual(payment.p_item, u'')
    157159        self.assertEqual(error, None)
    158160
     161        self.student['studycourse'].current_session = 2004
    159162        error, payment = utils.setPaymentDetails('clearance',self.student, 2004, 100)
    160163        self.assertEqual(error, 'This is not a previous session.')
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r15096 r15178  
    299299            amount = academic_session.booking_fee
    300300        elif category == 'restitution':
    301             if student.entry_session >= 2016 \
    302                 or student.current_mode not in ('ug_ft', 'dp_ft'):
     301            if student.current_session != 2016 \
     302                or student.current_mode not in ('ug_ft', 'dp_ft') \
     303                or student.is_fresh:
    303304                return _(u'Restitution fee payment not required.'), None
    304305            amount = academic_session.restitution_fee
Note: See TracChangeset for help on using the changeset viewer.