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

Break up school fee into 4 items. 'ict_entre', 'logbook_combo' and 'siwess_combo' fees must be paid before 'schoolfee'.

File:
1 edited

Legend:

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

    r15035 r15056  
    8787        return 'N/A'
    8888
     89    def _requiredPaymentsMade(self, student, session):
     90        if len(student['payments']):
     91            num = 0
     92            for ticket in student['payments'].values():
     93                if ticket.p_state == 'paid' and \
     94                    ticket.p_category in (
     95                        'ict_entre', 'logbook_combo', 'siwess_combo') and \
     96                    ticket.p_session == session:
     97                    num += 1
     98            if num == 3:
     99                return True
     100        return False
     101
    89102    def setPaymentDetails(self, category, student,
    90103            previous_session, previous_level):
     
    116129            return _(u'Session configuration object is not available.'), None
    117130        # Determine fee.
     131        # The following three fees are part of the school fee which must be
     132        # paid before tuition fee.
     133        if category in ('ict_entre', 'logbook_combo', 'siwess_combo') and \
     134            student.state == RETURNING:
     135            p_session, p_level = self.getReturningData(student)
    118136        if category == 'schoolfee':
     137            if not self._requiredPaymentsMade(student, p_session):
     138                return _('Pay SIWES, Logbook and ICT fees first.'), None
    119139            try:
    120140                certificate = student['studycourse'].certificate
Note: See TracChangeset for help on using the changeset viewer.