Ignore:
Timestamp:
12 May 2012, 16:27:14 (13 years ago)
Author:
Henrik Bettermann
Message:

Managers do not 'pay' fees for applicants and students, they approve payments made.

Add respective transitions.

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

Legend:

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

    r8428 r8434  
    362362        transition.
    363363        """
    364         allowed_transitions = self.wf_info.getManualTransitions()
     364        allowed_transitions = [t for t in self.wf_info.getManualTransitions()
     365            if not t[0].startswith('pay')]
    365366        return [dict(name='', title=_('No transition'))] +[
    366367            dict(name=x, title=y) for x, y in allowed_transitions]
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8429 r8434  
    725725        self.browser.getControl(name="transition").value = ['clear']
    726726        self.browser.getControl("Save").click()
     727        # Managers approve payment, they do not pay
     728        self.assertFalse('pay_first_school_fee' in self.browser.contents)
    727729        self.browser.getControl(
    728             name="transition").value = ['pay_first_school_fee']
     730            name="transition").value = ['approve_first_school_fee']
    729731        self.browser.getControl("Save").click()
    730732        self.browser.getControl(name="transition").value = ['reset6']
     
    732734        # In state returning the pay_school_fee transition triggers some
    733735        # changes of attributes
    734         self.browser.getControl(name="transition").value = ['pay_school_fee']
     736        self.browser.getControl(name="transition").value = ['approve_school_fee']
    735737        self.browser.getControl("Save").click()
    736738        self.assertEqual(student['studycourse'].current_session, 2005) # +1
     
    13991401        self.assertEqual(payment.r_amount_approved, 3456.0)
    14001402        self.assertEqual(payment.r_code, 'AP')
    1401         self.assertEqual(payment.r_desc, u'Payment approved by K1000000')
     1403        self.assertEqual(payment.r_desc, u'Payment approved by Anna Tester')
    14021404        # The new CLR-0 pin has been created
    14031405        self.assertEqual(len(self.app['accesscodes']['CLR-0']),1)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py

    r8309 r8434  
    9090
    9191    Transition(
     92        transition_id = 'approve_first_school_fee',
     93        title = _('Approve payment'),
     94        msg = _('School fee payment approved'),
     95        source = CLEARED,
     96        destination = PAID),
     97
     98    Transition(
    9299        transition_id = 'reset5',
    93100        title = _('Reset to cleared'),
     
    100107        title = _('Pay school fee'),
    101108        msg = _('School fee paid'),
     109        source = RETURNING,
     110        destination = PAID),
     111
     112    Transition(
     113        transition_id = 'approve_school_fee',
     114        title = _('Approve payment'),
     115        msg = _('School fee payment approved'),
    102116        source = RETURNING,
    103117        destination = PAID),
     
    193207    if event.transition.transition_id in UNLOCK_CLEARANCE_TRANS:
    194208        obj.clearance_locked = False
    195     # Student data don't change after first-time payment
    196     if event.transition.transition_id == 'pay_first_school_fee':
    197         pass
    198209    # School fee payment of returning students triggers the change of
    199210    # current session, current level, and current verdict
    200     if event.transition.transition_id == 'pay_school_fee':
     211    if event.transition.transition_id in (
     212        'pay_school_fee', 'approve_school_fee'):
    201213        getUtility(IStudentsUtils).setReturningData(obj)
    202214    # In some tests we don't have a students container
Note: See TracChangeset for help on using the changeset viewer.