Changeset 16309
- Timestamp:
- 10 Nov 2020, 14:33:53 (4 years ago)
- Location:
- main/kofacustom.dspg/trunk/src/kofacustom/dspg
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interfaces.py
r15571 r16309 406 406 ) 407 407 408 gns_1_fee = schema.Float( 409 title = _(u'GNS Pack I'), 410 default = 0.0, 411 required = True, 412 ) 413 414 gns_2_fee = schema.Float( 415 title = _(u'GNS Pack II'), 416 default = 0.0, 417 required = True, 418 ) 419 408 420 bfn_fee = schema.Float( 409 421 title = _(u'BFN Pack'), -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py
r16026 r16309 186 186 xmldict['institution_acct'] = '2015327204' 187 187 xmldict['institution_bank_id'] = '8' 188 elif self.context.p_category == 'gns_1': 189 self.pay_item_id = '154' 190 xmldict['institution_acct'] = '2017447652' 191 xmldict['institution_bank_id'] = '8' 192 elif self.context.p_category == 'gns_2': 193 self.pay_item_id = '155' 194 xmldict['institution_acct'] = '2017447652' 195 xmldict['institution_bank_id'] = '8' 188 196 elif self.context.p_category == 'hostel_maintenance': 189 197 if self.context.p_item != 'Balance': -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py
r16308 r16309 67 67 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 68 68 self.browser.getControl("Create ticket").click() 69 self.assertTrue('You have to pay NADESU/SA/SUG Dues first'69 self.assertTrue('You have to pay NADESU/SA/SUG and GNS Dues first' 70 70 in self.browser.contents) 71 71 payment = createObject('waeup.StudentOnlinePayment') … … 75 75 payment.p_state = u'paid' 76 76 self.student['payments']['anykey'] = payment 77 payment2 = createObject('waeup.StudentOnlinePayment') 78 payment2.p_category = u'gns_1' 79 payment2.p_session = self.student.current_session 80 payment2.p_id = u'anyid2' 81 payment2.p_state = u'paid' 82 self.student['payments']['anykey2'] = payment2 77 83 self.browser.open(self.payments_path + '/addop') 78 84 self.browser.getControl(name="form.p_category").value = ['schoolfee'] -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/tests/test_utils.py
r15360 r16309 88 88 self.assertEqual(payment.p_session, 2005) 89 89 self.assertEqual(payment.amount_auth, 3150.0) 90 # Students can pay school fee if dep_sug hasbeen paid first.90 # Students can pay school fee if dep_sug and gns dues have been paid first. 91 91 error, payment = utils.setPaymentDetails('schoolfee',self.student) 92 self.assertEqual(error, u'You have to pay NADESU/SA/SUG Dues first.')92 self.assertEqual(error, u'You have to pay NADESU/SA/SUG and GNS Dues first.') 93 93 error, payment = utils.setPaymentDetails('dep_sug',self.student) 94 94 self.student['payments']['any_key'] = payment 95 95 error, payment = utils.setPaymentDetails('schoolfee',self.student) 96 self.assertEqual(error, u'You have to pay NADESU/SA/SUG Dues first.') 96 self.assertEqual(error, u'You have to pay NADESU/SA/SUG and GNS Dues first.') 97 98 configuration.gns_1_fee = 1150.0 99 error, payment2 = utils.setPaymentDetails('gns_1',self.student) 100 self.student['payments']['any_key2'] = payment2 101 self.assertEqual(payment2.p_level, 200) 102 self.assertEqual(payment2.p_session, 2005) 103 self.assertEqual(payment2.amount_auth, 1150.0) 104 error, payment = utils.setPaymentDetails('schoolfee',self.student) 105 97 106 self.student['payments']['any_key'].p_state = 'paid' 107 self.student['payments']['any_key2'].p_state = 'paid' 98 108 error, payment = utils.setPaymentDetails('schoolfee',self.student) 99 109 self.assertEqual(error, None) -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py
r16155 r16309 38 38 STUDENT_ID_PREFIX = u'P' 39 39 40 def _dep_sug_ paymentMade(self, student, session):40 def _dep_sug_gns_paymentMade(self, student, session): 41 41 if student.state == RETURNING: 42 42 session += 1 43 dep_sug = False 44 gns = False 43 45 if len(student['payments']): 44 46 for ticket in student['payments'].values(): … … 46 48 ticket.p_category == 'dep_sug' and \ 47 49 ticket.p_session == session: 50 dep_sug = True 51 if ticket.p_state == 'paid' and \ 52 ticket.p_category.startswith('gns') and \ 53 ticket.p_session == session: 54 gns = True 55 if dep_sug and gns: 48 56 return True 49 57 return False … … 163 171 else: 164 172 # Students are only allowed to pay school fee 165 # if current session dep_sug payment has been made.166 if student.faccode != 'SPAT' and not self._dep_sug_ paymentMade(173 # if current session dep_sug_gns payment has been made. 174 if student.faccode != 'SPAT' and not self._dep_sug_gns_paymentMade( 167 175 student, student.current_session): 168 return _('You have to pay NADESU/SA/SUG Dues first.'), None176 return _('You have to pay NADESU/SA/SUG and GNS Dues first.'), None 169 177 penalty = getattr(academic_session, 'lsfp_penalty_fee') 170 178 if penalty and not self._lsfp_penalty_paymentMade( … … 257 265 if student.state == RETURNING and not previous_session: 258 266 p_session, p_level = self.getReturningData(student) 267 elif category.startswith('gns'): 268 if student.state == RETURNING and not previous_session: 269 p_session, p_level = self.getReturningData(student) 270 fee_name = category + '_fee' 271 academic_session = self._getSessionConfiguration(p_session) 272 amount = getattr(academic_session, fee_name, 0.0) 259 273 else: 260 274 fee_name = category + '_fee' -
main/kofacustom.dspg/trunk/src/kofacustom/dspg/utils/utils.py
r15691 r16309 116 116 'sbs_1':'SBS Pack I', 117 117 'sbs_2':'SBS Pack II', 118 'gns_1':'GNS Pack I', 119 'gns_2':'GNS Pack II', 118 120 'bfn':'BFN Pack', 119 121 'mkt':'MKT Pack', … … 184 186 'sbs_1':'SBS Pack I', 185 187 'sbs_2':'SBS Pack II', 188 'gns_1':'GNS Pack I', 189 'gns_2':'GNS Pack II', 186 190 'bfn':'BFN Pack', 187 191 'mkt':'MKT Pack',
Note: See TracChangeset for help on using the changeset viewer.