- Timestamp:
- 10 Jul 2022, 08:40:43 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r16976 r17016 41 41 IApplicantOnlinePayment, IApplicantsUtils, 42 42 IApplicantRegisterUpdate, ISpecialApplicant, 43 IApplicantRefereeReport 43 IApplicantRefereeReport, 44 IApplicantBalancePayment 44 45 ) 45 46 from waeup.kofa.utils.helpers import (html2dict, … … 831 832 def render(self): 832 833 return 834 835 class BalancePaymentAddFormPage(KofaAddFormPage): 836 """ Page to add an online payment which can balance s previous session 837 payment. 838 """ 839 grok.context(IApplicant) 840 grok.name('addbp') 841 grok.template('balancepaymentaddform') 842 grok.require('waeup.manageApplication') 843 form_fields = grok.AutoFields(IApplicantBalancePayment) 844 label = _('Add balance') 845 #pnav = 4 846 847 @property 848 def selectable_payment_options(self): 849 options = getUtility( 850 IKofaUtils).selectable_payment_options(self.context) 851 return sorted(options.items(), key=lambda value: value[1]) 852 853 @action(_('Create ticket'), style='primary') 854 def createTicket(self, **data): 855 p_category = data['p_category'] 856 p_option = data.get('p_option', None) 857 balance_amount = data.get('balance_amount', None) 858 applicants_utils = getUtility(IApplicantsUtils) 859 error, payment = applicants_utils.setBalanceDetails( 860 self.context, p_category, balance_amount) 861 if error is not None: 862 self.flash(error, type="danger") 863 return 864 if p_option: 865 payment.p_option = p_option 866 self.context[payment.p_id] = payment 867 self.flash(_('Payment ticket created.')) 868 self.context.writeLogMessage(self,'added: %s' % payment.p_id) 869 self.redirect(self.url(payment)) 870 return 871 872 @action(_('Cancel'), validator=NullValidator) 873 def cancel(self, **data): 874 self.redirect(self.url(self.context)) 833 875 834 876
Note: See TracChangeset for help on using the changeset viewer.