Ignore:
Timestamp:
8 Apr 2016, 05:26:51 (9 years ago)
Author:
Henrik Bettermann
Message:

Determine total registration fee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py

    r13815 r13816  
    1919"""
    2020
     21import grok
     22from time import time
    2123from kofacustom.nigeria.applicants.utils import NigeriaApplicantsUtils
    2224from waeup.kofa.applicants.workflow import (INITIALIZED,
    2325    STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED)
     26from waeup.uniben.applicants.interfaces import REGISTRATION_CATS
    2427from waeup.uniben.interfaces import MessageFactory as _
    25 
    26 
    2728
    2829class CustomApplicantsUtils(NigeriaApplicantsUtils):
     
    9091                fee_name = applicant.special_application + '_fee'
    9192                payment.amount_auth = getattr(session_config, fee_name, None)
    92                 if payment.amount_auth in (0.0, None):
    93                     return _('Amount could not be determined.')
    9493                payment.p_category = applicant.special_application
    9594            return
    96         payment.p_category = 'application'
    97         container_fee = container.application_fee
    98         if container_fee:
    99             payment.amount_auth = container_fee
    100             return
    101         payment.amount_auth = session_config.application_fee
     95        elif applicant.__parent__.prefix == 'ictwk':
     96            payment.p_category = 'registration'
     97            for cat in applicant.registration_cats:
     98                payment.amount_auth += REGISTRATION_CATS[cat][1]
     99        else:
     100            payment.p_category = 'application'
     101            container_fee = container.application_fee
     102            if container_fee:
     103                payment.amount_auth = container_fee
     104                return
     105            payment.amount_auth = session_config.application_fee
    102106        if payment.amount_auth in (0.0, None):
    103107            return _('Amount could not be determined.')
    104108        return
    105 
Note: See TracChangeset for help on using the changeset viewer.