Changeset 6920
- Timestamp:
- 22 Oct 2011, 05:15:30 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/configuration.py
r6918 r6920 19 19 import grok 20 20 from zope.component.interfaces import IFactory 21 from zope.interface import implementedBy 21 22 from waeup.sirp.interfaces import ( 22 23 ISessionConfiguration, IConfigurationContainer, ISessionConfigurationAdd, -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6912 r6920 881 881 payment.surcharge_1, 882 882 payment.surcharge_2, 883 payment.surcharge_3) = getPaymentDetails( 883 payment.surcharge_3, 884 error) = getPaymentDetails( 884 885 data['p_category'],self.context.__parent__) 885 #if payment.amount_auth == 0:886 # self.flash('Payment amount could not be determined.')887 #self.redirect(self.url(self.context, u'@@manage'))888 #return886 if error: 887 self.flash(error) 888 self.redirect(self.url(self.context, u'@@manage')) 889 return 889 890 self.context[payment.p_id] = payment 890 891 self.flash('Payment ticket created.') -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
r6914 r6920 34 34 from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase 35 35 from waeup.sirp.app import University 36 from waeup.sirp.configuration import SessionConfiguration 36 37 from waeup.sirp.students.student import Student 37 38 from waeup.sirp.university.faculty import Faculty … … 80 81 # to access grok.getSite() and should get our new app then 81 82 setSite(app) 83 84 # Set up SessionConfiguration object 85 configuration = SessionConfiguration() 86 configuration.academic_session = 2004 87 configuration.fee_1 = 20000 88 self.app['configuration'].addSessionConfiguration(configuration) 82 89 83 90 # Add student with subobjects -
main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
r6915 r6920 1 1 """General helper functions for the student section. 2 2 """ 3 3 from grok import getSite 4 4 from random import SystemRandom as r 5 5 from waeup.sirp.interfaces import academic_sessions_vocab … … 21 21 return 22 22 23 # To be defined in customization packages 23 # To be specified in customization packages. 24 # This function is for demonstration and testing only. 24 25 def getPaymentDetails(category, student): 25 p_session = None26 26 surcharge_1 = surcharge_2 = surcharge_3 = 0 27 27 p_item = u'' 28 28 amount = 0 29 return amount, p_item, p_session, surcharge_1, surcharge_2, surcharge_3 29 error = u'' 30 p_session = student['studycourse'].current_session 31 session = str(p_session) 32 try: 33 academic_session = getSite()['configuration'][session] 34 except KeyError: 35 error = u'Session configuration object is not available.' 36 return (amount, p_item, p_session, 37 surcharge_1, surcharge_2, surcharge_3, error) 38 if category == 'schoolfee': 39 amount = academic_session.fee_1 40 surcharge_1 = academic_session.fee_2 41 p_item = student['studycourse'].certificate.code 42 return (amount, p_item, p_session, 43 surcharge_1, surcharge_2, surcharge_3, error)
Note: See TracChangeset for help on using the changeset viewer.