Ignore:
Timestamp:
27 Jun 2018, 07:18:05 (7 years ago)
Author:
Henrik Bettermann
Message:

Part-time students do not pay logbbok fee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py

    r15056 r15064  
    8888
    8989    def _requiredPaymentsMade(self, student, session):
     90        req_payments = ('ict_entre', 'logbook_combo', 'siwess_combo')
     91        req_payments_titles = 'ICT, Logbook and SIWESS'
    9092        if len(student['payments']):
     93            if student.current_mode.endswith('_pt'):
     94                req_payments = ('ict_entre', 'siwess_combo')
     95                req_payments_titles = 'ICT and SIWESS'
    9196            num = 0
    9297            for ticket in student['payments'].values():
    9398                if ticket.p_state == 'paid' and \
    94                     ticket.p_category in (
    95                         'ict_entre', 'logbook_combo', 'siwess_combo') and \
     99                    ticket.p_category in req_payments and \
    96100                    ticket.p_session == session:
    97101                    num += 1
    98             if num == 3:
    99                 return True
    100         return False
     102            if num == len(req_payments):
     103                return True, None
     104        return False, req_payments_titles
    101105
    102106    def setPaymentDetails(self, category, student,
     
    135139            p_session, p_level = self.getReturningData(student)
    136140        if category == 'schoolfee':
    137             if not self._requiredPaymentsMade(student, p_session):
    138                 return _('Pay SIWES, Logbook and ICT fees first.'), None
     141            rpm, rpt = self._requiredPaymentsMade(student, p_session)
     142            if not rpm:
     143                return 'Pay %s fees first.' % rpt, None
    139144            try:
    140145                certificate = student['studycourse'].certificate
Note: See TracChangeset for help on using the changeset viewer.