Ignore:
Timestamp:
29 Nov 2018, 12:26:38 (6 years ago)
Author:
Henrik Bettermann
Message:

Add many new payment categories.

Location:
main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch
Files:
2 edited

Legend:

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

    r15248 r15255  
    251251</item_details>
    252252</payment_item_detail>""" % xmldict
    253         # dep_sug payments are treated completely separately. The following lines
     253
     254
     255        # Some payments are treated completely separately. The following lines
    254256        # override the configuration above.
     257
    255258        if self.context.p_category == 'dep_sug':
    256259            self.pay_item_id = '102' # We use school fee item id
     
    270273</item_details>
    271274</payment_item_detail>""" % xmldict
     275
     276        if self.context.p_category == 'eng_1':
     277            self.pay_item_id = '118'
     278            xmltext = """<payment_item_detail>
     279<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     280<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="8" acct_num="2024473077" />
     281</item_details>
     282</payment_item_detail>""" % xmldict
     283
     284        if self.context.p_category == 'eng_2':
     285            self.pay_item_id = '119'
     286            xmltext = """<payment_item_detail>
     287<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     288<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="8" acct_num="2024473077" />
     289</item_details>
     290</payment_item_detail>""" % xmldict
     291
     292        if self.context.p_category == 'sbs_1':
     293            self.pay_item_id = '120'
     294            # amount_auth is being ignored. However, the sum of all split payments
     295            # must coincide with the amount_auth configured in students/utils.py
     296            xmldict['amt1'] = 100 * 800
     297            xmldict['amt2'] = 100 * 1000
     298            xmldict['amt3'] = 100 * 500
     299
     300            xmltext = """<payment_item_detail>
     301<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     302<item_detail item_id="1" item_name="SBS Dues I" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" />
     303<item_detail item_id="2" item_name="Journal fee" item_amt="%(amt2)d" bank_id="11" acct_num="0010772626" />
     304<item_detail item_id="3" item_name="ABSOBS" item_amt="%(amt3)d" bank_id="8" acct_num="2008185712" />
     305</item_details>
     306</payment_item_detail>""" % xmldict
     307
     308        if self.context.p_category == 'sbs_2':
     309            self.pay_item_id = '123'
     310            # amount_auth is being ignored. However, the sum of all split payments
     311            # must coincide with the amount_auth configured in students/utils.py
     312            xmldict['amt1'] = 100 * 300
     313            xmldict['amt2'] = 100 * 500
     314            xmltext = """<payment_item_detail>
     315<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     316<item_detail item_id="1" item_name="SBS Dues II" item_amt="%(amt1)d" bank_id="11" acct_num="0010772626" />
     317<item_detail item_id="2" item_name="ABSOBS" item_amt="%(amt2)d" bank_id="8" acct_num="2008185712" />
     318</item_details>
     319</payment_item_detail>""" % xmldict
     320
     321        if self.context.p_category == 'bfn':
     322            self.pay_item_id = '125'
     323            xmltext = """<payment_item_detail>
     324<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     325<item_detail item_id="1" item_name="%(institution_item_name)s" item_amt="%(institution_amt)d" bank_id="11" acct_num="0048039049" />
     326</item_details>
     327</payment_item_detail>""" % xmldict
     328
     329        if self.context.p_category == 'mkt':
     330            self.pay_item_id = '127'
     331            # amount_auth is being ignored. However, the sum of all split payments
     332            # must coincide with the amount_auth configured in students/utils.py
     333            xmldict['amt1'] = 100 * 500
     334            xmldict['amt2'] = 100 * 500
     335            xmltext = """<payment_item_detail>
     336<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     337<item_detail item_id="1" item_name="MKT Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0048297823" />
     338<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2032309812" />
     339</item_details>
     340</payment_item_detail>""" % xmldict
     341
     342        if self.context.p_category == 'mcn':
     343            self.pay_item_id = '129'
     344            # amount_auth is being ignored. However, the sum of all split payments
     345            # must coincide with the amount_auth configured in students/utils.py
     346            xmldict['amt1'] = 100 * 500
     347            xmldict['amt2'] = 100 * 500
     348            xmltext = """<payment_item_detail>
     349<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     350<item_detail item_id="1" item_name="MCN Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010789213" />
     351<item_detail item_id="2" item_name="AMCOS" item_amt="%(amt2)d" bank_id="8" acct_num="3020253234" />
     352</item_details>
     353</payment_item_detail>""" % xmldict
     354
     355        if self.context.p_category == 'otm':
     356            self.pay_item_id = '131'
     357            # amount_auth is being ignored. However, the sum of all split payments
     358            # must coincide with the amount_auth configured in students/utils.py
     359            xmldict['amt1'] = 100 * 500
     360            xmldict['amt2'] = 100 * 500
     361            xmltext = """<payment_item_detail>
     362<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     363<item_detail item_id="1" item_name="OTM Dues" item_amt="%(amt1)d" bank_id="8" acct_num="3068446702" />
     364<item_detail item_id="2" item_name="NAOTM" item_amt="%(amt2)d" bank_id="11" acct_num="0036652027" />
     365</item_details>
     366</payment_item_detail>""" % xmldict
     367
     368        if self.context.p_category == 'acct':
     369            self.pay_item_id = '134'
     370            # amount_auth is being ignored. However, the sum of all split payments
     371            # must coincide with the amount_auth configured in students/utils.py
     372            xmldict['amt1'] = 100 * 3000
     373            xmldict['amt2'] = 100 * 500
     374            xmldict['amt3'] = 100 * 500
     375            xmltext = """<payment_item_detail>
     376<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     377<item_detail item_id="1" item_name="Profession Accreditation" item_amt="%(amt1)d" bank_id="11" acct_num="0040285084" />
     378<item_detail item_id="2" item_name="ACCT Dues" item_amt="%(amt2)d" bank_id="11" acct_num="0036184955" />
     379<item_detail item_id="3" item_name="NAPAS" item_amt="%(amt3)d" bank_id="11" acct_num="2008498661" />
     380</item_details>
     381</payment_item_detail>""" % xmldict
     382
     383        if self.context.p_category == 'bam':
     384            self.pay_item_id = '136'
     385            # amount_auth is being ignored. However, the sum of all split payments
     386            # must coincide with the amount_auth configured in students/utils.py
     387            xmldict['amt1'] = 100 * 500
     388            xmldict['amt2'] = 100 * 500
     389            xmltext = """<payment_item_detail>
     390<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     391<item_detail item_id="1" item_name="BAM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0010788058" />
     392<item_detail item_id="2" item_name="NABAS" item_amt="%(amt2)d" bank_id="8" acct_num="2006936848" />
     393</item_details>
     394</payment_item_detail>""" % xmldict
     395
     396        if self.context.p_category == 'pom':
     397            self.pay_item_id = '138'
     398            # amount_auth is being ignored. However, the sum of all split payments
     399            # must coincide with the amount_auth configured in students/utils.py
     400            xmldict['amt1'] = 100 * 500
     401            xmldict['amt2'] = 100 * 500
     402            xmltext = """<payment_item_detail>
     403<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     404<item_detail item_id="1" item_name="POM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096851444" />
     405<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" />
     406</item_details>
     407</payment_item_detail>""" % xmldict
     408
     409        if self.context.p_category == 'hrm':
     410            self.pay_item_id = '140'
     411            # amount_auth is being ignored. However, the sum of all split payments
     412            # must coincide with the amount_auth configured in students/utils.py
     413            xmldict['amt1'] = 100 * 500
     414            xmldict['amt2'] = 100 * 500
     415            xmltext = """<payment_item_detail>
     416<item_details detail_ref="%(detail_ref)s" college="%(institution_name)s" department="%(department)s" faculty="%(faculty)s">
     417<item_detail item_id="1" item_name="HRM Dues" item_amt="%(amt1)d" bank_id="11" acct_num="0096858546" />
     418<item_detail item_id="2" item_name="NAMS" item_amt="%(amt2)d" bank_id="8" acct_num="2033423003" />
     419</item_details>
     420</payment_item_detail>""" % xmldict
     421
    272422
    273423        self.xml_data = """<input type="hidden" name="xml_data" value='%s'  />""" % xmltext
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/interswitch/tests.py

    r15215 r15255  
    203203        self.assertTrue('<item_detail item_id="2" item_name="School Fee 2" item_amt="1030000" bank_id="123" acct_num="1002883141" />'
    204204            in self.browser.contents)
    205         self.assertTrue('<item_detail item_id="3" item_name="BT Education" item_amt="280000" bank_id="8" acct_num="2028964403" />'
     205        self.assertTrue('<item_detail item_id="3" item_name="WAEAC" item_amt="280000" bank_id="8" acct_num="2028964403" />'
    206206            in self.browser.contents)
    207207        self.assertTrue('<item_detail item_id="4" item_name="Technology Fee" item_amt="120000" bank_id="307" acct_num="5100189030" />'
     
    376376        self.assertTrue('<item_detail item_id="2" item_name="Application 2" item_amt="10000" bank_id="123" acct_num="1002883141" />'
    377377            in self.browser.contents)
    378         self.assertTrue('<item_detail item_id="3" item_name="BT Education" item_amt="50000" bank_id="8" acct_num="2028964403" />'
     378        self.assertTrue('<item_detail item_id="3" item_name="WAEAC" item_amt="50000" bank_id="8" acct_num="2028964403" />'
    379379            in self.browser.contents)
    380380
Note: See TracChangeset for help on using the changeset viewer.