Ignore:
Timestamp:
24 Oct 2017, 08:43:15 (7 years ago)
Author:
Henrik Bettermann
Message:

Configure school fee and acceptance fee payments.

File:
1 edited

Legend:

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

    r14861 r14875  
    2323from kofacustom.dspg.interfaces import MessageFactory as _
    2424
     25
     26def local(student):
     27    lga = getattr(student, 'lga')
     28    if lga and lga.startswith('delta'):
     29        return True
     30    return False
     31
    2532class CustomStudentsUtils(NigeriaStudentsUtils):
    2633    """A collection of customized methods.
    27 
    2834    """
    2935
     
    7177                # update method of the PreviousPaymentAddFormPage.
    7278                if previous_level == 100:
    73                     amount = getattr(certificate, 'school_fee_1', 0.0)
     79                    if local(student):
     80                        amount = getattr(certificate, 'school_fee_1', 0.0)
     81                    else:
     82                        amount = getattr(certificate, 'school_fee_3', 0.0)
    7483                else:
    75                     amount = getattr(certificate, 'school_fee_2', 0.0)
     84                    if local(student):
     85                        amount = getattr(certificate, 'school_fee_2', 0.0)
     86                    else:
     87                        amount = getattr(certificate, 'school_fee_4', 0.0)
    7688            else:
    7789                if student.state == CLEARED:
    78                     amount = getattr(certificate, 'school_fee_1', 0.0)
     90                    if local(student):
     91                        amount = getattr(certificate, 'school_fee_1', 0.0)
     92                    else:
     93                        amount = getattr(certificate, 'school_fee_3', 0.0)
    7994                elif student.state == RETURNING:
    8095                    # In case of returning school fee payment the
     
    88103                            u'Session configuration object is not available.'
    89104                            ), None
    90                     amount = getattr(certificate, 'school_fee_2', 0.0)
     105                    if local(student):
     106                        amount = getattr(certificate, 'school_fee_2', 0.0)
     107                    else:
     108                        amount = getattr(certificate, 'school_fee_4', 0.0)
    91109                elif student.is_postgrad and student.state == PAID:
    92110                    # Returning postgraduate students also pay for the
     
    99117                            u'Session configuration object is not available.'
    100118                            ), None
    101                     amount = getattr(certificate, 'school_fee_2', 0.0)
     119                    if local(student):
     120                        amount = getattr(certificate, 'school_fee_2', 0.0)
     121                    else:
     122                        amount = getattr(certificate, 'school_fee_4', 0.0)
    102123        elif category == 'clearance':
    103124            try:
     
    106127                return _('Study course data are incomplete.'), None
    107128            amount = academic_session.clearance_fee
     129            if student.current_mode == 'nd_ft' and local(student):
     130                amount /= 2
     131            if student.current_mode == 'hnd_ft':
     132                amount = 0.0
    108133        elif category == 'bed_allocation':
    109134            p_item = self.getAccommodationDetails(student)['bt']
Note: See TracChangeset for help on using the changeset viewer.