Changeset 13406 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 7 Nov 2015, 12:05:48 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py
r13403 r13406 49 49 50 50 51 def dynamic_gateway_amt(fee): 52 return GATEWAY_AMT 53 51 54 def contr_agreement(student): 52 55 if student.current_mode == 'found' or student.current_mode.endswith('_pt'): … … 216 219 - joint_venture_amt 217 220 - aaue_share_amt 218 - student_union_due_amt219 - student_welfare_assurance_amt221 - (student_union_due_amt - GATEWAY_AMT) 222 - (student_welfare_assurance_amt - GATEWAY_AMT) 220 223 - GATEWAY_AMT) 221 224 xmltext = """<payment_item_detail> … … 271 274 xmldict['institution_amt'] = 100 * ( 272 275 self.context.amount_auth 273 - gown_fee_amt274 - aaue_fl_fee_amt276 - (gown_fee_amt - GATEWAY_AMT) 277 - (aaue_fl_fee_amt - GATEWAY_AMT) 275 278 - GATEWAY_AMT) 276 279 xmltext = """<payment_item_detail> … … 299 302 xmldict['institution_bank_id'] = '123' 300 303 xmldict['institution_amt'] = 100 * ( 301 self.context.amount_auth - GATEWAY_AMT) 304 self.context.amount_auth - 305 dynamic_gateway_amt(self.context.amount_auth)) 302 306 xmltext = """<payment_item_detail> 303 307 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 312 316 xmldict['institution_bank_id'] = '51' 313 317 xmldict['institution_amt'] = 100 * ( 314 self.context.amount_auth - GATEWAY_AMT) 318 self.context.amount_auth - 319 dynamic_gateway_amt(self.context.amount_auth)) 315 320 xmltext = """<payment_item_detail> 316 321 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 325 330 xmldict['institution_bank_id'] = '123' 326 331 xmldict['institution_amt'] = 100 * ( 327 self.context.amount_auth - GATEWAY_AMT) 332 self.context.amount_auth - 333 dynamic_gateway_amt(self.context.amount_auth)) 328 334 xmltext = """<payment_item_detail> 329 335 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 338 344 xmldict['institution_bank_id'] = '51' 339 345 xmldict['institution_amt'] = 100 * ( 340 self.context.amount_auth - GATEWAY_AMT) 346 self.context.amount_auth - 347 dynamic_gateway_amt(self.context.amount_auth)) 341 348 xmltext = """<payment_item_detail> 342 349 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 351 358 xmldict['institution_bank_id'] = '117' 352 359 xmldict['institution_amt'] = 100 * ( 353 self.context.amount_auth - GATEWAY_AMT) 360 self.context.amount_auth - 361 dynamic_gateway_amt(self.context.amount_auth)) 354 362 xmltext = """<payment_item_detail> 355 363 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 364 372 xmldict['institution_bank_id'] = '117' 365 373 xmldict['institution_amt'] = 100 * ( 366 self.context.amount_auth - GATEWAY_AMT) 374 self.context.amount_auth - 375 dynamic_gateway_amt(self.context.amount_auth)) 367 376 xmltext = """<payment_item_detail> 368 377 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> … … 377 386 xmldict['institution_bank_id'] = '123' 378 387 xmldict['institution_amt'] = 100 * ( 379 self.context.amount_auth - GATEWAY_AMT) 388 self.context.amount_auth - 389 dynamic_gateway_amt(self.context.amount_auth)) 380 390 xmltext = """<payment_item_detail> 381 391 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> -
main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py
r13403 r13406 121 121 self.browser.getLink(self.value).click() 122 122 self.assertTrue('Amount Authorized' in self.browser.contents) 123 self.assertTrue('<span>51750.0</span>' in self.browser.contents) 123 # 50250 + 1000 + 500 - 500 124 self.assertTrue('<span>51250.0</span>' in self.browser.contents) 124 125 self.payment_url = self.browser.url 125 126 self.browser.getLink("CollegePAY", index=0).click() … … 136 137 self.assertEqual(self.student.current_mode, 'ug_pt') 137 138 self.assertTrue( 138 '<input type="hidden" name="amount" value="51 75000" />'139 '<input type="hidden" name="amount" value="5125000" />' 139 140 in self.browser.contents) 140 141 self.assertTrue( … … 203 204 self.browser.getLink(self.value).click() 204 205 self.assertTrue('Amount Authorized' in self.browser.contents) 205 self.assertTrue('<span>43050.0</span>' in self.browser.contents) 206 # 40250 + 2000 + 800 -500 207 self.assertTrue('<span>42550.0</span>' in self.browser.contents) 206 208 self.payment_url = self.browser.url 207 209 self.browser.getLink("CollegePAY", index=0).click() … … 210 212 self.assertTrue('Total Amount Authorized:' in self.browser.contents) 211 213 self.assertTrue( 212 '<input type="hidden" name="amount" value="4 305000" />'214 '<input type="hidden" name="amount" value="4255000" />' 213 215 in self.browser.contents) 214 216 self.assertTrue( -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13403 r13406 317 317 self.browser.getLink(value).click() 318 318 self.assertTrue('Amount Authorized' in self.browser.contents) 319 self.assertEqual(self.student['payments'][value].amount_auth, 51 750.0)319 self.assertEqual(self.student['payments'][value].amount_auth, 51250.0) 320 320 self.browser.open(self.browser.url + '/payment_slip.pdf') 321 321 self.assertEqual(self.browser.headers['Status'], '200 Ok') -
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r13405 r13406 24 24 from waeup.kofa.accesscodes import create_accesscode 25 25 from waeup.kofa.students.utils import trans 26 from waeup.aaue.interswitch.browser import dynamic_gateway_amt 26 27 from waeup.aaue.interfaces import MessageFactory as _ 27 28 … … 148 149 # Otherwise we can't add somtehing 149 150 amount = 0.0 150 amount += academic_session.matric_gown_fee + academic_session.lapel_fee 151 amount += academic_session.matric_gown_fee + \ 152 academic_session.lapel_fee - \ 153 2*(dynamic_gateway_amt(amount)) 151 154 elif category == 'late_registration': 152 155 amount = academic_session.late_registration_fee … … 183 186 # Otherwise we can't add somtehing 184 187 amount = 0.0 185 amount += academic_session.welfare_fee + academic_session.union_fee 188 amount += academic_session.welfare_fee + \ 189 academic_session.union_fee - \ 190 2*(dynamic_gateway_amt(amount)) 186 191 if amount in (0.0, None): 187 192 return _(u'Amount could not be determined.'), None
Note: See TracChangeset for help on using the changeset viewer.