Changeset 17023


Ignore:
Timestamp:
13 Jul 2022, 06:17:23 (2 years ago)
Author:
Henrik Bettermann
Message:

Disable membership fee payments.

Location:
main/kofacustom.lpng/trunk/src/kofacustom/lpng
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py

    r17020 r17023  
    2121from zope.formlib.textwidgets import BytesDisplayWidget
    2222from zope.component import getUtility
     23from hurry.workflow.interfaces import IWorkflowState
    2324from waeup.kofa.widgets.datewidget import (
    2425    FriendlyDateDisplayWidget,
     
    3334    ExportPDFPaymentSlipPage,
    3435    ApplicantBaseDisplayFormPage)
     36from waeup.kofa.applicants.workflow import (
     37    INITIALIZED, STARTED, PAID, SUBMITTED,
     38    ADMITTED, NOT_ADMITTED, CREATED, PROCESSED)
    3539from waeup.kofa.students.interfaces import IStudentsUtils
    36 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment
     40from waeup.kofa.applicants.interfaces import (
     41    IApplicantOnlinePayment, IApplicantsUtils)
    3742from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment
    3843from kofacustom.nigeria.applicants.browser import NigeriaExportPDFPaymentSlipPage
     
    7277
    7378    @property
     79    def display_actions(self):
     80        actions = [[_('Save'), _('Finally Submit')],
     81                   [
     82                    #_('Add online payment ticket'),
     83                    _('Add balance payment ticket'),
     84                    _('Remove selected tickets')
     85                   ]]
     86        applicants_utils = getUtility(IApplicantsUtils)
     87        if self.context.state not in applicants_utils.BALANCE_PAYMENT_STATES:
     88            actions[1].pop(1)
     89        return actions
     90
     91    @property
    7492    def form_fields(self):
    7593        form_fields = grok.AutoFields(ICustomApplicant)
     
    85103    def unremovable(self, ticket):
    86104        return True
     105
     106    @property
     107    def display_actions(self):
     108        state = IWorkflowState(self.context).getState()
     109        actions = [[_('Save')],
     110                   [
     111                    #_('Remove selected tickets')
     112                   ]]
     113        if state == STARTED:
     114            actions = [[_('Save')],
     115                [
     116                 #_('Add online payment ticket'),
     117                 #_('Remove selected tickets')
     118                ]]
     119        elif self.context.special and state == PAID:
     120            actions = [[_('Save'), _('Finally Submit')],
     121                [
     122                 #_('Add online payment ticket'),
     123                 #_('Remove selected tickets')
     124                ]]
     125        elif state == PAID:
     126            actions = [[_('Save'), _('Finally Submit')],
     127                [
     128                 #_('Remove selected tickets')
     129                ]]
     130        applicants_utils = getUtility(IApplicantsUtils)
     131        if self.context.state in applicants_utils.BALANCE_PAYMENT_STATES:
     132            actions[1].append(_('Add balance payment ticket'))
     133        return actions
    87134
    88135    @property
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/interswitch/tests.py

    r17013 r17023  
    235235
    236236
    237     def test_interswitch_form(self):
     237    def disabled_test_interswitch_form(self):
    238238        # Manager can access InterswitchForm
    239239        self.browser.getLink("Pay via Interswitch", index=0).click()
Note: See TracChangeset for help on using the changeset viewer.