Ignore:
Timestamp:
1 Sep 2012, 15:16:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Configure school fees. In FCEOkene we can't setup school fees in certificates.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/browser/pages.py

    r8460 r9143  
    1818import grok
    1919from waeup.kofa.browser.pages import (
    20     SessionConfigurationAddFormPage, SessionConfigurationManageFormPage)
     20    SessionConfigurationAddFormPage, SessionConfigurationManageFormPage,
     21    CertificatePage, CertificateManageFormPage)
     22from waeup.kofa.university.interfaces import ICertificate
    2123from waeup.fceokene.interfaces import (
    2224    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
     
    3133    """
    3234    form_fields = grok.AutoFields(ICustomSessionConfiguration)
     35
     36class CustomCertificatePage(CertificatePage):
     37    """Index page for certificates.
     38    """
     39    form_fields = grok.AutoFields(ICertificate).omit(
     40        'school_fee_1', 'school_fee_2', 'school_fee_3', 'school_fee_4')
     41
     42class CustomCertificateManageFormPage(CertificateManageFormPage):
     43    """Manage the properties of a `Certificate` instance.
     44    """
     45    form_fields = grok.AutoFields(ICertificate).omit(
     46        'school_fee_1', 'school_fee_2', 'school_fee_3', 'school_fee_4')
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py

    r8834 r9143  
    4545
    4646    clearance_fee = schema.Float(
    47         title = _(u'Clearance Fee (ignored)'),
     47        title = _(u'Clearance Fee'),
    4848        default = 0.0,
    4949        required = False,
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py

    r9129 r9143  
    5959                           self.browser.contents)
    6060        self.assertMatches(
    61             '...<span>40000.0</span>...',
     61            '...<span>12495.0</span>...',
    6262            self.browser.contents)
    6363        self.payment_url = self.browser.url
     
    8282                           self.browser.contents)
    8383        self.assertMatches(
    84             '...<input type="hidden" name="amount" value="4000000.0" />...',
     84            '...<input type="hidden" name="amount" value="1249500.0" />...',
    8585            self.browser.contents)
    8686        self.assertMatches(
    87             '...item_name="schoolfee" item_amt="3795000" bank_id="117" acct_num="6216801033"...',
     87            '...item_name="schoolfee" item_amt="1044500" bank_id="117" acct_num="6216801033"...',
    8888            self.browser.contents)
    8989        self.assertMatches(
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r8908 r9143  
    7474        self.app['configuration']['2004'].gown_fee = 150.0
    7575        self.app['configuration']['2004'].transfer_fee = 90.0
    76         #self.app['configuration']['2004'].clearance_fee = 120.0
     76        self.app['configuration']['2004'].clearance_fee = 120.0
    7777        self.app['configuration']['2004'].booking_fee = 150.0
    7878        self.app['configuration']['2004'].maint_fee = 180.0
     
    186186        self.app['configuration']['2004'].booking_fee = 150.0
    187187        self.app['configuration']['2004'].maint_fee = 180.0
     188        self.app['configuration']['2004'].clearance_fee = 120.0
    188189        utils = getUtility(IStudentsUtils)
    189190
     
    196197        self.assertEqual(payment.p_level, 100)
    197198        self.assertEqual(payment.p_session, 2004)
    198         self.assertEqual(payment.amount_auth, 40000.0)
     199        self.assertEqual(payment.amount_auth, 12495.0)
    199200        self.assertEqual(payment.p_item, u'CERT1')
    200201        self.assertEqual(error, None)
     
    202203        IWorkflowState(self.student).setState('returning')
    203204        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    204         self.assertEqual(payment.p_level, 200)
    205         self.assertEqual(payment.p_session, 2005)
    206         self.assertEqual(payment.amount_auth, 20000.0)
     205        self.assertEqual(payment.p_level, 100)
     206        self.assertEqual(payment.p_session, 2004)
     207        self.assertEqual(payment.amount_auth, 11545.0)
    207208        self.assertEqual(payment.p_item, u'CERT1')
    208209        self.assertEqual(error, None)
     
    211212        self.assertEqual(payment.p_level, 100)
    212213        self.assertEqual(payment.p_session, 2004)
    213         self.assertEqual(payment.amount_auth, 34250.0)
     214        self.assertEqual(payment.amount_auth, 120.0)
    214215        self.assertEqual(payment.p_item, u'CERT1')
    215216        self.assertEqual(error, None)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r8953 r9143  
    2222from kofacustom.nigeria.students.utils import NigeriaStudentsUtils
    2323from waeup.kofa.accesscodes import create_accesscode
     24from waeup.kofa.interfaces import CLEARED, RETURNING
    2425from waeup.fceokene.interfaces import MessageFactory as _
    2526
     
    7374            amount = academic_session.maint_fee
    7475        elif category == 'clearance':
     76            amount = academic_session.clearance_fee
    7577            try:
    7678                p_item = student['studycourse'].certificate.code
    7779            except (AttributeError, TypeError):
    7880                return _('Study course data are incomplete.'), None
    79             if p_item in ('BEDCET', 'BIOEDCET', 'CHMEDCET', 'ISEDCET',
    80                 'MTHEDCET', 'PHYEDCET', 'ITECET', 'AGREDCET', 'HEEDCET'):
    81                 amount = 17250.0
    82             else:
    83                 amount = 34250.0
    8481        elif category == 'schoolfee':
    8582            try:
     
    8885            except (AttributeError, TypeError):
    8986                return _('Study course data are incomplete.'), None
    90             if student.state == CLEARED:
    91                 amount = getattr(certificate, 'school_fee_1', 0.0)
    92             elif student.state == RETURNING:
    93                 # In case of returning school fee payment the payment session
    94                 # and level contain the values of the session the student
    95                 # has paid for.
    96                 p_session, p_level = self.getReturningData(student)
    97                 amount = getattr(certificate, 'school_fee_2', 0.0)
    98             elif student.is_postgrad and student.state == PAID:
    99                 # Returning postgraduate students also pay for the next session
    100                 # but their level always remains the same.
    101                 p_session += 1
    102                 amount = getattr(certificate, 'school_fee_2', 0.0)
     87
     88            # Very special school fee configuration, should be moved to
     89            # a seperate file.
     90
     91            ARTS = ('CRS','ISS','HIS','MUS','ECO','GEO','POL','SOS','CCA','ECU',
     92                    'THA','GED','GSE','PES','SPC','ENG','FRE','ARB','HAU','IGB',
     93                    'YOR','NCRS','NISS','NHIS','NMUS','NECO','NGEO','NPOL',
     94                    'NCCA','NECU','NTHA','NGED','NGSE','NPES','NSPC','NENG',
     95                    'NFRE','NARB','NHAU','NIGB','NYOR','NSOS')
     96
     97            #PDE Students
     98            if student.current_mode == 'pd_ft':
     99                amount = 35000
     100            elif not student.current_mode.endswith('_sw'):
     101                # PRENCE
     102                if student.current_level == 10 and student.state == CLEARED:
     103                    if student.depcode in ARTS:
     104                        amount = 14900
     105                    else:
     106                        amount = 15400
     107                # NCE I fresh
     108                elif student.current_level == 100 and student.state == CLEARED:
     109                    if student.depcode in ARTS:
     110                        amount = 12020
     111                    else:
     112                        amount = 12495
     113                # NCE II
     114                elif student.current_level in (100, 110, 120) and \
     115                    student.state == RETURNING:
     116                    if student.depcode in ARTS:
     117                        amount = 11070
     118                    else:
     119                        amount = 11545
     120                # NCE III
     121                elif student.current_level in (200, 210, 220):
     122                    if student.depcode in ARTS:
     123                        amount = 11070
     124                    else:
     125                        amount = 11545
     126                # NCE III repeater
     127                elif student.current_level in (300, 310, 320) and \
     128                    student.current_verdict == 'O':
     129                    if student.depcode in ARTS:
     130                        amount = 6535
     131                    else:
     132                        amount = 6773
     133                # NCE III spillover
     134                elif student.current_level in (300, 310, 320) and \
     135                    student.current_verdict == 'B':
     136                    if student.depcode in ARTS:
     137                        amount = 9170
     138                    else:
     139                        amount = 9645
     140                # NCE III second spillover
     141                elif student.current_level in (400, 410, 420) and \
     142                    student.current_verdict == 'B':
     143                    if student.depcode in ARTS:
     144                        amount = 9170
     145                    else:
     146                        amount = 9645
     147            else:
     148                if student.current_level == 100 and student.state == CLEARED:
     149                    if student.depcode in ARTS:
     150                        amount = 21900
     151                    else:
     152                        amount = 22400
     153                # NCE II
     154                elif student.current_level in (100, 110, 120) and \
     155                    student.state == RETURNING:
     156                    if student.depcode in ARTS:
     157                        amount = 18400
     158                    else:
     159                        amount = 18900
     160                # NCE III
     161                elif student.current_level in (200, 210, 220):
     162                    if student.depcode in ARTS:
     163                        amount = 20400
     164                    else:
     165                        amount = 20900
     166                # NCE IV
     167                elif student.current_level in (300, 310, 320):
     168                    if student.depcode in ARTS:
     169                        amount = 18400
     170                    else:
     171                        amount = 18900
     172                # NCE V
     173                elif student.current_level in (400, 410, 420):
     174                    if student.depcode in ARTS:
     175                        amount = 18400
     176                    else:
     177                        amount = 18900
     178                # NCE V spillover
     179                elif student.current_level in (500, 510, 520) and \
     180                    student.current_verdict == 'B':
     181                    if student.depcode in ARTS:
     182                        amount = 16900
     183                    else:
     184                        amount = 17400
     185                # NCE V second spillover
     186                elif student.current_level in (600, 610, 620) and \
     187                    student.current_verdict == 'B':
     188                    if student.depcode in ARTS:
     189                        amount = 16900
     190                    else:
     191                        amount = 17400
     192
    103193        if amount in (0.0, None):
    104194            return _(u'Amount could not be determined.'), None
     
    117207        payment.p_session = p_session
    118208        payment.p_level = p_level
    119         payment.amount_auth = amount
     209        payment.amount_auth = float(amount)
    120210        return None, payment
    121211
Note: See TracChangeset for help on using the changeset viewer.