Ignore:
Timestamp:
11 Dec 2013, 15:56:06 (11 years ago)
Author:
Henrik Bettermann
Message:

Implement special application for supplementary payments.

Location:
main/waeup.kwarapoly/trunk/src/waeup/kwarapoly
Files:
7 edited

Legend:

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

    r10643 r10844  
    2323from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    2424from zope.formlib.textwidgets import BytesDisplayWidget
     25from waeup.kofa.applicants.interfaces import IApplicant, IApplicantEdit
    2526from waeup.kofa.applicants.browser import (ApplicantDisplayFormPage,
    2627    ApplicantManageFormPage, ApplicantEditFormPage,
     
    7273    @property
    7374    def form_fields(self):
     75        if self.context.special:
     76            form_fields = grok.AutoFields(IApplicant).select(
     77                'applicant_id', 'firstname', 'middlename', 'lastname',
     78                'reg_number', 'date_of_birth', 'email', 'special_application')
     79            return form_fields
    7480        form_fields = grok.AutoFields(ICustomUGApplicant)
    7581        if self.context.is_nd:
     
    123129    @property
    124130    def form_fields(self):
     131        if self.context.special:
     132            form_fields = grok.AutoFields(IApplicant).select(
     133                'applicant_id', 'firstname', 'middlename', 'lastname',
     134                'reg_number', 'date_of_birth', 'email', 'special_application',
     135                'locked')
     136            return form_fields
    125137        form_fields = grok.AutoFields(ICustomUGApplicant)
    126138        if self.context.is_nd:
     
    140152    @property
    141153    def form_fields(self):
     154
     155        if self.context.special:
     156            form_fields = grok.AutoFields(IApplicantEdit).select(
     157                'applicant_id', 'firstname', 'middlename', 'lastname',
     158                'reg_number', 'date_of_birth', 'email', 'special_application')
     159            return form_fields
    142160        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    143161        if self.context.is_nd:
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants/interfaces.py

    r10640 r10844  
    5050    'hq_type')
    5151ND_OMIT_PDF_FIELDS = ND_OMIT_DISPLAY_FIELDS + ('phone',)
    52 ND_OMIT_MANAGE_FIELDS = ()
     52ND_OMIT_MANAGE_FIELDS = ('special_application',)
    5353ND_OMIT_EDIT_FIELDS = ND_OMIT_MANAGE_FIELDS + ND_OMIT_DISPLAY_FIELDS + (
    5454    'student_id', 'notice',
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants/utils.py

    r10623 r10844  
    4949        'prendpt': ['Pre-Admission Screening: ND Part-Time Forms', 'NDPT'],
    5050        'prejambites': ['Pre-Admission Screening: JAMBITES', 'JMB'],
     51        'special': ['Supplementary Payment', 'SP'],
    5152        }
    5253
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interfaces.py

    r10734 r10844  
    9797        )
    9898    ver_result_fee = schema.Float(
    99         title = _(u'erification of Result Fee'),
     99        title = _(u'Verification of Result Fee'),
    100100        default = 0.0,
    101101        required = False,
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/browser.py

    r10736 r10844  
    330330            provider_amt = 0.0
    331331            dalash_amt = 0.0
     332        elif self.applicant.applicant_id.startswith('special'):
     333            if self.applicant.special_application == 'certificate':
     334                self.pay_item_id = '111'
     335                xmldict['institution_acct'] = "0131959715"
     336                xmldict['institution_bank_id'] = '10'
     337            elif self.applicant.special_application == 'state_result':
     338                self.pay_item_id = '112'
     339                xmldict['institution_acct'] = "0131959715"
     340                xmldict['institution_bank_id'] = '10'
     341            elif self.applicant.special_application == 'transcript_local':
     342                self.pay_item_id = '113'
     343                xmldict['institution_acct'] = "0131959715"
     344                xmldict['institution_bank_id'] = '10'
     345            elif self.applicant.special_application == 'transcript_foreign':
     346                self.pay_item_id = '114'
     347                xmldict['institution_acct'] = "0131959715"
     348                xmldict['institution_bank_id'] = '10'
     349            elif self.applicant.special_application == 'ver_result':
     350                self.pay_item_id = '115'
     351                xmldict['institution_acct'] = "0131959715"
     352                xmldict['institution_bank_id'] = '10'
     353            elif self.applicant.special_application == 'change_course':
     354                self.pay_item_id = '116'
     355                xmldict['institution_acct'] = "0131959715"
     356                xmldict['institution_bank_id'] = '10'
     357            elif self.applicant.special_application == 'change_inst':
     358                self.pay_item_id = '117'
     359                xmldict['institution_acct'] = "0131959715"
     360                xmldict['institution_bank_id'] = '10'
     361            elif self.applicant.special_application == 'jamb_reject':
     362                self.pay_item_id = '118'
     363                xmldict['institution_acct'] = "0131959715"
     364                xmldict['institution_bank_id'] = '10'
     365            elif self.applicant.special_application == 'cert_of_cert':
     366                self.pay_item_id = '119'
     367                xmldict['institution_acct'] = "0131959715"
     368                xmldict['institution_bank_id'] = '10'
     369            elif self.applicant.special_application == 'ref_let':
     370                self.pay_item_id = '120'
     371                xmldict['institution_acct'] = "0131959715"
     372                xmldict['institution_bank_id'] = '10'
     373            elif self.applicant.special_application == 'proc_cert':
     374                self.pay_item_id = '121'
     375                xmldict['institution_acct'] = "0131959715"
     376                xmldict['institution_bank_id'] = '10'
     377            elif self.applicant.special_application == 'loss_idcard':
     378                self.pay_item_id = '122'
     379                xmldict['institution_acct'] = "0131959715"
     380                xmldict['institution_bank_id'] = '10'
     381                dalash_amt = 6.0
     382                xmldict['dalash_amt'] = 100 * dalash_amt
     383                provider_amt = 9.0
     384                gateway_amt = 15.0
     385            elif self.applicant.special_application == 'loss_examcard':
     386                self.pay_item_id = '123'
     387                xmldict['institution_acct'] = "0131959715"
     388                xmldict['institution_bank_id'] = '10'
     389                dalash_amt = 3.0
     390                xmldict['dalash_amt'] = 100 * dalash_amt
     391                provider_amt = 4.5
     392                gateway_amt = 7.5
     393            elif self.applicant.special_application == 'loss_result':
     394                self.pay_item_id = '124'
     395                xmldict['institution_acct'] = "0131959715"
     396                xmldict['institution_bank_id'] = '10'
     397            elif self.applicant.special_application == 'loss_receipt':
     398                self.pay_item_id = '125'
     399                xmldict['institution_acct'] = "0131959715"
     400                xmldict['institution_bank_id'] = '10'
     401            elif self.applicant.special_application == 'loss_clearance':
     402                self.pay_item_id = '126'
     403                xmldict['institution_acct'] = "0131959715"
     404                xmldict['institution_bank_id'] = '10'
     405            elif self.applicant.special_application == 'conv_brochure':
     406                self.pay_item_id = '127'
     407                xmldict['institution_acct'] = "0131959715"
     408                xmldict['institution_bank_id'] = '10'
     409            else:
     410                xmldict['institution_acct'] = '00000000000'
     411                xmldict['institution_bank_id'] = '00'
    332412        else:
    333413            xmldict['institution_acct'] = '00000000000'
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/interswitch/tests.py

    r10837 r10844  
    1818import os
    1919import grok
    20 from datetime import datetime
     20import pytz
     21from datetime import datetime, date, timedelta
    2122from hurry.workflow.interfaces import IWorkflowState
    2223from zope.component import createObject, getUtility
    2324from zope.catalog.interfaces import ICatalog
    2425from zope.event import notify
     26from waeup.kofa.applicants.container import ApplicantsContainer
    2527from waeup.kofa.university.faculty import Faculty
    2628from waeup.kofa.university.department import Department
     
    446448        configuration.academic_session = datetime.now().year - 2
    447449        self.app['configuration'].addSessionConfiguration(configuration)
     450        self.configuration = configuration
    448451        # Create at least one Kwarapoly faculty
    449452        self.app['faculties']['CPGS'] = Faculty(code='CPGS')
     
    547550        self.assertFalse('Dalash' in self.browser.contents)
    548551        self.assertFalse('BT Education' in self.browser.contents)
     552
     553
     554    def prepare_special_container(self):
     555        # Add special application container
     556        container_name = u'special%s' % (datetime.now().year - 2)
     557        applicantscontainer = ApplicantsContainer()
     558        applicantscontainer.code = container_name
     559        applicantscontainer.prefix = 'special'
     560        applicantscontainer.year = datetime.now().year - 2
     561        applicantscontainer.title = u'This is a special app container'
     562        applicantscontainer.application_category = 'no'
     563        applicantscontainer.mode = 'create'
     564        delta = timedelta(days=10)
     565        applicantscontainer.startdate = datetime.now(pytz.utc) - delta
     566        applicantscontainer.enddate = datetime.now(pytz.utc) + delta
     567        applicantscontainer.strict_deadline = True
     568        self.app['applicants'][container_name] = applicantscontainer
     569        # Add an applicant
     570        applicant = createObject('waeup.Applicant')
     571        # reg_number is the only field which has to be preset here
     572        # because managers are allowed to edit this required field
     573        applicant.reg_number = u'12345'
     574        applicant.firstname = u'Vorname'
     575        applicant.lastname = u'Nachname'
     576        applicant.special_application = u'transcript_local'
     577        applicant.applicant_id = u'special_anything'
     578        self.app['applicants'][container_name].addApplicant(applicant)
     579        self.special_applicant = applicant
     580        self.configuration.transcript_local_fee = 5300.0
     581        self.special_manage_path = 'http://localhost/app/applicants/%s/%s/%s' % (
     582            container_name, applicant.application_number, 'manage')
     583
     584    def test_interswitch_form_special(self):
     585        self.prepare_special_container()
     586        self.browser.open(self.special_manage_path)
     587        self.browser.getControl("Add online").click()
     588        self.assertMatches('...ticket created...',
     589                           self.browser.contents)
     590        self.browser.getLink("CollegePAY", index=0).click()
     591        self.assertTrue(
     592            '<item_detail item_id="1" item_name="transcript_local" '
     593            'item_amt="450000" bank_id="10" acct_num="0131959715" />'
     594            in self.browser.contents)
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py

    r10820 r10844  
    3535        'pgd': 'Postgraduate Diploma Programmes',
    3636        'rmd': 'Remedial Programmes',
     37        'no': 'no application',
    3738        }
    3839
     
    107108        'itch': 'ITCH Hostel'
    108109        }
     110
     111    SPECIAL_APP_DICT = {
     112        'certificate': 'Certificate Payment',
     113        'state_result': 'Statement of Result Payment',
     114        'transcript_local': 'Transcript (local) Payment',
     115        'transcript_foreign': 'Transcript (foreign) Payment',
     116        'ver_result': 'Verification of Result Payment',
     117        'change_course': 'Change of Course Payment',
     118        'change_inst': 'Change of Institute Payment',
     119        'jamb_reject': 'JAMB Rejection Form Payment',
     120        'cert_of_cert': 'Certification of Certificate Payment',
     121        'ref_let': 'Recommendation/Reference Letter Payment',
     122        'proc_cert': 'Processing of Certificate by Proxy Payment',
     123        'loss_idcard': 'Loss of ID Card Payment',
     124        'loss_examcard': 'Loss of Exam Card Payment',
     125        'loss_result': 'Loss of Result Payment',
     126        'loss_receipt': 'Loss of Receipt Payment',
     127        'loss_clearance': 'Loss of Clearance Payment',
     128        'conv_brochure': 'Convocation Brochure Payment',
     129        }
Note: See TracChangeset for help on using the changeset viewer.