Ignore:
Timestamp:
16 Jan 2018, 15:06:52 (7 years ago)
Author:
Henrik Bettermann
Message:

Configure dep_sug payments which are required for schoolfee payments.

File:
1 edited

Legend:

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

    r14921 r14938  
    3636    # prefix
    3737    STUDENT_ID_PREFIX = u'P'
     38
     39    def _dep_sug_paymentMade(self, student, session):
     40        if len(student['payments']):
     41            for ticket in student['payments'].values():
     42                if ticket.p_state == 'paid' and \
     43                    ticket.p_category == 'dep_sug' and \
     44                    ticket.p_session == session:
     45                    return True
     46        return False
    3847
    3948    def setPaymentDetails(self, category, student,
     
    8796                        amount = getattr(certificate, 'school_fee_4', 0.0)
    8897            else:
     98                # Students are only allowed to pay school fee
     99                # if current session dep_sug payment has been made.
     100                if not self._dep_sug_paymentMade(student,
     101                    student.current_session):
     102                    return _('You have to pay NADESU/SA/SUG Dues first.'), None
    89103                if student.state == CLEARED:
    90104                    if local(student):
     
    164178            amount = 13000.0
    165179        elif category == 'dep_sug':
    166             amount = 2900.0
     180            amount = 3150.0 # includes GATEWAY_AMT
     181            if student.faccode == 'SPAT':
     182                amount = 1650.0 # includes GATEWAY_AMT
    167183        else:
    168184            fee_name = category + '_fee'
Note: See TracChangeset for help on using the changeset viewer.