Ignore:
Timestamp:
13 Jan 2021, 09:20:28 (4 years ago)
Author:
Henrik Bettermann
Message:

Implement late school fee penalty fee payments.

File:
1 edited

Legend:

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

    r16002 r16370  
    8888                'degree' in academic_session.payment_disabled:
    8989                return True
     90        return False
     91
     92    def _lsfp_penalty_paymentMade(self, student, session):
     93        if student.current_mode not in ('ug_ft','de_ft', 'nce_ft', 'nce_pt'):
     94            return True
     95        if len(student['payments']):
     96            for ticket in student['payments'].values():
     97                if ticket.p_state == 'paid' and \
     98                    ticket.p_category == 'lsfp_penalty' and \
     99                    ticket.p_session == session:
     100                    return True
    90101        return False
    91102
     
    120131        # Determine fee.
    121132        if category.startswith('schoolfee'):
     133            penalty = getattr(academic_session, 'lsfp_penalty_fee')
     134            if  penalty and not self._lsfp_penalty_paymentMade(
     135                student, student.current_session):
     136                return _('You have to pay late school fee payment penalty first.'), None
    122137            try:
    123138                certificate = student['studycourse'].certificate
     
    176191            else:
    177192                return _(u'No bed allocated.'), None
    178         elif category == 'transcript':
    179             amount = academic_session.transcript_fee
    180         elif category == 'transfer':
    181             amount = academic_session.transfer_fee
    182         elif category == 'late_registration':
    183             amount = academic_session.late_registration_fee
     193        elif category == 'lsfp_penalty':
     194            amount = academic_session.lsfp_penalty_fee
     195            if amount and student.current_mode in ('ug_ft','de_ft'):
     196                amount *= 2
     197        else:
     198            fee_name = category + '_fee'
     199            amount = getattr(academic_session, fee_name, 0.0)
    184200        if amount in (0.0, None):
    185201            return _('Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.