Ignore:
Timestamp:
26 Nov 2024, 02:34:19 (7 weeks ago)
Author:
Henrik Bettermann
Message:

Let JUPEB students pay by instalments.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/payments.py

    r17747 r17963  
    6262        log = 'successful %s payment: %s' % (self.p_category, self.p_id)
    6363        msg = _('Payment successfully completed')
    64         if self.p_category in ('schoolfee',):
     64        if self.p_category in ('schoolfee', 'schoolfee_1'):
    6565            msg += _('. Please proceed to library clearance, register your '
    6666                   'courses online and proceed to your '
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r17885 r17963  
    810810        return
    811811
     812    def test_set_payment_details_jupeb(self):
     813        # JUPEB students can pay by instalments
     814        utils = getUtility(IStudentsUtils)
     815        self.certificate.study_mode = 'found'
     816        IWorkflowState(self.student).setState('cleared')
     817        error, payment = utils.setPaymentDetails(
     818            'schoolfee', self.student, None, None, None)
     819        self.assertEqual(payment.p_level, 100)
     820        self.assertEqual(payment.p_session, 2004)
     821        self.assertEqual(payment.amount_auth, 220000.0)
     822        self.assertEqual(payment.p_item, u'CERT1')
     823        self.assertEqual(error, None)
     824        error, payment = utils.setPaymentDetails(
     825            'schoolfee_1', self.student, None, None, None)
     826        self.assertEqual(payment.p_level, 100)
     827        self.assertEqual(payment.p_session, 2004)
     828        self.assertEqual(payment.amount_auth, 110000.0)
     829        self.assertEqual(payment.p_item, u'CERT1')
     830        self.assertEqual(error, None)
     831        return
     832        error, payment = utils.setPaymentDetails(
     833            'secondinstall', self.student, None, None, None)
     834        self.assertEqual(payment.p_level, 100)
     835        self.assertEqual(payment.p_session, 2004)
     836        self.assertEqual(payment.amount_auth, 110000.0)
     837        self.assertEqual(payment.p_item, u'CERT1')
     838        self.assertEqual(error, None)
     839
    812840    def test_edit_level_by_co(self):
    813841        # Create clearance officer
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r17930 r17963  
    493493            else:
    494494                amount = 60000.0
     495
     496        elif student.state == CLEARED \
     497                and student.is_jupeb and category in ('schoolfee', 'schoolfee_1',
     498                                                      'secondinstall'):
     499            try:
     500                certificate = student['studycourse'].certificate
     501                p_item = certificate.code
     502            except (AttributeError, TypeError):
     503                return _('Study course data are incomplete.'), None
     504            amount = 220000.0
     505            if category in ('schoolfee_1', 'secondinstall'):
     506                amount /= 2
     507
    495508        elif category == 'schoolfee':
    496509            try:
     
    580593            if student.is_staff:
    581594                amount /= 2
    582 
    583595        else:
    584596            fee_name = category + '_fee'
Note: See TracChangeset for help on using the changeset viewer.