Changeset 14940


Ignore:
Timestamp:
18 Jan 2018, 08:56:55 (7 years ago)
Author:
Henrik Bettermann
Message:

SPAT (pt) students do not pay dep_sug fee.

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

Legend:

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

    r14938 r14940  
    207207            xmldict['amt4'] = 100 * 500
    208208
    209             if student.faccode == 'SPAT':
    210                 xmltext = """<payment_item_detail>
    211 <item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    212 <item_detail item_id="1" item_name="Students Welfare" item_amt="%(amt2)d" bank_id="11" acct_num="0037892949" />
    213 <item_detail item_id="2" item_name="Anti-Cult Book" item_amt="%(amt3)d" bank_id="11" acct_num="0037892949" />
    214 </item_details>
    215 </payment_item_detail>""" % xmldict
    216             else:
    217                 xmltext = """<payment_item_detail>
     209            xmltext = """<payment_item_detail>
    218210<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
    219211<item_detail item_id="1" item_name="SUG" item_amt="%(amt1)d" bank_id="11" acct_num="0038079930" />
     
    223215</item_details>
    224216</payment_item_detail>""" % xmldict
     217
     218#            if student.faccode == 'SPAT':
     219#                xmltext = """<payment_item_detail>
     220#<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     221#<item_detail item_id="1" item_name="Students Welfare" item_amt="%(amt2)d" bank_id="11" acct_num="0037892949" />
     222#<item_detail item_id="2" item_name="Anti-Cult Book" item_amt="%(amt3)d" bank_id="11" acct_num="0037892949" />
     223#</item_details>
     224#</payment_item_detail>""" % xmldict
     225
    225226        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
    226227        self.context.provider_amt = provider_amt
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py

    r14938 r14940  
    172172        self.certificate.study_mode = 'nd_ft'
    173173        self.certificate.school_fee_3 = 30000.0
    174         # Add dep_sug ticket
     174        # dep_sug tickets cannot be created
    175175        self.browser.open(self.payments_path + '/addop')
    176176        self.browser.getControl(name="form.p_category").value = ['dep_sug']
    177177        self.browser.getControl("Create ticket").click()
     178        self.assertTrue('Amount could not be determined' in self.browser.contents)
     179        #self.assertTrue('ticket created' in self.browser.contents)
     180        #ctrl = self.browser.getControl(name='val_id')
     181        #dep_sug_pid = ctrl.options[0]
     182        #self.assertTrue(self.student['payments'][dep_sug_pid].amount_auth == 1650)
     183        #self.browser.getLink(dep_sug_pid).click()
     184        #self.browser.getLink("CollegePAY", index=0).click()
     185        #self.student['payments'][dep_sug_pid].p_state = 'paid'
     186        #self.assertTrue(
     187        #    '<item_detail item_id="1" item_name="Students Welfare" '
     188        #    'item_amt="50000" bank_id="11" acct_num="0037892949" />'
     189        #    in self.browser.contents)
     190        # Add school fee ticket
     191        self.browser.open(self.payments_path + '/addop')
     192        self.browser.getControl(name="form.p_category").value = ['schoolfee']
     193        self.browser.getControl("Create ticket").click()
    178194        self.assertMatches('...ticket created...', self.browser.contents)
    179195        ctrl = self.browser.getControl(name='val_id')
    180         dep_sug_pid = ctrl.options[0]
    181         self.assertTrue(self.student['payments'][dep_sug_pid].amount_auth == 1650)
    182        
    183         self.browser.getLink(dep_sug_pid).click()
    184         self.browser.getLink("CollegePAY", index=0).click()
    185         self.student['payments'][dep_sug_pid].p_state = 'paid'
    186         self.assertTrue(
    187             '<item_detail item_id="1" item_name="Students Welfare" '
    188             'item_amt="50000" bank_id="11" acct_num="0037892949" />'
    189             in self.browser.contents)
    190         # Add school fee ticket
    191         self.browser.open(self.payments_path + '/addop')
    192         self.browser.getControl(name="form.p_category").value = ['schoolfee']
    193         self.browser.getControl("Create ticket").click()
    194         self.assertMatches('...ticket created...', self.browser.contents)
    195         ctrl = self.browser.getControl(name='val_id')
    196         self.value = ctrl.options[1]
     196        self.value = ctrl.options[0]
    197197        self.browser.getLink(self.value).click()
    198198        self.assertTrue('<span>30000.0</span>'  in self.browser.contents)
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py

    r14938 r14940  
    9898                # Students are only allowed to pay school fee
    9999                # if current session dep_sug payment has been made.
    100                 if not self._dep_sug_paymentMade(student,
    101                     student.current_session):
     100                if student.faccode != 'SPAT' and not self._dep_sug_paymentMade(
     101                    student, student.current_session):
    102102                    return _('You have to pay NADESU/SA/SUG Dues first.'), None
    103103                if student.state == CLEARED:
     
    180180            amount = 3150.0 # includes GATEWAY_AMT
    181181            if student.faccode == 'SPAT':
    182                 amount = 1650.0 # includes GATEWAY_AMT
     182            #    amount = 1650.0 # includes GATEWAY_AMT
     183                amount = 0.0
    183184        else:
    184185            fee_name = category + '_fee'
Note: See TracChangeset for help on using the changeset viewer.