Changeset 13534 for main/waeup.aaue


Ignore:
Timestamp:
4 Dec 2015, 18:10:26 (9 years ago)
Author:
Henrik Bettermann
Message:

Add non-indigenous fee.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r13482 r13534  
    5050        self.app['configuration']['2004'].booking_fee = 150.0
    5151        self.app['configuration']['2004'].maint_fee = 180.0
    52         self.app['configuration']['2004'].clearance_fee = 1234.0
     52        self.app['configuration']['2004'].clearance_fee_pg = 1234.0
    5353        self.app['configuration']['2004'].clearance_fee_fp = 3456.0
    5454        self.student['studycourse'].certificate.school_fee_1 = 6666.0
    5555        self.student['studycourse'].certificate.school_fee_2 = 7777.0
     56        self.student['studycourse'].certificate.study_mode = 'special_pg_ft'
    5657        self.student.nationality = u'NG'
     58        self.student.lga = 'ebonyi_ukaba'
    5759        utils = getUtility(IStudentsUtils)
    5860
     
    6971        self.assertEqual(payment.p_level, 100)
    7072        self.assertEqual(payment.p_session, 2004)
    71         self.assertEqual(payment.amount_auth, 6666.0)
     73        # 20000 Naira non-indigenous fee added
     74        self.assertEqual(payment.amount_auth, 26666.0)
    7275        self.assertEqual(payment.p_item, u'CERT1')
    7376        self.assertEqual(error, None)
    7477        # Add penalty fee ...
    7578        # ... for cleared
    76         self.app['configuration']['2004'].penalty_ug = 99.0
     79        self.app['configuration']['2004'].penalty_pg = 99.0
    7780        # ... for returning
    78         self.app['configuration']['2005'].penalty_ug = 88.0
     81        self.app['configuration']['2005'].penalty_pg = 88.0
     82        self.student.lga = 'edo_afuze'
    7983        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    8084        self.assertEqual(payment.amount_auth, 6765.0)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13526 r13534  
    217217                amount += gateway_net_amt(academic_session.welfare_fee) + \
    218218                    gateway_net_amt(academic_session.union_fee)
     219            # Add non-indigenous fee and session specific penalty fees
     220            if student.is_postgrad:
     221                amount += academic_session.penalty_pg
     222                if not student.lga.startswith('edo'):
     223                    amount += 20000.0
     224            else:
     225                amount += academic_session.penalty_ug
    219226        if amount in (0.0, None):
    220227            return _(u'Amount could not be determined.'), None
    221         # Add session specific penalty fee.
    222         if category.startswith('schoolfee') and student.is_postgrad:
    223             amount += academic_session.penalty_pg
    224         elif category.startswith('schoolfee'):
    225             amount += academic_session.penalty_ug
     228
    226229        # Create ticket.
    227230        for key in student['payments'].keys():
Note: See TracChangeset for help on using the changeset viewer.