Changeset 8307


Ignore:
Timestamp:
29 Apr 2012, 06:51:19 (12 years ago)
Author:
Henrik Bettermann
Message:

Remove school fee from session configuration. School fees are now attributes of the certificates.

Adjust and improve tests.

Fix getPaymentDetails.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py

    r8260 r8307  
    571571        )
    572572
    573     school_fee_base = schema.Float(
    574         title = _(u'School Fee'),
    575         default = 0.0,
    576         )
    577 
    578573    application_fee = schema.Float(
    579574        title = _(u'Application Fee'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8305 r8307  
    14141414                           self.browser.contents)
    14151415
    1416         # Students can add online school fee payment tickets
     1416        # Students can add online school fee payment tickets.
     1417        IWorkflowState(self.student).setState('returning')
    14171418        self.browser.open(self.payments_path)
    14181419        self.browser.getControl("Add online payment ticket").click()
     
    14261427        self.assertMatches('...Amount Authorized...',
    14271428                           self.browser.contents)
    1428         # Payment session and level have been calculated as defined
    1429         # in w.k.students.utils
     1429        self.assertEqual(self.student['payments'][value].amount_auth, 40000.0)
     1430        # Payment session and will be calculated as defined
     1431        # in w.k.students.utils because we set changed the state
     1432        # to returning
    14301433        self.assertEqual(self.student['payments'][value].p_session, 2005)
    14311434        self.assertEqual(self.student['payments'][value].p_level, 200)
     
    14531456
    14541457        # The new SFE-0 pin can be used for starting course registration
    1455         IWorkflowInfo(self.student).fireTransition('request_clearance')
    1456         IWorkflowInfo(self.student).fireTransition('clear')
    14571458        self.browser.open(self.studycourse_path)
    14581459        self.browser.getLink('Start course registration').click()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r8268 r8307  
    3636from zope.formlib.form import setUpEditWidgets
    3737
    38 from waeup.kofa.interfaces import IExtFileStore, IKofaUtils
     38from waeup.kofa.interfaces import IExtFileStore, IKofaUtils, RETURNING
    3939from waeup.kofa.interfaces import MessageFactory as _
    4040from waeup.kofa.students.interfaces import IStudentsUtils
     
    259259        specified.
    260260        """
    261         d = {}
    262         d['p_item'] = u''
    263         d['amount'] = 0.0
    264         d['error'] = u''
    265         d['p_session'] = student['studycourse'].current_session
    266         d['p_level'] = student['studycourse'].current_level
    267         session = str(d['p_session'])
     261        details = {}
     262        details['p_item'] = u''
     263        details['amount'] = 0.0
     264        details['error'] = u''
     265        details['p_session'] = student['studycourse'].current_session
     266        details['p_level'] = student['studycourse'].current_level
     267        session = str(details['p_session'])
    268268        try:
    269269            academic_session = grok.getSite()['configuration'][session]
    270270        except KeyError:
    271             d['error'] = u'Session configuration object is not available.'
    272             return d
     271            details['error'] = u'Session configuration object is not available.'
     272            return details
    273273        if category == 'schoolfee':
    274             d['amount'] = academic_session.school_fee_base
    275             d['p_item'] = student['studycourse'].certificate.code
    276             # In case of school fee payment the payment session and level
    277             # contain the values of the session the student has paid for
    278             d['p_session'], d['p_level'] = self.getReturningData(student)
     274            details['amount'] = getattr(
     275                student['studycourse'].certificate,'school_fee_1')
     276            details['p_item'] = student['studycourse'].certificate.code
     277            if student.state == RETURNING:
     278                # In case of returning school fee payment the payment session
     279                # and level contain the values of the session the student
     280                # has paid for.
     281                details['p_session'], details[
     282                    'p_level'] = self.getReturningData(student)
    279283        elif category == 'clearance':
    280             d['p_item'] = student['studycourse'].certificate.code
    281             d['amount'] = academic_session.clearance_fee
     284            details['p_item'] = student['studycourse'].certificate.code
     285            details['amount'] = academic_session.clearance_fee
    282286        elif category == 'bed_allocation':
    283             d['p_item'] = self.getAccommodationDetails(student)['bt']
    284             d['amount'] = academic_session.booking_fee
    285         return d
     287            details['p_item'] = self.getAccommodationDetails(student)['bt']
     288            details['amount'] = academic_session.booking_fee
     289        return details
    286290
    287291    def getAccommodationDetails(self, student):
Note: See TracChangeset for help on using the changeset viewer.