Changeset 9868 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 12 Jan 2013, 06:34:26 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9867 r9868 1523 1523 @action(_('Create ticket'), style='primary') 1524 1524 def createTicket(self, **data): 1525 balance_item = data.get('balance_item', None)1525 p_category = data['p_category'] 1526 1526 balance_session = data.get('balance_session', None) 1527 1527 balance_level = data.get('balance_level', None) … … 1530 1530 students_utils = getUtility(IStudentsUtils) 1531 1531 error, payment = students_utils.setBalanceDetails( 1532 balance_item, student, balance_session,1532 p_category, student, balance_session, 1533 1533 balance_level, balance_amount) 1534 1534 if error is not None: -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r9864 r9868 43 43 DICT_NAME = 'PREVIOUS_PAYMENT_CATEGORIES' 44 44 45 class BalancePayment ItemSource(ContextualDictSourceFactoryBase):45 class BalancePaymentCategorySource(ContextualDictSourceFactoryBase): 46 46 """A source that delivers all selectable items of balance payments. 47 47 """ 48 48 #: name of dict to deliver from kofa utils. 49 DICT_NAME = 'BALANCE_PAYMENT_ ITEMS'49 DICT_NAME = 'BALANCE_PAYMENT_CATEGORIES' 50 50 51 51 # VerdictSource can't be placed into the vocabularies module because it … … 770 770 """ 771 771 772 balance_item= schema.Choice(772 p_category = schema.Choice( 773 773 title = _(u'Payment Category'), 774 774 default = u'schoolfee', 775 775 required = True, 776 source = BalancePayment ItemSource(),776 source = BalancePaymentCategorySource(), 777 777 ) 778 778 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9865 r9868 2396 2396 # Previous session payment form is provided 2397 2397 self.assertEqual(self.student.current_session, 2004) 2398 self.browser.getControl(name="form. balance_item").value = ['schoolfee']2398 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2399 2399 self.browser.getControl(name="form.balance_session").value = ['2004'] 2400 2400 self.browser.getControl(name="form.balance_level").value = ['300'] … … 2412 2412 self.assertEqual(self.student['payments'][value].p_session, 2004) 2413 2413 self.assertEqual(self.student['payments'][value].p_level, 300) 2414 self.assertEqual(self.student['payments'][value].p_item, u' School Fee')2415 self.assertEqual(self.student['payments'][value].p_category, ' balance')2414 self.assertEqual(self.student['payments'][value].p_item, u'Balance') 2415 self.assertEqual(self.student['payments'][value].p_category, 'schoolfee') 2416 2416 2417 2417 def test_postgraduate_student_payments(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r9864 r9868 421 421 return None, payment 422 422 423 def setBalanceDetails(self, balance_item, student,423 def setBalanceDetails(self, category, student, 424 424 balance_session, balance_level, balance_amount): 425 425 """Create Payment object and set the payment data of a student for. 426 426 427 427 """ 428 p_item = getUtility(IKofaUtils).BALANCE_PAYMENT_ITEMS[balance_item] 429 p_item = unicode(p_item) 428 p_item = u'Balance' 430 429 p_session = balance_session 431 430 p_level = balance_level … … 447 446 timestamp = ("%d" % int(time()*10000))[1:] 448 447 payment.p_id = "p%s" % timestamp 449 payment.p_category = 'balance'448 payment.p_category = category 450 449 payment.p_item = p_item 451 450 payment.p_session = p_session -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r9867 r9868 160 160 'gown': 'Gown Hire Fee', 161 161 'application': 'Application Fee', 162 'balance': 'Balance'163 162 } 164 163 165 164 SELECTABLE_PAYMENT_CATEGORIES = deepcopy(PAYMENT_CATEGORIES) 166 del SELECTABLE_PAYMENT_CATEGORIES['balance']167 165 168 166 PREVIOUS_PAYMENT_CATEGORIES = deepcopy(SELECTABLE_PAYMENT_CATEGORIES) 169 167 170 BALANCE_PAYMENT_ ITEMS = {168 BALANCE_PAYMENT_CATEGORIES = { 171 169 'schoolfee': 'School Fee', 172 170 }
Note: See TracChangeset for help on using the changeset viewer.