Ignore:
Timestamp:
12 Nov 2017, 17:02:44 (7 years ago)
Author:
Henrik Bettermann
Message:

Old returning students get a discount of N30000 (science) and N28000 (non-science) respectively. we use the custom_textline_1 attribute of certificates to distinguish science and non-science students.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r14857 r14892  
    542542        IWorkflowState(self.student).setState('returning')
    543543
    544 
    545544        #error, payment = utils.setPaymentDetails('schoolfee',
    546545        #    self.student, None, None)
     
    565564        self.assertEqual(error, None)
    566565
     566        # Old returning students pay less
     567        self.certificate.school_fee_2 = 50000.0
     568        self.certificate.custom_textline_1 = 'sciEnce'
     569        error, payment = utils.setPaymentDetails(
     570            'schoolfee', self.student, None, None)
     571        # minus 30000
     572        self.assertEqual(payment.amount_auth, 20088.0)
     573        self.certificate.custom_textline_1 = 'non-Science'
     574        error, payment = utils.setPaymentDetails(
     575            'schoolfee', self.student, None, None)
     576        # minus 28000
     577        self.assertEqual(payment.amount_auth, 22088.0)
     578
    567579        # Staff members pay less.
     580        self.certificate.custom_textline_1 = ''
    568581        self.student.is_staff = True
    569582        error, payment = utils.setPaymentDetails('schoolfee',
     
    571584        self.assertEqual(payment.p_level, 200)
    572585        self.assertEqual(payment.p_session, 2005)
    573         self.assertEqual(payment.amount_auth, 10088.0)
     586        self.assertEqual(payment.amount_auth, 25088.0)
    574587        self.assertEqual(payment.p_item, u'CERT1')
    575588        self.assertEqual(error, None)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r14858 r14892  
    351351                    else:
    352352                        amount = getattr(certificate, 'school_fee_2', 0.0)
     353                        # Old returning students get a discount of
     354                        # N30000 and N28000 respectively.
     355                        if student.entry_session < 2017 \
     356                            and certificate.custom_textline_1:
     357                            if certificate.custom_textline_1.lower() == 'science':
     358                                amount -= 30000
     359                            elif certificate.custom_textline_1.lower() == 'non-science':
     360                                amount -= 28000
    353361            # Give 50% school fee discount to staff members.
    354362            if student.is_staff:
Note: See TracChangeset for help on using the changeset viewer.