Changeset 11627


Ignore:
Timestamp:
7 May 2014, 18:21:58 (10 years ago)
Author:
Henrik Bettermann
Message:

To guarantee that cleared students pay both acceptance fee and school fees,
the eTranzact History can only be queried for school fee payments if
acceptance/clearance fee has been successfully queried/paid beforehand.

Location:
main/waeup.aaue/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/CHANGES.txt

    r11625 r11627  
    55===================
    66
    7 * Render note on payment slips which indicates charges included.
     7* To guarantee that cleared students pay both acceptance fee and school fees,
     8  the eTranzact History can only be queried for school fee payments if
     9  acceptance/clearance fee has been successfully queried/paid beforehand.
     10
     11* Render note on payment slips which indicates the charges included.
    812
    913* Configure new and returning school fee in session configuration objects.
     
    1115* Do not create activation code when paying acceptance (= clearance)
    1216  fee payment tickets.
    13 
    14 * Cleared students must pay acceptance fee before paying school fees.
    1517
    1618* applicant_student_mapping extended.
  • main/waeup.aaue/trunk/src/waeup/aaue/etranzact/browser.py

    r11582 r11627  
    275275    placeholder = _('Confirmation Number (PIN)')
    276276
     277    def update(self):
     278        super(EtranzactEnterPinPageStudent, self).update()
     279        if self.context.p_category != 'schoolfee':
     280            return
     281        student = self.context.student
     282        for ticket in student['payments'].values():
     283            if ticket.p_state == 'paid' and \
     284                ticket.p_category == 'clearance':
     285                return
     286        self.flash(_('Please pay acceptance fee first.'), type="danger")
     287        self.redirect(self.url(self.context, '@@index'))
     288        return
     289
    277290class EtranzactEnterPinPageApplicant(EtranzactEnterPinPageStudent):
    278291    """
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r11624 r11627  
    135135                           self.browser.contents)
    136136        self.app['configuration']['2004'].school_fee_1 = 6666.0
    137         self.browser.getControl(name="form.p_category").value = ['schoolfee']
     137        #self.browser.getControl(name="form.p_category").value = ['schoolfee']
    138138        # Accepotance fee must be paid first
    139         self.browser.getControl("Create ticket").click()
    140         self.assertMatches('...Please pay acceptance fee first...',
    141                            self.browser.contents)
     139        #self.browser.getControl("Create ticket").click()
     140        #self.assertMatches('...Please pay acceptance fee first...',
     141        #                   self.browser.contents)
    142142        self.app['configuration']['2004'].clearance_fee = 666.0
    143143        self.browser.getControl(name="form.p_category").value = ['clearance']
    144144        self.browser.getControl("Create ticket").click()
    145145        ctrl = self.browser.getControl(name='val_id')
    146         value = ctrl.options[0]
    147         self.student['payments'][value].approveStudentPayment()
     146        cpt_value = ctrl.options[0]
     147        # School fee payment ticket can be added ...
    148148        self.browser.open(self.payments_path + '/addop')
    149149        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    151151        self.assertMatches('...ticket created...',
    152152                           self.browser.contents)
     153        # ... but not paid through the query_history page.
    153154        ctrl = self.browser.getControl(name='val_id')
    154         value = ctrl.options[1]
    155         self.browser.getLink(value).click()
    156         self.assertMatches('...Amount Authorized...',
    157                            self.browser.contents)
     155        sfpt_value = ctrl.options[1]
     156        self.browser.open(self.payments_path + '/' + sfpt_value)
     157        self.browser.getLink("Query eTranzact History").click()
     158        self.assertMatches('...alert-danger">Please pay acceptance fee first...',
     159                           self.browser.contents)
     160        # If clearance/acceptance fee is paid ...
     161        self.student['payments'][cpt_value].approveStudentPayment()
     162        self.browser.getLink("Query eTranzact History").click()
     163        # ... query_history page is accessible.
     164        self.assertMatches(
     165            '...<h1 class="kofa-content-label">Requery eTranzact History</h1>...',
     166            self.browser.contents)
    158167        # Managers can open school fee payment slip
     168        self.browser.open(self.payments_path + '/' + sfpt_value)
    159169        self.browser.getLink("Download payment slip").click()
    160170        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    161171        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    162         # Set ticket paid
    163         ticket = self.student['payments'][value].approveStudentPayment()
     172        # If school fee ticket is paid ...
     173        ticket = self.student['payments'][sfpt_value].approveStudentPayment()
     174        # ... no further school fee ticket can be added.
    164175        self.browser.open(self.payments_path + '/addop')
    165176        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     
    167178        self.assertMatches('...This type of payment has already been made...',
    168179                           self.browser.contents)
    169 
    170180
    171181    def deactivated_test_for_instalment_payments(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r11624 r11627  
    3737        return
    3838
     39    def test_no_clearance_ac_code_created(self):
     40        payment = createObject('waeup.StudentOnlinePayment')
     41        payment.p_category = 'clearance'
     42        self.student['payments']['any_id'] = payment
     43        payment.approveStudentPayment()
     44        # No activation code created.
     45        self.assertEqual(payment.ac, None)
     46
    3947    def test_set_payment_details(self):
    4048        self.app['configuration']['2004'].gown_fee = 150.0
     
    5462        self.assertEqual(payment, None)
    5563        self.assertEqual(error, u'Wrong state.')
    56 
    5764        IWorkflowState(self.student).setState('cleared')
    58         error, payment = utils.setPaymentDetails('schoolfee',self.student)
    59         # Acceptance fee must be paid first.
    60         self.assertEqual(error, 'Please pay acceptance fee first.')
    61         payment = createObject('waeup.StudentOnlinePayment')
    62         payment.p_category = 'clearance'
    63         self.student['payments']['any_id'] = payment
    64         payment.approveStudentPayment()
    65         # No activation code created.
    66         self.assertEqual(payment.ac, None)
    6765        # School fee can be set.
    6866        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     
    7270        self.assertEqual(payment.p_item, u'CERT1')
    7371        self.assertEqual(error, None)
    74 
    7572        # Add penalty fee ...
    7673        # ... for cleared
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r11624 r11627  
    109109        new_session = student['studycourse'].current_session + 1
    110110        return new_session, new_level
    111 
    112     def _acceptanceFeePaid(self, student):
    113         if len(student['payments']):
    114             for ticket in student['payments'].values():
    115                 if ticket.p_state == 'paid' and \
    116                     ticket.p_category == 'clearance':
    117                     return True
    118         return False
    119111
    120112    def setPaymentDetails(self, category, student,
     
    159151                return _('Study course data are incomplete.'), None
    160152            if student.state == CLEARED:
    161                 if not self._acceptanceFeePaid(student):
    162                     return _('Please pay acceptance fee first.'), None
    163153                if student.faccode == 'FP':
    164154                    amount = 84000.0
Note: See TracChangeset for help on using the changeset viewer.