Ignore:
Timestamp:
5 Aug 2013, 06:37:46 (11 years ago)
Author:
Henrik Bettermann
Message:

Add new payment category.

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

Legend:

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

    r10446 r10449  
    676676        )
    677677
     678    transcript_fee = schema.Float(
     679        title = _(u'Transcript Fee'),
     680        default = 0.0,
     681        required = False,
     682        )
     683
    678684    clearance_enabled = schema.Bool(
    679685        title = _(u'Clearance enabled'),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py

    r10232 r10449  
    9292                return error
    9393            self.ac = pin
     94        elif self.p_category == 'transcript':
     95            # Create TSC access code
     96            pin, error = create_accesscode(
     97                'TSC',0,self.amount_auth,student.student_id)
     98            if error:
     99                return error
     100            self.ac = pin
    94101        return None
    95102
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r10279 r10449  
    190190        configuration.academic_session = 2004
    191191        configuration.clearance_fee = 3456.0
     192        configuration.transcript_fee = 4567.0
    192193        configuration.booking_fee = 123.4
    193194        configuration.maint_fee = 987.0
     
    980981        self.assertEqual(ac.owner, self.student_id)
    981982        self.assertEqual(ac.cost, 3456.0)
     983
     984        # Managers can add online transcript payment tickets
     985        self.browser.open(self.payments_path + '/addop')
     986        self.browser.getControl(name="form.p_category").value = ['transcript']
     987        self.browser.getControl("Create ticket").click()
     988        self.assertMatches('...ticket created...',
     989                           self.browser.contents)
     990
     991        # Managers can approve the payment
     992        self.assertEqual(len(self.app['accesscodes']['TSC-0']),0)
     993        ctrl = self.browser.getControl(name='val_id')
     994        value = ctrl.options[2] # The clearance payment is the third in the table
     995        self.browser.getLink(value).click()
     996        self.browser.open(self.browser.url + '/approve')
     997        self.assertMatches('...Payment approved...',
     998                          self.browser.contents)
     999        expected = '''...
     1000        <td>
     1001          <span>Paid</span>
     1002        </td>...'''
     1003        self.assertMatches(expected,self.browser.contents)
     1004        # The new CLR-0 pin has been created
     1005        self.assertEqual(len(self.app['accesscodes']['TSC-0']),1)
     1006        pin = self.app['accesscodes']['TSC-0'].keys()[0]
     1007        ac = self.app['accesscodes']['TSC-0'][pin]
     1008        self.assertEqual(ac.owner, self.student_id)
     1009        self.assertEqual(ac.cost, 4567.0)
    9821010        return
    9831011
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r10445 r10449  
    416416                portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    417417                p_item = trans(_('no bed allocated'), portal_language)
     418        elif category == 'transcript':
     419            amount = academic_session.transcript_fee
    418420        if amount in (0.0, None):
    419421            return _('Amount could not be determined.'), None
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r10437 r10449  
    161161        'gown': 'Gown Hire Fee',
    162162        'application': 'Application Fee',
     163        'transcript': 'Transcript Fee',
    163164        }
    164165
Note: See TracChangeset for help on using the changeset viewer.