Ignore:
Timestamp:
1 Nov 2015, 14:11:52 (9 years ago)
Author:
Henrik Bettermann
Message:

Configure new payment categories. School fee amounts are now set via certificates not session configuration objects.

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

Legend:

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

    r13359 r13374  
    124124        self.assertMatches('...Amount could not be determined...',
    125125                           self.browser.contents)
    126         self.app['configuration']['2004'].school_fee_1 = 6666.0
    127126        #self.browser.getControl(name="form.p_category").value = ['schoolfee']
    128127        # Accepotance fee must be paid first
     
    136135        cpt_value = ctrl.options[0]
    137136        # School fee payment ticket can be added ...
     137        self.student['studycourse'].certificate.school_fee_1 = 6666.0
     138        self.student.nationality = u'NG'
    138139        self.browser.open(self.payments_path + '/addop')
    139140        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    235236
    236237    def test_manage_payments_bypass_ac_creation(self):
    237         self.app['configuration']['2004'].school_fee_1 = 6666.0
     238        self.student['studycourse'].certificate.school_fee_1 = 6666.0
     239        self.student.nationality = u'NG'
    238240        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    239241        self.browser.open(self.payments_path)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r13359 r13374  
    5252        self.app['configuration']['2004'].clearance_fee = 1234.0
    5353        self.app['configuration']['2004'].clearance_fee_fp = 3456.0
    54         self.app['configuration']['2004'].school_fee_1 = 6666.0
     54        self.student['studycourse'].certificate.school_fee_1 = 6666.0
     55        self.student['studycourse'].certificate.school_fee_2 = 7777.0
     56        self.student.nationality = u'NG'
    5557        utils = getUtility(IStudentsUtils)
    5658
     
    5860        configuration.academic_session = 2005
    5961        self.app['configuration'].addSessionConfiguration(configuration)
    60         self.app['configuration']['2005'].school_fee_2 = 7777.0
    6162
    6263        error, payment = utils.setPaymentDetails('schoolfee',self.student)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13359 r13374  
    121121        elif category == 'hostel_maintenance':
    122122            amount = academic_session.maint_fee
     123        elif category == 'welfare':
     124            amount = academic_session.welfare_fee
     125        elif category == 'union':
     126            amount = academic_session.union_fee
     127        elif category == 'lapel':
     128            amount = academic_session.lapel_fee
     129        elif category == 'matric_gown':
     130            amount = academic_session.matric_gown_fee
     131        elif category == 'concessional':
     132            amount = academic_session.concession_fee
     133        elif category == 'medical':
     134            amount = academic_session.medical_fee
    123135        elif category == 'clearance':
    124136            if student.faccode == 'FP':
     
    136148                return _('Study course data are incomplete.'), None
    137149            if student.state == CLEARED:
    138                 if student.faccode == 'FP':
    139                     amount = academic_session.school_fee_3
     150                if student.is_foreigner:
     151                    amount = getattr(certificate, 'school_fee_3', 0.0)
    140152                else:
    141                     amount = academic_session.school_fee_1
    142             elif student.state == RETURNING or\
    143                 (student.is_postgrad and student.state == PAID):
    144                 academic_session = self._getSessionConfiguration(p_session)
    145                 if academic_session == None:
    146                     return _(u'Session configuration object is not available.'), None
    147                 if student.state == RETURNING:
    148                     p_session, p_level = self.getReturningData(student)
    149                 else:
    150                     # Returning postgraduate students also pay for the
    151                     # next session but their level always remains the same.
    152                     p_session += 1
     153                    amount = getattr(certificate, 'school_fee_1', 0.0)
     154            elif student.state == RETURNING:
     155                # In case of returning school fee payment the payment session
     156                # and level contain the values of the session the student
     157                # has paid for.
     158                p_session, p_level = self.getReturningData(student)
    153159                try:
    154160                    academic_session = grok.getSite()[
     
    156162                except KeyError:
    157163                    return _(u'Session configuration object is not available.'), None
    158                 amount = academic_session.school_fee_2
     164                if student.is_foreigner:
     165                    amount = getattr(certificate, 'school_fee_4', 0.0)
     166                else:
     167                    amount = getattr(certificate, 'school_fee_2', 0.0)
    159168            else:
    160169                return _('Wrong state.'), None
Note: See TracChangeset for help on using the changeset viewer.