Changeset 8596


Ignore:
Timestamp:
2 Jun 2012, 07:24:14 (13 years ago)
Author:
Henrik Bettermann
Message:

Choose correct school fee.

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

Legend:

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

    r8556 r8596  
    12701270        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    12711271        self.browser.open(self.payments_path)
     1272        IWorkflowState(self.student).setState('cleared')
    12721273        self.browser.getControl("Add online payment ticket").click()
    12731274        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    12801281        self.assertMatches('...Amount Authorized...',
    12811282                           self.browser.contents)
     1283        self.assertEqual(self.student['payments'][value].amount_auth, 40000.0)
    12821284        payment_url = self.browser.url
    12831285
     
    14551457        self.assertMatches('...Amount Authorized...',
    14561458                           self.browser.contents)
    1457         self.assertEqual(self.student['payments'][value].amount_auth, 40000.0)
     1459        self.assertEqual(self.student['payments'][value].amount_auth, 20000.0)
    14581460        # Payment session and will be calculated as defined
    14591461        # in w.k.students.utils because we set changed the state
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r8595 r8596  
    3737from zope.formlib.form import setUpEditWidgets
    3838
    39 from waeup.kofa.interfaces import IExtFileStore, IKofaUtils, RETURNING, PAID
     39from waeup.kofa.interfaces import (
     40    IExtFileStore, IKofaUtils, RETURNING, PAID, CLEARED)
    4041from waeup.kofa.interfaces import MessageFactory as _
    4142from waeup.kofa.students.interfaces import IStudentsUtils
     
    272273        if category == 'schoolfee':
    273274            try:
    274                 amount = getattr(
    275                     student['studycourse'].certificate,'school_fee_1')
    276                 p_item = student['studycourse'].certificate.code
     275                certificate = student['studycourse'].certificate
     276                p_item = certificate.code
    277277            except (AttributeError, TypeError):
    278278                return _('Study course data are incomplete.'), None
    279             if student.state == RETURNING:
     279            if student.state == CLEARED:
     280                amount = getattr(certificate, 'school_fee_1', 0.0)
     281            elif student.state == RETURNING:
    280282                # In case of returning school fee payment the payment session
    281283                # and level contain the values of the session the student
    282284                # has paid for.
    283285                p_session, p_level = self.getReturningData(student)
     286                amount = getattr(certificate, 'school_fee_2', 0.0)
    284287            elif student.is_postgrad and student.state == PAID:
    285288                # Returning postgraduate students also pay for the next session
    286289                # but their level always remains the same.
    287290                p_session += 1
    288                 amount = getattr(
    289                     student['studycourse'].certificate,'school_fee_2')
     291                amount = getattr(certificate, 'school_fee_2', 0.0)
    290292        elif category == 'clearance':
    291293            p_item = student['studycourse'].certificate.code
Note: See TracChangeset for help on using the changeset viewer.