Changeset 9409 for main/waeup.futminna/trunk
- Timestamp:
- 24 Oct 2012, 22:01:59 (12 years ago)
- Location:
- main/waeup.futminna/trunk/src/waeup/futminna
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/interswitch/browser.py
r9386 r9409 28 28 from waeup.kofa.students.viewlets import ApprovePaymentActionButton as APABStudent 29 29 from waeup.kofa.applicants.viewlets import ApprovePaymentActionButton as APABApplicant 30 from waeup.kofa.payments.interfaces import payment_categories31 30 from waeup.futminna.students.interfaces import ICustomStudentOnlinePayment 32 31 from waeup.futminna.applicants.interfaces import ICustomApplicantOnlinePayment … … 177 176 xmldict['department'] = None 178 177 xmldict['faculty'] = None 179 self.category = payment_categories.getTermByToken( 180 self.context.p_category).title 178 self.category = getUtility(IKofaUtils).PAYMENT_CATEGORIES[self.context.p_category] 181 179 tz = getUtility(IKofaUtils).tzinfo 182 180 self.local_date_time = to_timezone( … … 265 263 self.pay_item_id = "11706" 266 264 265 elif self.context.p_category == 'hostel_maintenance': 266 xmldict['institution_amt'] = 100 * ( 267 self.context.amount_auth - 300) 268 xmldict['institution_acct'] = "0000000000000" 269 xmldict['institution_bank_id'] = '00' 270 self.pay_item_id = "0000" 271 272 elif self.context.p_category == 'block_h_maintenance': 273 xmldict['institution_amt'] = 100 * ( 274 self.context.amount_auth - 300) 275 xmldict['institution_acct'] = "0000000000000" 276 xmldict['institution_bank_id'] = '00' 277 self.pay_item_id = "0000" 278 267 279 xmldict['institution_name'] = INSTITUTION_NAME 268 280 # Interswitch amount is not part of the xml data … … 275 287 </item_details> 276 288 </payment_item_detail>""" % xmldict 289 277 290 elif self.context.p_category == 'clearance': 278 291 xmltext = """<payment_item_detail> … … 281 294 </item_details> 282 295 </payment_item_detail>""" % xmldict 296 297 elif 'maintenance' in self.context.p_category: 298 xmltext = """<payment_item_detail> 299 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s"> 300 <item_detail item_id="1" item_name="Maintenance Fee" item_amt="%(institution_amt)d" bank_id="%(institution_bank_id)s" acct_num="%(institution_acct)s" /> 301 </item_details> 302 </payment_item_detail>""" % xmldict 303 304 283 305 self.xml_data = """<input type="hidden" name="xml_data" value='%s' />""" % xmltext 284 306 return -
main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
r9404 r9409 162 162 self.assertEqual(payment.p_level, 100) 163 163 self.assertEqual(payment.p_session, 2004) 164 self.assertEqual(payment.amount_auth, 1 5000.0)164 self.assertEqual(payment.amount_auth, 10000.0) 165 165 self.assertEqual(payment.p_item, u'sse_male_fr') 166 166 self.assertEqual(error, None) … … 171 171 self.assertEqual(payment.p_session, 2004) 172 172 self.assertEqual(payment.amount_auth, 10000.0) 173 self.assertEqual(payment.p_item, u'regular_male_fr') 174 self.assertEqual(error, None) 175 176 error, payment = utils.setPaymentDetails('block_h_maintenance',self.student) 177 self.assertEqual(payment.p_level, 100) 178 self.assertEqual(payment.p_session, 2004) 179 self.assertEqual(payment.amount_auth, 15000.0) 173 180 self.assertEqual(payment.p_item, u'regular_male_fr') 174 181 self.assertEqual(error, None) -
main/waeup.futminna/trunk/src/waeup/futminna/students/utils.py
r9404 r9409 120 120 'booking_session']: 121 121 return _(u'Current session does not match accommodation session.'), None 122 if student.faccode == 'SSE': 123 amount = 15000.0 124 elif student.current_level in ('100','200','300','400','500') and \ 122 if student.current_level in ('100','200','300','400','500') and \ 125 123 student.faccode in ('EET','SET','AAT','ICT','EMT'): 126 124 amount = 12000.0 127 125 else: 128 126 amount = 10000.0 127 p_item = acc_details['bt'] 128 elif category == 'block_h_maintenance': 129 acc_details = self.getAccommodationDetails(student) 130 if student['studycourse'].current_session != acc_details[ 131 'booking_session']: 132 return _(u'Current session does not match accommodation session.'), None 133 amount = 15000.0 129 134 p_item = acc_details['bt'] 130 135 elif category == 'bed_allocation': -
main/waeup.futminna/trunk/src/waeup/futminna/utils/utils.py
r9402 r9409 32 32 'sse': 'SSE Hostel' 33 33 } 34 35 PAYMENT_CATEGORIES = { 36 'schoolfee': 'School Fee', 37 'clearance': 'Acceptance Fee', 38 'hostel_maintenance': 'Regular Hostel Maintenance Fee', 39 'block_h_maintenance': 'Block H Maintenance Fee', 40 'application': 'Application Fee' 41 }
Note: See TracChangeset for help on using the changeset viewer.