Ignore:
Timestamp:
28 Jan 2022, 08:17:50 (3 years ago)
Author:
Henrik Bettermann
Message:

Rework the entire schoolfee determination and split payment algorithm.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students
Files:
2 edited

Legend:

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

    r16562 r16760  
    110110        self.assertEqual(payment.p_level, 200)
    111111        self.assertEqual(payment.p_session, 2005)
    112         self.assertEqual(payment.amount_auth, 9999.0) # now includes Microsoft Fee
     112        # 9999 + 5950 + 15000 4250
     113        self.assertEqual(payment.amount_auth, 35199.0)
    113114
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py

    r16752 r16760  
    2424from kofacustom.dspg.interfaces import MessageFactory as _
    2525
    26 MICROSOFT_FEE = 0.0
    27 
    2826def local(student):
    2927    lga = getattr(student, 'lga')
     
    3129        return True
    3230    return False
     31
     32def MICROSOFT_FEE(student):
     33    if student.is_fresh:
     34        return 5950.0
     35    return 0.0
     36
     37def DEVELOP_FEE(student):
     38    if local(student) and student.faccode != 'SPAT':
     39        return 10000.0
     40    return 15000.0
     41
     42def TECH_FEE(student):
     43    if student.is_fresh:
     44        return 4250.0
     45    return 1200.0
    3346
    3447class CustomStudentsUtils(NigeriaStudentsUtils):
     
    213226                        300, 310, 320, 330, 600, 610, 620, 630):
    214227                        amount -= 7000
    215                     amount += MICROSOFT_FEE
    216228                elif student.is_postgrad and student.state == PAID:
    217229                    # Returning postgraduate students also pay for the
     
    228240                    else:
    229241                        amount = getattr(certificate, 'school_fee_4', 0.0)
     242            amount += MICROSOFT_FEE(student)
     243            amount += DEVELOP_FEE(student)
     244            amount += TECH_FEE(student)
    230245        elif category == 'clearance':
    231246            try:
Note: See TracChangeset for help on using the changeset viewer.