Ignore:
Timestamp:
10 Jul 2022, 11:47:16 (2 years ago)
Author:
Henrik Bettermann
Message:

Disable applicant balance payments in base package completely.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r17017 r17018  
    10671067    manage_applications = True
    10681068    pnav = 3
    1069     display_actions = [[_('Save'), _('Finally Submit')],
    1070         [_('Add online payment ticket'),
    1071          _('Add balance payment ticket'),
    1072          _('Remove selected tickets')]]
     1069   
     1070    @property
     1071    def display_actions(self):
     1072        actions = [[_('Save'), _('Finally Submit')],
     1073                   [_('Add online payment ticket'),
     1074                    _('Add balance payment ticket'),
     1075                    _('Remove selected tickets')]]
     1076        applicants_utils = getUtility(IApplicantsUtils)
     1077        if self.context.state not in applicants_utils.BALANCE_PAYMENT_STATES:
     1078            actions[1].pop(1)
     1079        return actions
    10731080
    10741081    @property
     
    12881295    submit_state = PAID
    12891296    mandate_days = 31
    1290     balance_payments_states = ()  # not used in base packe
    12911297
    12921298    @property
     
    13271333            actions = [[_('Save'), _('Finally Submit')],
    13281334                [_('Remove selected tickets')]]
    1329         if self.context.state in self.balance_payments_states:
     1335        applicants_utils = getUtility(IApplicantsUtils)
     1336        if self.context.state in applicants_utils.BALANCE_PAYMENT_STATES:
    13301337            actions[1].append(_('Add balance payment ticket'))
    13311338        return actions
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r17016 r17018  
    10861086        return
    10871087
    1088     def test_pay_balance(self):
     1088    # It was only enabled during implementation of balance payments
     1089    def disabled_test_pay_balance(self):
    10891090        # Managers can make balance payment
    10901091        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r17016 r17018  
    5555    #: over to the students section.
    5656    ADDITIONAL_FILES = (('Test File','testfile'),)
     57   
     58    # A list of states which enable balance payments (not used in base package)
     59    BALANCE_PAYMENT_STATES = ()
    5760
    5861    def setPaymentDetails(self, container, payment, applicant):
     
    9396        as selected by the applicant.
    9497        """
    95         if applicant.state not in (PAID, ADMITTED, SUBMITTED, PROCESSED):
     98        if applicant.state not in self.BALANCE_PAYMENT_STATES:
    9699            return _('Wrong state.'), None
    97100        p_item = u'Balance'
Note: See TracChangeset for help on using the changeset viewer.