Ignore:
Timestamp:
8 Nov 2021, 08:41:58 (3 years ago)
Author:
Henrik Bettermann
Message:

Implement payment by instalments.

Location:
main/kofacustom.edocons/trunk/src/kofacustom/edocons
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/interswitch/tests.py

    r16698 r16704  
    8080            self.browser.contents)
    8181        self.assertTrue(
    82             'item_name="School Fee" item_amt="4000000" bank_id="00" acct_num="00000000"' in
     82            'item_name="School Fee (total amount)" item_amt="4000000" bank_id="00" acct_num="00000000"' in
     83            self.browser.contents)
     84        self.browser.open(self.payments_path + '/addop')
     85        self.browser.getControl(name="form.p_category").value = ['schoolfee_1']
     86        self.browser.getControl("Create ticket").click()
     87        self.assertMatches('...ticket created...',
     88                           self.browser.contents)
     89        self.browser.open(self.payments_path)
     90        ctrl = self.browser.getControl(name='val_id')
     91        self.value = ctrl.options[1]
     92        self.browser.getLink(self.value).click()
     93        self.assertMatches('...Amount Authorized...',
     94                           self.browser.contents)
     95        self.assertTrue(
     96            '<span>24000.0</span>' in self.browser.contents)
     97        self.payment_url = self.browser.url
     98        self.browser.getLink("Pay via Interswitch CollegePAY", index=0).click()
     99        self.assertMatches('...<input type="hidden" name="pay_item_id" value="Default_Payable_MX26002" />...',
     100                           self.browser.contents)
     101        self.assertEqual(self.student.current_mode, 'ug_ft')
     102        self.assertTrue(
     103            '<input type="hidden" name="amount" value="2430000" />' in
     104            self.browser.contents)
     105        self.assertTrue(
     106            'item_name="School Fee (60% - 1st instalment)" item_amt="2400000" bank_id="00" acct_num="00000000"' in
    83107            self.browser.contents)
    84108
     
    87111        acc_payment = createObject('waeup.StudentOnlinePayment')
    88112        acc_payment.p_state = 'unpaid'
    89         acc_payment.p_category = 'clearance'
     113        acc_payment.p_category = 'schoolfee'
    90114        acc_payment.p_id = 'xyz'
    91115        acc_payment.pay_item_id = '123'
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/locales/en/LC_MESSAGES/waeup.kofa.po

    r16639 r16704  
    99"Content-Type: text/plain; charset=iso-8859-1\n"
    1010"Content-Transfer-Encoding: 8bit\n"
     11"Language: en\n"
     12"X-Generator: Poedit 1.6.5\n"
    1113
    1214msgid "Academics"
    1315msgstr "Institutions"
    1416
     17#: waeup/kofa/university/interfaces.py:286
     18msgid "Initial School Fee"
     19msgstr "School Fee"
     20
     21#: waeup/kofa/university/interfaces.py:292
     22msgid "Returning School Fee"
     23msgstr "Returning School Fee (not used)"
     24
     25#: waeup/kofa/university/interfaces.py:298
     26msgid "Foreigner Initial School Fee"
     27msgstr "Foreigner Initial School Fee (not used)"
     28
     29#: waeup/kofa/university/interfaces.py:304
     30msgid "Foreigner Returning School Fee"
     31msgstr "Foreigner Returning School Fee (not used)"
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/utils.py

    r16702 r16704  
    7070                # workflow states.  Fresh students are excluded by the
    7171                # update method of the PreviousPaymentAddFormPage.
    72                 if previous_level == 100:
    73                     amount = getattr(certificate, 'school_fee_1', 0.0)
     72                amount = getattr(certificate, 'school_fee_1', 0.0)
     73            else:
     74                if category == 'secondinstal':
     75                    amount = 0.4 * getattr(certificate, 'school_fee_1', 0.0)
    7476                else:
    75                     amount = getattr(certificate, 'school_fee_2', 0.0)
    76             else:
    77                 if student.state == CLEARED:
    78                     amount = getattr(certificate, 'school_fee_1', 0.0)
    79                 elif student.state == RETURNING:
    80                     # In case of returning school fee payment the
    81                     # payment session and level contain the values of
    82                     # the session the student has paid for. Payment
    83                     # session is always next session.
    84                     p_session, p_level = self.getReturningData(student)
    85                     academic_session = self._getSessionConfiguration(p_session)
    86                     if academic_session == None:
    87                         return _(
    88                             u'Session configuration object is not available.'
    89                             ), None
    90                     amount = getattr(certificate, 'school_fee_2', 0.0)
    91                 elif student.is_postgrad and student.state == PAID:
    92                     # Returning postgraduate students also pay for the
    93                     # next session but their level always remains the
    94                     # same.
    95                     p_session += 1
    96                     academic_session = self._getSessionConfiguration(p_session)
    97                     if academic_session == None:
    98                         return _(
    99                             u'Session configuration object is not available.'
    100                             ), None
    101                     amount = getattr(certificate, 'school_fee_2', 0.0)
     77                    if student.state == CLEARED:
     78                        amount = getattr(certificate, 'school_fee_1', 0.0)
     79                    elif student.state == RETURNING:
     80                        # In case of returning school fee payment the
     81                        # payment session and level contain the values of
     82                        # the session the student has paid for. Payment
     83                        # session is always next session.
     84                        p_session, p_level = self.getReturningData(student)
     85                        academic_session = self._getSessionConfiguration(p_session)
     86                        if academic_session == None:
     87                            return _(
     88                                u'Session configuration object is not available.'
     89                                ), None
     90                        amount = getattr(certificate, 'school_fee_1', 0.0)
     91                    elif student.is_postgrad and student.state == PAID:
     92                        # Returning postgraduate students also pay for the
     93                        # next session but their level always remains the
     94                        # same.
     95                        p_session += 1
     96                        academic_session = self._getSessionConfiguration(p_session)
     97                        if academic_session == None:
     98                            return _(
     99                                u'Session configuration object is not available.'
     100                                ), None
     101                        amount = getattr(certificate, 'school_fee_1', 0.0)
     102                    if category == 'schoolfee_1':
     103                        amount *= 0.6
    102104        elif category == 'clearance':
    103105            try:
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/utils/utils.py

    r16701 r16704  
    2525
    2626    PAYMENT_CATEGORIES = {
    27         'schoolfee': 'School Fee',
    28         'clearance': 'Acceptance Fee',
     27        'schoolfee': 'School Fee (total amount)',
     28        'schoolfee_1': 'School Fee (60% - 1st instalment)',
     29        'secondinstal': 'School Fee (40% - 2nd instalment)',
     30        'clearance': 'Acceptance Fee (not applicable)',
    2931        #'bed_allocation': 'Bed Allocation Fee',
    3032        #'hostel_maintenance': 'Hostel Maintenance Fee',
    3133        #'transfer': 'Transfer Fee',
    3234        #'gown': 'Gown Hire Fee',
    33         'application': 'Application Fee',
     35        'application': 'Application Fee (not applicable)',
    3436        #'app_balance': 'Application Fee Balance',
    3537        #'transcript': 'Transcript Fee',
     
    3840        }
    3941
    40     #SELECTABLE_PAYMENT_CATEGORIES = {
    41     #    }
    42 
    43     def selectable_payment_categories(self, student):
    44         return self.PAYMENT_CATEGORIES
     42    SELECTABLE_PAYMENT_CATEGORIES = {
     43        'schoolfee': 'School Fee (total amount)',
     44        'schoolfee_1': 'School Fee (60% - 1st instalment)',
     45        'secondinstal': 'School Fee (40% - 2nd instalment)',
     46        }
Note: See TracChangeset for help on using the changeset viewer.