Changeset 16008


Ignore:
Timestamp:
20 Feb 2020, 13:06:08 (5 years ago)
Author:
Henrik Bettermann
Message:

Make the Third Semester fee ticket only active to those who have paid School fees for NCE 3.

Do not deduct WAEAC charge from third semester payments.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py

    r15939 r16008  
    9393            provider_amt = 0.0
    9494            self.pay_item_id = '8304'
    95         if self.context.p_item == 'Balance':
     95        if self.context.p_item == 'Balance' or self.context.p_category == 'third_semester':
    9696            provider_amt = 0.0
    9797        xmldict['institution_amt'] = 100 * (
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r15989 r16008  
    289289
    290290        error, payment = utils.setPaymentDetails('third_semester',self.student)
     291        self.assertEqual(error, u'Make NCE 3 school fee payment first.')
     292        payment = createObject('waeup.StudentOnlinePayment')
     293        payment.p_category = u'schoolfee'
     294        payment.p_session = self.student.current_session
     295        payment.p_item = u'My Certificate'
     296        payment.p_id = u'anyid'
     297        self.student['payments']['anykey'] = payment
     298        payment.p_state = 'paid'
     299        payment.p_level = 300
     300        error, payment = utils.setPaymentDetails('third_semester',self.student)
    291301        self.assertEqual(payment.p_level, 100)
    292302        self.assertEqual(payment.p_session, 2004)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r15891 r16008  
    7171            new_session = student['studycourse'].current_session + 1
    7272        return new_session, new_level
     73
     74    def _nce3PaymentMade(self, student):
     75        if len(student['payments']):
     76            for ticket in student['payments'].values():
     77                if ticket.p_state == 'paid' and \
     78                    ticket.p_level in (300, 310, 320) and \
     79                    ticket.p_category == 'schoolfee':
     80                    return True
     81        return False
    7382
    7483    def setPaymentDetails(self, category, student,
     
    118127                return _(u'Acceptance Fee payments not allowed.'), None
    119128        elif category == 'third_semester' and student.current_mode == 'nce_ft':
     129            if not self._nce3PaymentMade(student):
     130                return _(u'Make NCE 3 school fee payment first.'), None
    120131            if student.depcode in ARTS:
    121132                amount = 7688
     
    126137            if not p_item:
    127138                return _('Study course data are incomplete.'), None
    128 
    129139            if student.state not in (CLEARED, RETURNING):
    130140                return _('Wrong state.'), None
    131 
    132141            # PDE repeater
    133142            if student.current_verdict == 'OPDE':
Note: See TracChangeset for help on using the changeset viewer.