Ignore:
Timestamp:
13 Nov 2017, 09:04:23 (7 years ago)
Author:
Henrik Bettermann
Message:

Use custom_float_1 for old returning student discount.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/browser/pages.py

    r14890 r14893  
    8383    form_fields = grok.AutoFields(ICertificate).omit(
    8484        'ratio',
    85         'custom_textline_2',
    86         'custom_float_1', 'custom_float_2')
     85        'custom_textline_1', 'custom_textline_2',
     86        'custom_float_2')
    8787
    8888class CustomCertificateManageFormPage(CertificateManageFormPage):
     
    9191    form_fields = grok.AutoFields(ICertificate).omit(
    9292        'ratio',
    93         'custom_textline_2',
    94         'custom_float_1', 'custom_float_2')
     93        'custom_textline_1', 'custom_textline_2',
     94        'custom_float_2')
  • main/waeup.uniben/trunk/src/waeup/uniben/locales/en/LC_MESSAGES/waeup.kofa.po

    r14890 r14893  
    4545"really want to submit?"
    4646
    47 msgid "Custom Textline 1 (not used)"
    48 msgstr "Science / Non-Science"
     47msgid "Custom Float 1 (not used)"
     48msgstr "Old Returning Discount"
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r14892 r14893  
    555555        #self.student['payments']['anykey'] = payment
    556556
    557 
    558557        error, payment = utils.setPaymentDetails('schoolfee',
    559558            self.student, None, None)
     
    564563        self.assertEqual(error, None)
    565564
    566         # Old returning students pay less
     565        # Old returning students may pay less.
    567566        self.certificate.school_fee_2 = 50000.0
    568         self.certificate.custom_textline_1 = 'sciEnce'
     567        self.certificate.custom_float_1 = 30000.0
    569568        error, payment = utils.setPaymentDetails(
    570569            'schoolfee', self.student, None, None)
    571         # minus 30000
    572570        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)
    578571
    579572        # Staff members pay less.
    580         self.certificate.custom_textline_1 = ''
     573        self.certificate.custom_float_1 = None
    581574        self.student.is_staff = True
    582575        error, payment = utils.setPaymentDetails('schoolfee',
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r14892 r14893  
    351351                    else:
    352352                        amount = getattr(certificate, 'school_fee_2', 0.0)
    353                         # Old returning students get a discount of
    354                         # N30000 and N28000 respectively.
     353                        # Old returning students might get a discount.
    355354                        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
     355                            and certificate.custom_float_1:
     356                            amount -= certificate.custom_float_1
    361357            # Give 50% school fee discount to staff members.
    362358            if student.is_staff:
Note: See TracChangeset for help on using the changeset viewer.