Changeset 14336
- Timestamp:
- 12 Dec 2016, 12:02:31 (8 years ago)
- Location:
- main/kofacustom.coewarri/trunk/src/kofacustom/coewarri
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/interfaces.py
r14035 r14336 39 39 40 40 clearance_fee = schema.Float( 41 title = _(u' Clearance Fee (ignored)'),41 title = _(u'Acceptance Fee'), 42 42 default = 0.0, 43 43 required = False, -
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/interswitch/browser.py
r14301 r14336 58 58 currency = CURRENCY 59 59 product_id = PRODUCT_ID 60 mac = ' '60 mac = '9309B5CBF1BFB09693C6F5F578046E3FCAB0A2538C3FE4221A6E63AFD348DE888E655F9C7E9F112151A702B6B09E6A7ACC5B3BF3C701F0C1B0D8EA6C1872AE94' 61 61 62 62 def update(self): … … 74 74 xmldict['provider_item_name'] = PROVIDER_ITEM_NAME 75 75 # Institution data 76 xmldict['institution_acct'] = '00000000' 77 xmldict['institution_bank_id'] = '00' 78 xmldict['institution_amt'] = '0.0' 79 provider_amt = 0.0 76 xmldict['institution_acct'] = '1019684470' 77 xmldict['institution_bank_id'] = '7' 78 provider_amt = 500.0 80 79 self.pay_item_id = '0000' 81 80 xmldict['provider_amt'] = 100 * provider_amt … … 84 83 xmldict['institution_amt'] = 100 * ( 85 84 self.context.amount_auth - provider_amt - GATEWAY_AMT) 85 if self.context.p_category == 'clearance': 86 self.pay_item_id = '102' 87 elif self.context.p_category == 'schoolfee': 88 self.pay_item_id = '103' 86 89 # Interswitch amount is not part of the xml data 87 90 if provider_amt == 0: -
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/interswitch/tests.py
r14035 r14336 68 68 self.browser.contents) 69 69 self.assertMatches( 70 '...<span> 40000.0</span>...',70 '...<span>79500.0</span>...', 71 71 self.browser.contents) 72 72 self.payment_url = self.browser.url 73 73 self.browser.getLink("CollegePAY", index=0).click() 74 self.assertMatches('...<input type="hidden" name="pay_item_id" value=" 0000" />...',74 self.assertMatches('...<input type="hidden" name="pay_item_id" value="103" />...', 75 75 self.browser.contents) 76 76 self.assertMatches('...Total Amount Authorized:...', … … 78 78 self.assertEqual(self.student.current_mode, 'ug_ft') 79 79 self.assertMatches( 80 '...<input type="hidden" name="amount" value=" 4000000" />...',81 self.browser.contents) 82 self.assertMatches( 83 '...item_name="School Fee" item_amt=" 4000000" bank_id="00" acct_num="00000000"...',80 '...<input type="hidden" name="amount" value="7950000" />...', 81 self.browser.contents) 82 self.assertMatches( 83 '...item_name="School Fee" item_amt="7950000" bank_id="7" acct_num="1019684470"...', 84 84 self.browser.contents) 85 85 … … 95 95 self.browser.open(self.payments_path + '/xyz') 96 96 self.browser.getLink("CollegePAY", index=0).click() 97 self.assertMatches('...<input type="hidden" name="pay_item_id" value=" 0000" />...',97 self.assertMatches('...<input type="hidden" name="pay_item_id" value="102" />...', 98 98 self.browser.contents) 99 99 self.assertMatches('...Total Amount Authorized:...', -
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/utils.py
r14333 r14336 18 18 from time import time 19 19 from zope.component import createObject, getUtility 20 from waeup.kofa.fees import FeeTable 20 21 from waeup.kofa.interfaces import (IKofaUtils, 21 22 ADMITTED, CLEARED, RETURNING, PAID, REGISTERED, VALIDATED) 22 23 from kofacustom.nigeria.students.utils import NigeriaStudentsUtils 23 24 from kofacustom.coewarri.interfaces import MessageFactory as _ 25 from kofacustom.coewarri.interswitch.browser import GATEWAY_AMT 24 26 25 27 … … 31 33 return 'non-local' 32 34 35 PAYMENT_LEVELS = (100, 110, 200, 210, 300, 310, 400, 410, 500, 999) 36 37 FEES_PARAMS = ( 38 ('local', 'non-local'), 39 ('nce_ft', 'nce_pt', 'ug_ft'), 40 PAYMENT_LEVELS 41 ) 42 43 FEES_VALUES = ( 44 ( # 100 110 200 210 300 310 400 410 500 999 45 (42000.0, 42000.0, 20600.0, 20600.0, 18100.0, 18100.0, 0.0, 0.0, 0.0, 0.0), # nce_ft 46 (55200.0, 55200.0, 42200.0, 42200.0, 44700.0, 44700.0, 42200.0, 42200.0, 0.0, 0.0), # nce_pt 47 (69200.0, 69200.0, 63100.0, 63100.0, 63100.0, 63100.0, 62100.0, 62100.0, 0.0, 0.0), # ug_ft 48 ), # local 49 ( # 50 (54600.0, 54600.0, 22600.0, 22600.0, 20100.0, 20100.0, 0.0, 0.0, 0.0, 0.0), # nce_ft 51 (55200.0, 55200.0, 42200.0, 42200.0, 44700.0, 44700.0, 42200.0, 42200.0, 0.0, 0.0), # nce_pt 52 (79200.0, 79200.0, 63100.0, 63100.0, 63100.0, 63100.0, 62100.0, 62100.0, 0.0, 0.0), # ug_ft 53 ), # non-local 54 ) 55 56 SCHOOL_FEES = FeeTable(FEES_PARAMS, FEES_VALUES) 57 33 58 class CustomStudentsUtils(NigeriaStudentsUtils): 34 59 """A collection of customized methods. … … 37 62 38 63 def setPaymentDetails(self, category, student, 39 previous_session , previous_level):64 previous_session=None, previous_level=None): 40 65 """Create a payment ticket and set the payment data of a 41 66 student for the payment category specified. … … 43 68 p_item = u'' 44 69 amount = 0.0 45 if previous_session: 46 if previous_session < student['studycourse'].entry_session: 47 return _('The previous session must not fall below ' 48 'your entry session.'), None 49 if category == 'schoolfee': 50 # School fee is always paid for the following session 51 if previous_session > student['studycourse'].current_session: 52 return _('This is not a previous session.'), None 53 else: 54 if previous_session > student['studycourse'].current_session - 1: 55 return _('This is not a previous session.'), None 56 p_session = previous_session 57 p_level = previous_level 58 p_current = False 59 else: 60 p_session = student['studycourse'].current_session 61 p_level = student['studycourse'].current_level 62 p_current = True 70 p_session = student['studycourse'].current_session 71 p_level = student['studycourse'].current_level 72 p_current = True 63 73 academic_session = self._getSessionConfiguration(p_session) 64 74 if academic_session == None: … … 71 81 except (AttributeError, TypeError): 72 82 return _('Study course data are incomplete.'), None 73 if previous_session: 74 # Students can pay for previous sessions in all 75 # workflow states. Fresh students are excluded by the 76 # update method of the PreviousPaymentAddFormPage. 77 if previous_level == 100: 78 amount = getattr(certificate, 'school_fee_1', 0.0) 79 else: 80 amount = getattr(certificate, 'school_fee_2', 0.0) 81 else: 82 if student.state == CLEARED: 83 amount = getattr(certificate, 'school_fee_1', 0.0) 84 elif student.state == RETURNING: 85 # In case of returning school fee payment the 86 # payment session and level contain the values of 87 # the session the student has paid for. Payment 88 # session is always next session. 89 p_session, p_level = self.getReturningData(student) 90 academic_session = self._getSessionConfiguration(p_session) 91 if academic_session == None: 92 return _( 93 u'Session configuration object is not available.' 94 ), None 95 amount = getattr(certificate, 'school_fee_2', 0.0) 96 elif student.is_postgrad and student.state == PAID: 97 # Returning postgraduate students also pay for the 98 # next session but their level always remains the 99 # same. 100 p_session += 1 101 academic_session = self._getSessionConfiguration(p_session) 102 if academic_session == None: 103 return _( 104 u'Session configuration object is not available.' 105 ), None 106 amount = getattr(certificate, 'school_fee_2', 0.0) 83 if student.state == RETURNING: 84 # Override p_session and p_level 85 p_session, p_level = self.getReturningData(student) 86 academic_session = self._getSessionConfiguration(p_session) 87 if academic_session == None: 88 return _(u'Session configuration object ' 89 'is not available.'), None 90 if student.state in (RETURNING, CLEARED): 91 if p_level in PAYMENT_LEVELS: 92 amount = SCHOOL_FEES.get_fee( 93 ( 94 local_nonlocal(student), 95 student.current_mode, 96 p_level) 97 ) 98 amount += GATEWAY_AMT 107 99 elif category == 'clearance': 108 100 try: … … 111 103 return _('Study course data are incomplete.'), None 112 104 amount = academic_session.clearance_fee 105 if local_nonlocal(student) == 'non-local': 106 amount += 5000.0 113 107 elif category == 'bed_allocation': 114 108 p_item = self.getAccommodationDetails(student)['bt'] -
main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/utils/utils.py
r14333 r14336 34 34 35 35 STUDY_MODES_DICT = { 36 'ume_ft': 'UME Full Time',37 36 'ug_ft': 'Undergraduate Full Time', 38 'ug_pt': 'Undergraduate Part Time',39 'dp_pt': 'Diploma Part Time',40 'ct_ft': 'Certificate Full Time',41 'dp_ft': 'Diploma Full Time',42 'de_ft': 'Direct Entry Full Time',43 'de_pt': 'Direct Entry Part Time',44 'nd_ft': 'National Diploma Full Time',45 'nd_pt': 'National Diploma Part Time',46 'hnd_ft': 'Higher National Diploma Full Time',47 'hnd_pt': 'Higher National Diploma Part Time',48 37 'pg_ft': 'Postgraduate Full Time', 49 38 'pg_pt': 'Postgraduate Part Time', 50 'pgd_ft': 'Postgraduate Diploma Full Time',51 'pgd_pt': 'Postgraduate Diploma Part Time',52 'special_pg_pt': 'Special Postgraduate Part Time',53 39 'nce_ft': 'NCE Full Time', 54 40 'nce_pt': 'NCE Part Time', 55 'ug_sw': 'Undergraduate Sandwich',56 41 'nce_sw': 'NCE Sandwich', 57 'jm_ft': 'Joint Matriculation Full Time',58 'ph_ft': 'Post Higher Education Full Time',59 'transfer_pt': 'Transfer Part Time',60 'transfer_ft': 'Transfer Full Time',61 'ct_pt': 'Certificate Part Time',62 'rmd_ft': 'Remedial with deficiencies',63 'rm_ft': 'Remedial',64 'transfer': 'Transfer',65 42 'prence': 'Pre-NCE', 66 'prend': 'Pre-ND',67 'pce': 'PCE',68 'pd_ft': 'Professional Diploma in Education',69 'found': 'Foundation',70 43 'no': 'no application', 71 44 }
Note: See TracChangeset for help on using the changeset viewer.