Changeset 14244 for main/waeup.aaue


Ignore:
Timestamp:
31 Oct 2016, 07:02:58 (8 years ago)
Author:
Henrik Bettermann
Message:

Add student id card fee to first school fee payment.

Attention: The payment slip does not contain any information whether the fee was added or not. We can only draw conclusions from from the student's entry session whether the fee had been included.

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

Legend:

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

    r14239 r14244  
    229229            welfare_fee = gateway_net_amt(academic_session.welfare_fee)
    230230            union_fee = gateway_net_amt(academic_session.union_fee)
    231             text += ('School Fee, '
    232                      '%s Naira Student Union Dues, '
    233                      '%s Naira Student Welfare Assurance Fee and '
    234                      % (union_fee, welfare_fee))
     231            if self.context.student.entry_session == 2016 \
     232                and self.context.student.entry_mode == 'ug_ft' \
     233                and self.context.p_session == 2016:
     234                # Add student id card fee to first school fee payment.
     235                # Attention: The payment slip does not contain any information
     236                # whether the fee was added or not.
     237                # We can only draw conclusions from from the student's entry
     238                # session whether the fee had been included.
     239                id_card_fee = gateway_net_amt(academic_session.id_card_fee)
     240                text += ('School Fee, '
     241                         '%s Naira Student ID Card Fee, '
     242                         '%s Naira Student Union Dues, '
     243                         '%s Naira Student Welfare Assurance Fee and '
     244                         % (id_card_fee, union_fee, welfare_fee))
     245            else:
     246                text += ('School Fee, '
     247                         '%s Naira Student Union Dues, '
     248                         '%s Naira Student Welfare Assurance Fee and '
     249                         % (union_fee, welfare_fee))
    235250        elif self.context.p_category in (
    236251            'clearance_incl', 'clearance_medical_incl') and academic_session:
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14243 r14244  
    453453        self.student['accommodation'].addBedTicket(bedticket)
    454454
    455     def test_student_payments(self):
     455    def test_maintenance_fee_payment(self):
    456456        self.certificate.study_mode = 'ug_ft'
    457457        self.student['studycourse'].entry_session = 2013
     458        self.student.nationality = u'NG'
     459        IWorkflowState(self.student).setState('cleared')
     460        self.browser.open(self.login_path)
     461        self.browser.getControl(name="form.login").value = self.student_id
     462        self.browser.getControl(name="form.password").value = 'spwd'
     463        self.browser.getControl("Login").click()
     464        self.browser.open(self.student_path + '/payments')
     465        self.browser.getLink("Add current session payment ticket").click()
     466        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
     467        self.browser.getControl("Create ticket").click()
     468        self.assertTrue('ticket created' in self.browser.contents)
     469        value = self.student['payments'].keys()[0]
     470        self.browser.getLink(value).click()
     471        self.assertTrue('<span>My bed coordinates</span>' in self.browser.contents)
     472        self.assertEqual(self.student['payments'][value].amount_auth, 876.0)
     473        return
     474
     475    def test_student_schoolfee_payments(self):
     476        configuration_1 = createObject('waeup.SessionConfiguration')
     477        configuration_1.academic_session = 2016
     478        self.app['configuration'].addSessionConfiguration(configuration_1)
     479        self.certificate.study_mode = 'ug_ft'
     480        self.student['studycourse'].entry_session = 2016
     481        self.student['studycourse'].current_session = 2016
     482        self.student['studycourse'].entry_mode = 'ug_ft'
    458483        self.student['studycourse'].certificate.school_fee_1 = 50250.0
    459         self.app['configuration']['2004'].union_fee = 1250.0
    460         self.app['configuration']['2004'].welfare_fee = 750.0
     484        self.app['configuration']['2016'].union_fee = 1250.0
     485        self.app['configuration']['2016'].welfare_fee = 750.0
     486        self.app['configuration']['2016'].id_card_fee = 350.0
    461487        self.student.nationality = u'NG'
    462488        # Login
     
    475501        self.browser.getLink(value).click()
    476502        self.assertTrue('Amount Authorized' in self.browser.contents)
    477         self.assertEqual(self.student['payments'][value].amount_auth, 51750.0)
     503        # 50250 + 1000 + 500 + 100 = 51850
     504        self.assertEqual(self.student['payments'][value].amount_auth, 51850.0)
    478505        self.browser.open(self.browser.url + '/payment_slip.pdf')
    479506        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     
    489516        self.browser.getControl("Create ticket").click()
    490517        self.assertTrue(
    491             'You must chose a payment which includes additional fees'
    492             in self.browser.contents)
    493         #self.assertTrue(
    494         #    'Another school fee payment for this session has already been made'
    495         #    in self.browser.contents)
    496         # Test hostel maintenance payments
    497         self.browser.open(self.student_path + '/payments')
    498         self.browser.getLink("Add current session payment ticket").click()
    499         self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
    500         self.browser.getControl("Create ticket").click()
    501         self.assertTrue('ticket created' in self.browser.contents)
    502         value = self.student['payments'].keys()[1]
    503         self.browser.getLink(value).click()
    504         self.assertTrue('<span>My bed coordinates</span>' in self.browser.contents)
    505         self.assertEqual(self.student['payments'][value].amount_auth, 876.0)
     518            'You must choose a payment which includes additional fees'
     519            in self.browser.contents)
    506520        return
    507521
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r14242 r14244  
    256256                and not category in (
    257257                'schoolfee_incl', 'schoolfee_1', 'schoolfee_2'):
    258                     return _("You must chose a payment which includes "
     258                    return _("You must choose a payment which includes "
    259259                             "additional fees."), None
    260260            if category in ('schoolfee_1', 'schoolfee_2'):
     
    303303            if amount in (0.0, None):
    304304                return _(u'Amount could not be determined.'), None
    305             # Add Student Union Fee and Welfare Assurance
     305            # Add Student Union Fee , Student Id Card Fee and Welfare Assurance
    306306            if category in ('schoolfee_incl', 'schoolfee_1'):
    307307                amount += gateway_net_amt(academic_session.welfare_fee) + \
    308308                    gateway_net_amt(academic_session.union_fee)
     309                if student.entry_session == 2016 \
     310                    and student.entry_mode == 'ug_ft' \
     311                    and student.state == CLEARED:
     312                    amount += gateway_net_amt(academic_session.id_card_fee)
    309313            # Add non-indigenous fee and session specific penalty fees
    310314            if student.is_postgrad:
Note: See TracChangeset for help on using the changeset viewer.