Changeset 9737
- Timestamp:
- 28 Nov 2012, 17:00:43 (12 years ago)
- Location:
- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py
r9725 r9737 241 241 xmldict['dalash_amt'] = 0 242 242 self.pay_item_id = '000' 243 if self.context.p_category in ('schoolfee', 'co1', 'co2', 'co3'):243 if self.context.p_category == 'schoolfee': 244 244 self.pay_item_id = '101' 245 245 # Dalash data -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py
r9725 r9737 79 79 IWorkflowState(self.student).setState('cleared') 80 80 self.browser.open(self.payments_path + '/addop') 81 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 81 82 self.browser.getControl("Create ticket").click() 82 83 self.assertMatches('...ticket created...', … … 154 155 self.assertMatches('...Amount Authorized...', 155 156 self.browser.contents) 156 157 157 # Maint fee is taken from the session configuration object 158 158 self.assertMatches( … … 174 174 self.assertMatches( 175 175 '...item_name="Hostel Maintenance Fee" item_amt="68700" bank_id="31" acct_num="0039050937"...', 176 self.browser.contents) 177 178 # Create carryover ticket 179 self.browser.open(self.payments_path + '/addop') 180 self.browser.getControl(name="form.p_category").value = ['carryover1'] 181 self.browser.getControl("Create ticket").click() 182 ctrl = self.browser.getControl(name='val_id') 183 value = ctrl.options[2] 184 self.browser.getLink(value).click() 185 self.assertMatches( 186 '...<span>6000.0</span>...', 187 self.browser.contents) 188 # Manager can access InterswitchForm 189 self.browser.getLink("CollegePAY", index=0).click() 190 self.assertMatches('...<input type="hidden" name="pay_item_id" value="101" />...', 191 self.browser.contents) 192 self.assertMatches('...Total Amount Authorized:...', 193 self.browser.contents) 194 self.assertMatches( 195 '...<input type="hidden" name="amount" value="600000.0" />...', 196 self.browser.contents) 197 self.assertMatches( 198 '...item_name="School Fee" item_amt="270000" bank_id="120" acct_num="1771180233"...', 199 self.browser.contents) 200 self.assertMatches( 201 '...item_name="Dalash" item_amt="180000" bank_id="117" acct_num="1013196791"...', 202 self.browser.contents) 203 self.assertMatches( 204 '...item_name="BT Education" item_amt="120000" bank_id="117" acct_num="1010764827"...', 176 205 self.browser.contents) 177 206 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
r9724 r9737 96 96 self.browser.open(self.payments_path) 97 97 self.browser.getLink("Add current session payment ticket").click() 98 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 98 99 self.browser.getControl("Create ticket").click() 99 100 self.assertMatches('...Amount could not be determined...', … … 101 102 IWorkflowState(self.student).setState('cleared') 102 103 self.browser.open(self.payments_path + '/addop') 104 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 103 105 self.browser.getControl("Create ticket").click() 104 106 self.assertMatches('...ticket created...', … … 117 119 ticket.p_state = 'paid' 118 120 self.browser.open(self.payments_path + '/addop') 121 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 119 122 self.browser.getControl("Create ticket").click() 120 123 self.assertMatches('...This type of payment has already been made...', … … 125 128 del self.student['payments'][payment] 126 129 self.browser.open(self.payments_path + '/addop') 127 self.browser.getControl("Create ticket").click() 128 self.assertMatches('...ticket created...', 129 self.browser.contents) 130 self.browser.open(self.payments_path + '/addop') 131 self.browser.getControl(name="form.p_category").value = ['co1'] 132 self.browser.getControl("Create ticket").click() 133 self.assertMatches('...ticket created...', 134 self.browser.contents) 135 self.browser.open(self.payments_path + '/addop') 136 self.browser.getControl(name="form.p_category").value = ['co2'] 137 self.browser.getControl("Create ticket").click() 138 self.assertMatches('...ticket created...', 139 self.browser.contents) 140 self.browser.open(self.payments_path + '/addop') 141 self.browser.getControl(name="form.p_category").value = ['co3'] 142 self.browser.getControl("Create ticket").click() 143 self.assertMatches('...ticket created...', 144 self.browser.contents) 145 self.browser.open(self.payments_path + '/addop') 146 self.browser.getControl( 147 name="form.p_category").value = ['bed_allocation'] 130 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 131 self.browser.getControl("Create ticket").click() 132 self.assertMatches('...ticket created...', 133 self.browser.contents) 134 self.browser.open(self.payments_path + '/addop') 135 self.browser.getControl(name="form.p_category").value = ['carryover1'] 136 self.browser.getControl("Create ticket").click() 137 self.assertMatches('...ticket created...', 138 self.browser.contents) 139 self.browser.open(self.payments_path + '/addop') 140 self.browser.getControl(name="form.p_category").value = ['carryover2'] 141 self.browser.getControl("Create ticket").click() 142 self.assertMatches('...ticket created...', 143 self.browser.contents) 144 self.browser.open(self.payments_path + '/addop') 145 self.browser.getControl(name="form.p_category").value = ['carryover3'] 148 146 self.browser.getControl("Create ticket").click() 149 147 self.assertMatches('...ticket created...', … … 152 150 self.browser.getControl( 153 151 name="form.p_category").value = ['hostel_maintenance'] 154 self.browser.getControl("Create ticket").click()155 self.assertMatches('...ticket created...',156 self.browser.contents)157 self.browser.open(self.payments_path + '/addop')158 self.browser.getControl(name="form.p_category").value = ['clearance']159 152 self.browser.getControl("Create ticket").click() 160 153 self.assertMatches('...ticket created...', … … 256 249 self.assertEqual(error, None) 257 250 258 error, payment = utils.setPaymentDetails('c o1',self.student)251 error, payment = utils.setPaymentDetails('carryover1',self.student) 259 252 self.assertEqual(payment.p_level, 100) 260 253 self.assertEqual(payment.p_session, 2004) 261 254 self.assertEqual(payment.amount_auth, 6000.0) 262 self.assertEqual(payment.p_item, u'') 263 self.assertEqual(error, None) 264 265 error, payment = utils.setPaymentDetails('co2',self.student) 255 self.assertEqual(payment.p_item, u'1 CarryOver') 256 self.assertEqual(payment.p_category, 'schoolfee') 257 self.assertEqual(error, None) 258 259 error, payment = utils.setPaymentDetails('carryover2',self.student) 266 260 self.assertEqual(payment.p_level, 100) 267 261 self.assertEqual(payment.p_session, 2004) 268 262 self.assertEqual(payment.amount_auth, 7000.0) 269 self.assertEqual(payment.p_item, u'') 270 self.assertEqual(error, None) 271 272 error, payment = utils.setPaymentDetails('co3',self.student) 263 self.assertEqual(payment.p_item, u'2 CarryOvers') 264 self.assertEqual(payment.p_category, 'schoolfee') 265 self.assertEqual(error, None) 266 267 error, payment = utils.setPaymentDetails('carryover3',self.student) 273 268 self.assertEqual(payment.p_level, 100) 274 269 self.assertEqual(payment.p_session, 2004) 275 270 self.assertEqual(payment.amount_auth, 8000.0) 276 self.assertEqual(payment.p_item, u'') 271 self.assertEqual(payment.p_item, u'3 CarryOvers') 272 self.assertEqual(payment.p_category, 'schoolfee') 277 273 self.assertEqual(error, None) 278 274 -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py
r9724 r9737 19 19 import random 20 20 from time import time 21 from zope.component import createObject 21 from zope.component import createObject, getUtility 22 22 from waeup.kofa.interfaces import CLEARED, RETURNING, PAID 23 23 from kofacustom.nigeria.students.utils import NigeriaStudentsUtils 24 24 from waeup.kofa.accesscodes import create_accesscode 25 from waeup.kofa.interfaces import CLEARED, RETURNING 25 from waeup.kofa.interfaces import CLEARED, RETURNING, IKofaUtils 26 26 from waeup.kofa.fees import FeeTable 27 27 from waeup.kwarapoly.interfaces import MessageFactory as _ … … 164 164 p_level) 165 165 ) 166 elif category == 'c o1':166 elif category == 'carryover1': 167 167 amount = 6000.0 168 elif category == 'c o2':168 elif category == 'carryover2': 169 169 amount = 7000.0 170 elif category == 'c o3':170 elif category == 'carryover3': 171 171 amount = 8000.0 172 172 if amount in (0.0, None): … … 179 179 ticket.p_session == p_session: 180 180 return _('This type of payment has already been made.'), None 181 if category.startswith('carryover'): 182 p_item = getUtility(IKofaUtils).PAYMENT_CATEGORIES[category] 183 p_item = unicode(p_item) 184 # Now we change the category to reduce the number of categories. 185 category = 'schoolfee' 181 186 payment = createObject(u'waeup.StudentOnlinePayment') 182 187 timestamp = ("%d" % int(time()*10000))[1:] -
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py
r9724 r9737 43 43 PAYMENT_CATEGORIES = { 44 44 'schoolfee': 'School Fee', 45 'c o1': '1 Carry-Over',46 'c o2': '2 Carry-Overs',47 'c o3': '3 Carry-Overs',45 'carryover1': '1 CarryOver', 46 'carryover2': '2 CarryOvers', 47 'carryover3': '3 CarryOvers', 48 48 'clearance': 'Acceptance Fee', 49 49 'bed_allocation': 'Bed Allocation Fee', … … 51 51 'application': 'Application Fee' 52 52 } 53 54 SELECTABLE_PAYMENT_CATEGORIES = { 55 'schoolfee': 'School Fee', 56 'carryover1': 'One CarryOver', 57 'carryover2': 'Two CarryOvers', 58 'carryover3': 'Three CarryOvers', 59 'hostel_maintenance': 'Hostel Maintenance Fee', 60 }
Note: See TracChangeset for help on using the changeset viewer.