Ignore:
Timestamp:
7 Dec 2017, 16:58:30 (7 years ago)
Author:
Henrik Bettermann
Message:

Implement "Departmental and SUG dues" payment (not yet required).

Catch traceback when transferring students.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/browser.py

    r14889 r14921  
    196196</payment_item_detail>""" % xmldict
    197197
     198        # dep_sug payments are treated completely separately. The following lines
     199        # override the configuration above.
     200        if self.context.p_category == 'dep_sug':
     201            self.pay_item_id = '102' # We use school fee item id
     202            # amount_auth is being ignored. However, the sum of all split payments
     203            # must coincide with the amount_auth configured in students/utils.py
     204            xmldict['amt1'] = 100 * (1000 - GATEWAY_AMT)
     205            xmldict['amt2'] = 100 * 500
     206            xmldict['amt3'] = 100 * 900
     207            xmldict['amt4'] = 100 * 500
     208            xmltext = """<payment_item_detail>
     209<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     210<item_detail item_id="1" item_name="SUG" item_amt="%(amt1)d" bank_id="11" acct_num="0038079930" />
     211<item_detail item_id="2" item_name="Students Welfare" item_amt="%(amt2)d" bank_id="11" acct_num="0037892949" />
     212<item_detail item_id="3" item_name="Anti-Cult Book" item_amt="%(amt3)d" bank_id="11" acct_num="0037892949" />
     213<item_detail item_id="4" item_name="NADESSTU " item_amt="%(amt4)d" bank_id="11" acct_num="0036375968" />
     214</item_details>
     215</payment_item_detail>""" % xmldict
     216
    198217        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    199218        self.context.provider_amt = provider_amt
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py

    r14889 r14921  
    182182            in self.browser.contents)
    183183
     184    def test_interswitch_form_dep_sug_payments(self):
     185        # Manager can access InterswitchForm
     186        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     187        self.browser.open(self.payments_path)
     188        IWorkflowState(self.student).setState('cleared')
     189        self.browser.open(self.payments_path + '/addop')
     190        self.browser.getControl(name="form.p_category").value = ['dep_sug']
     191        self.browser.getControl("Create ticket").click()
     192        self.assertMatches('...ticket created...', self.browser.contents)
     193        ctrl = self.browser.getControl(name='val_id')
     194        self.value = ctrl.options[0]
     195        self.browser.getLink(self.value).click()
     196        self.assertTrue('<span>2900.0</span>'  in self.browser.contents)
     197        self.payment_url = self.browser.url
     198        self.browser.getLink("CollegePAY", index=0).click()
     199        self.assertTrue('<item_detail item_id="1" item_name="SUG" item_amt="75000" bank_id="11" acct_num="0038079930" />'
     200            in self.browser.contents)
     201        self.assertTrue('<item_detail item_id="2" item_name="Students Welfare" item_amt="50000" bank_id="11" acct_num="0037892949" />'
     202            in self.browser.contents)
     203        self.assertTrue('<item_detail item_id="3" item_name="Anti-Cult Book" item_amt="90000" bank_id="11" acct_num="0037892949" />'
     204            in self.browser.contents)
     205        self.assertTrue('<item_detail item_id="4" item_name="NADESSTU " item_amt="50000" bank_id="11" acct_num="0036375968" />'
     206            in self.browser.contents)
     207
    184208    @external_test
    185209    def test_webservice(self):
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py

    r14919 r14921  
    163163        elif category == 'carryover4':
    164164            amount = 13000.0
     165        elif category == 'dep_sug':
     166            amount = 2900.0
    165167        else:
    166168            fee_name = category + '_fee'
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/utils/utils.py

    r14903 r14921  
    3838
    3939    STUDY_MODES_DICT = {
     40        'transfer': 'Transfer',
    4041        'ug_ft': 'Undergraduate Full Time',
    4142        'ug_pt': 'Undergraduate Part Time',
     
    5556        'clearance': 'Acceptance',
    5657        'schoolfee': 'School Fee',
     58        'dep_sug':'Departmental and SUG Dues', # is not a special paynent
    5759        'carryover1': '1, 2 or 3 Carry-Over Courses',
    5860        'carryover4': '4 Carry-Over Courses',
     
    108110        'clearance': 'Acceptance',
    109111        'schoolfee': 'School Fee',
     112        'dep_sug':'Departmental and SUG Dues',
    110113        #'carryover1': 'One Carry-Over',
    111114        #'carryover2': 'Two Carry-Overs',
Note: See TracChangeset for help on using the changeset viewer.