Changeset 16431 for main/waeup.kofa/trunk/src
- Timestamp:
- 25 Mar 2021, 09:45:54 (4 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r16327 r16431 819 819 self.redirect(self.url(self.context)) 820 820 return 821 if getattr(self.context, 'p_option', None): 822 payment.p_option = self.context.p_option 821 823 self.context[payment.p_id] = payment 822 824 self.context.writeLogMessage(self, 'added: %s' % payment.p_id) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
r16069 r16431 162 162 IApplicantOnlinePayment, 163 163 exclude_attribs=False, 164 omit=['display_item' ]))) + (164 omit=['display_item', 'p_option']))) + ( 165 165 'applicant_id', 166 166 'reg_number', -
main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py
r15792 r16431 38 38 DICT_NAME = 'PAYMENT_CATEGORIES' 39 39 40 class PaymentOptionSource(ContextualDictSourceFactoryBase): 41 """A payment option source delivers all options of a payment. 42 43 """ 44 #: name of dict to deliver from kofa utils. 45 DICT_NAME = 'PAYMENT_OPTIONS' 46 40 47 class CombiPaymentCategorySource(ContextualDictSourceFactoryBase): 41 48 """A payment category source delivers all categories of payments. … … 61 68 source = PaymentCategorySource(), 62 69 required = True, 70 ) 71 72 p_option = schema.Choice( 73 title = _(u'Payment Option'), 74 source = PaymentOptionSource(), 75 required = False, 63 76 ) 64 77 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r16412 r16431 2241 2241 return sorted(categories.items(), key=lambda value: value[1]) 2242 2242 2243 @property 2244 def selectable_payment_options(self): 2245 student = self.context.__parent__ 2246 options = getUtility( 2247 IKofaUtils).selectable_payment_options(student) 2248 return sorted(options.items(), key=lambda value: value[1]) 2249 2243 2250 @action(_('Create ticket'), style='primary') 2244 2251 def createTicket(self, **data): 2245 2252 form = self.request.form 2246 2253 p_category = form.get('form.p_category', None) 2254 p_option = form.get('form.p_option', None) 2247 2255 p_combi = form.get('form.p_combi', []) 2248 2256 if isinstance(form.get('form.p_combi', None), unicode): … … 2272 2280 if p_category == 'transfer': 2273 2281 payment.p_item = form['new_programme'] 2282 if p_option: 2283 payment.p_option = p_option 2274 2284 self.context[payment.p_id] = payment 2275 2285 self.flash(_('Payment ticket created.')) … … 2287 2297 grok.context(IStudentPaymentsContainer) 2288 2298 grok.name('addpp') 2299 grok.template('previouspaymentaddform') 2289 2300 grok.require('waeup.payStudent') 2290 2301 form_fields = grok.AutoFields(IStudentPreviousPayment) … … 2299 2310 return 2300 2311 2312 @property 2313 def selectable_payment_options(self): 2314 student = self.context.__parent__ 2315 options = getUtility( 2316 IKofaUtils).selectable_payment_options(student) 2317 return sorted(options.items(), key=lambda value: value[1]) 2318 2301 2319 @action(_('Create ticket'), style='primary') 2302 2320 def createTicket(self, **data): 2303 2321 p_category = data['p_category'] 2322 p_option = data.get('p_option', None) 2304 2323 previous_session = data.get('p_session', None) 2305 2324 previous_level = data.get('p_level', None) … … 2311 2330 self.flash(error, type="danger") 2312 2331 return 2332 if p_option: 2333 payment.p_option = p_option 2313 2334 self.context[payment.p_id] = payment 2314 2335 self.flash(_('Payment ticket created.')) … … 2327 2348 grok.context(IStudentPaymentsContainer) 2328 2349 grok.name('addbp') 2350 grok.template('previouspaymentaddform') 2329 2351 grok.require('waeup.manageStudent') 2330 2352 form_fields = grok.AutoFields(IStudentBalancePayment) … … 2332 2354 pnav = 4 2333 2355 2356 @property 2357 def selectable_payment_options(self): 2358 student = self.context.__parent__ 2359 options = getUtility( 2360 IKofaUtils).selectable_payment_options(student) 2361 return sorted(options.items(), key=lambda value: value[1]) 2362 2334 2363 @action(_('Create ticket'), style='primary') 2335 2364 def createTicket(self, **data): 2336 2365 p_category = data['p_category'] 2366 p_option = data.get('p_option', None) 2337 2367 balance_session = data.get('balance_session', None) 2338 2368 balance_level = data.get('balance_level', None) … … 2346 2376 self.flash(error, type="danger") 2347 2377 return 2378 if p_option: 2379 payment.p_option = p_option 2348 2380 self.context[payment.p_id] = payment 2349 2381 self.flash(_('Payment ticket created.')) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/onlinepaymentaddform.pt
r15664 r16431 14 14 tal:attributes="value python:item[0]"> 15 15 <span tal:replace="python:item[1]">FEE CATEGORY</span> 16 </option> 17 </select> 18 </td> 19 </tr> 20 <tr tal:condition="view/selectable_payment_options"> 21 <td class="fieldname"> 22 Payment Option: 23 </td> 24 <td> 25 <select id="form.p_option" name="form.p_option" size="1" 26 class="form-control half" onclick="further()"> 27 <option tal:repeat="item view/selectable_payment_options" 28 tal:attributes="value python:item[0]"> 29 <span tal:replace="python:item[1]">PAYMENT OPTION</span> 16 30 </option> 17 31 </select> -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r16412 r16431 491 491 sorted(iface_names( 492 492 IStudentOnlinePayment, exclude_attribs=False, 493 omit=['display_item', 'certificate', 'student' ]))) + (493 omit=['display_item', 'certificate', 'student', 'p_option']))) + ( 494 494 'student_id','state','current_session') 495 495 title = _(u'Student Payments (Data Backup)') … … 520 520 sorted(iface_names( 521 521 IStudentOnlinePayment, exclude_attribs=False, 522 omit=['display_item', 'certificate', 'student', 'ac' ]))) + (522 omit=['display_item', 'certificate', 'student', 'ac', 'p_option']))) + ( 523 523 'student_id','faccode', 'depcode', 'state','current_session') 524 524 title = _(u'Student Payments (Sorted Data)') … … 640 640 sorted(iface_names( 641 641 IStudentOnlinePayment, exclude_attribs=False, 642 omit=['display_item', 'certificate', 'student' ]))) + (642 omit=['display_item', 'certificate', 'student', 'p_option']))) + ( 643 643 'student_id','matric_number','reg_number', 644 644 'firstname', 'middlename', 'lastname','sex', -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r16299 r16431 188 188 } 189 189 190 #: If PAYMENT_OPTIONS is empty, payment option fields won't show up. 191 PAYMENT_OPTIONS = { 192 #'credit_card': 'Credit Card', 193 #'debit_card': 'Debit Card', 194 } 195 190 196 def selectable_payment_categories(self, student): 191 197 return self.PAYMENT_CATEGORIES 198 199 def selectable_payment_options(self, student): 200 return self.PAYMENT_OPTIONS 192 201 193 202 PREVIOUS_PAYMENT_CATEGORIES = deepcopy(PAYMENT_CATEGORIES)
Note: See TracChangeset for help on using the changeset viewer.