Ignore:
Timestamp:
20 Sep 2021, 07:02:50 (3 years ago)
Author:
Henrik Bettermann
Message:

Acceptance must not be added to school fee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16623 r16627  
    269269        cs = self.context.student.current_session
    270270        SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance')
    271         sf_paid = {cs-1: 0, cs: 0, cs+1: 0}
     271        if cs > self.context.student.entry_session:
     272            sf_paid = {cs-1: 0, cs: 0, cs+1: 0}
     273            sessions = (cs-1, cs, cs+1)
     274        else:
     275            sf_paid = {cs: 0, cs+1: 0}
     276            sessions = (cs, cs+1)
    272277        try:
    273278            certificate = self.context.student['studycourse'].certificate
    274279        except (AttributeError, TypeError):
    275             return sf_paid, 0
    276         try:
    277             academic_session = grok.getSite()['configuration'][str(cs)]
    278         except KeyError:
    279280            return sf_paid, 0
    280281        if self.context.student in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
     
    282283        else:
    283284            total_sf = getattr(certificate, 'school_fee_2', 0.0)
    284         cfee = academic_session.clearance_fee
    285         if self.context.student.is_postgrad:
    286             cfee *= 0.5
    287         total_sf += cfee
    288285        for ticket in self.context.student['payments'].values():
    289286            if ticket.p_category in SF_PAYMENTS and \
    290287                ticket.p_state == 'paid' and \
    291                 ticket.p_session in (cs-1, cs, cs+1):
     288                ticket.p_session in sessions:
    292289                sf_paid[ticket.p_session] += ticket.amount_auth
    293290        return sf_paid, total_sf
Note: See TracChangeset for help on using the changeset viewer.