- Timestamp:
- 30 Dec 2022, 09:25:50 (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py
r17228 r17254 26 26 FriendlyDatetimeDisplayWidget) 27 27 from waeup.kofa.applicants.pdf import PDFApplicationSlip 28 from waeup.kofa.browser.layout import KofaEditFormPage, KofaPage, action 28 from waeup.kofa.browser.layout import KofaEditFormPage, KofaPage, action, NullValidator 29 29 from waeup.kofa.applicants.browser import ( 30 30 ApplicantRegistrationPage, ApplicantsContainerPage, … … 214 214 grok.require('waeup.payApplicant') 215 215 216 @action(_('Create ticket'), style='primary') 217 def createTicket(self, **data): 218 p_category = data['p_category'] 219 form = self.request.form 220 p_option = form.get('form.p_option', None) 221 balance_amount = data.get('balance_amount', None) 222 applicants_utils = getUtility(IApplicantsUtils) 223 error, payment = applicants_utils.setBalanceDetails( 224 self.context, p_category, balance_amount) 225 if error is not None: 226 self.flash(error, type="danger") 227 return 228 if p_option: 229 payment.p_option = p_option 230 payment.p_currency = p_option 231 self.context[payment.p_id] = payment 232 self.flash(_('Payment ticket created.')) 233 self.context.writeLogMessage(self,'added: %s' % payment.p_id) 234 self.redirect(self.url(payment)) 235 return 236 237 @action(_('Cancel'), validator=NullValidator) 238 def cancel(self, **data): 239 self.redirect(self.url(self.context)) 240 216 241 class CustomApplicantBaseDisplayFormPage(ApplicantBaseDisplayFormPage): 217 242
Note: See TracChangeset for help on using the changeset viewer.