Changeset 17057 for main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
- Timestamp:
- 5 Aug 2022, 16:34:49 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r16936 r17057 400 400 return _("You are not allowed " 401 401 "to pay by instalments."), None 402 # We determine the base amount first 403 if student.entry_session < 2015: 404 amount = getattr(certificate, 'school_fee_3', 0.0) 405 elif student.entry_session < 2020: 406 amount = getattr(certificate, 'school_fee_2', 0.0) 407 else: 408 amount = getattr(certificate, 'school_fee_1', 0.0) 402 409 if previous_session: 403 410 # Students can pay for previous sessions in all 404 411 # workflow states. Fresh students are excluded by the 405 412 # update method of the PreviousPaymentAddFormPage. 406 if previous_level == 100: 407 amount = getattr(certificate, 'school_fee_1', 0.0) 408 else: 409 if student.entry_session in (2015, 2016): 410 amount = getattr(certificate, 'school_fee_2', 0.0) 411 else: 412 amount = getattr(certificate, 'school_fee_3', 0.0) 413 elif student.state == CLEARED and category != 'schoolfee_2': 414 amount = getattr(certificate, 'school_fee_1', 0.0) 413 pass 414 elif student.state == CLEARED: 415 415 # Cut school fee by 50% 416 if category == 'schoolfee_1' and amount: 417 amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT 418 elif student.is_fresh and category == 'schoolfee_2': 419 amount = getattr(certificate, 'school_fee_1', 0.0) 420 # Cut school fee by 50% 421 if amount: 416 if category in ('schoolfee_1', 'schoolfee_2') and amount: 422 417 amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT 423 418 elif student.state == RETURNING and category != 'schoolfee_2': … … 433 428 except KeyError: 434 429 return _(u'Session configuration object is not available.'), None 435 if student.entry_session >= 2015:436 amount = getattr(certificate, 'school_fee_2', 0.0)437 else:438 amount = getattr(certificate, 'school_fee_3', 0.0)439 430 # Cut school fee by 50% 440 431 if category == 'schoolfee_1' and amount: 441 432 amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT 442 elif category == 'schoolfee_2': 443 amount = getattr(certificate, 'school_fee_2', 0.0) 444 # Cut school fee by 50% 445 if amount: 446 amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT 433 elif category == 'schoolfee_2' and amount: 434 amount = gateway_net_amt(amount) / 2 + GATEWAY_AMT 447 435 else: 448 436 return _('Wrong state.'), None
Note: See TracChangeset for help on using the changeset viewer.