Ignore:
Timestamp:
7 Nov 2015, 06:16:00 (9 years ago)
Author:
Henrik Bettermann
Message:

Rename school function.

Rename payment categories.

Add test to produce payment pdf slip.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/interswitch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/browser.py

    r13400 r13403  
    4949
    5050
    51 def school(student):
     51def contr_agreement(student):
    5252    if student.current_mode == 'found' or student.current_mode.endswith('_pt'):
    53         return 'pt'
    54     return 'regular'
     53        return 'first'
     54    return 'second'
    5555
    5656class CustomInterswitchPageApplicant(InterswitchPageApplicant):
     
    141141            self.redirect(self.url(self.context, '@@index'))
    142142            return
    143         if school(student) == 'pt':
     143        if contr_agreement(student) == 'first':
    144144            self.product_id = PRODUCT_ID_PT
    145145        else:
     
    180180        # Schoolfee
    181181        if self.context.p_category.startswith('schoolfee'):
    182             if school(student) == 'pt':
    183                 # PT schoolfee settings
     182            if contr_agreement(student) == 'first':
     183                # First agreement
    184184                provider_amt = 1900.0
    185185                joint_venture_amt = 1100.0
     
    194194                    self.pay_item_id = '105'
    195195            else:
    196                 # REGULAR schoolfee settings
     196                # Second agreement
    197197                provider_amt = 1500.0
    198198                joint_venture_amt = 1000.0
     
    249249        # Clearance
    250250        elif self.context.p_category.startswith('clearance'):
    251             if school(student) == 'pt':
    252                 # PT clearance settings
     251            if contr_agreement(student) == 'first':
     252                # First agreement
    253253                if student.current_mode == 'found':
    254254                    self.pay_item_id = '102'
     
    258258                xmldict['institution_bank_id'] = '117'
    259259            else:
    260                 # REGULAR clearance settings
     260                # Second agreement
    261261                self.pay_item_id = '102'
    262262                xmldict['institution_acct'] = '1010827641'
    263263                xmldict['institution_bank_id'] = '117'
    264 
    265264
    266265            if self.context.p_category == 'clearance_incl':
     
    294293</payment_item_detail>""" % xmldict
    295294
    296         # Union Due
     295        # Union Dues
    297296        elif self.context.p_category == 'union':
    298297            self.pay_item_id = '103'
     
    307306</payment_item_detail>""" % xmldict
    308307
    309         # Lapel
     308        # Lapel/File
    310309        elif self.context.p_category == 'lapel':
    311310            self.pay_item_id = '104'
     
    320319</payment_item_detail>""" % xmldict
    321320
    322         # Welfare
     321        # Welfare Assurance
    323322        elif self.context.p_category == 'welfare':
    324323            self.pay_item_id = '105'
     
    359358</payment_item_detail>""" % xmldict
    360359
    361         # Medical
     360        # Medical Acceptance
    362361        elif self.context.p_category == 'medical':
    363362            self.pay_item_id = '108'
     
    423422    @property
    424423    def product_id(self):
    425         if school(self.context.student) == 'pt':
     424        if contr_agreement(self.context.student) == 'first':
    426425            return PRODUCT_ID_PT
    427426        return PRODUCT_ID_REGULAR
  • main/waeup.aaue/trunk/src/waeup/aaue/interswitch/tests.py

    r13402 r13403  
    139139            in self.browser.contents)
    140140        self.assertTrue(
    141             'item_name="School Fee plus Students\' Union and Welfare Assurance Fees" '
     141            'item_name="School Fee plus" '
    142142            'item_amt="4600000" bank_id="7" '
    143143            'acct_num="1014847058"' in self.browser.contents)
     
    213213            in self.browser.contents)
    214214        self.assertTrue(
    215             'item_name="Acceptance Fee plus Matric Gown and Lapel/File Fees" '
     215            'item_name="Acceptance Fee plus" '
    216216            'item_amt="4000000" bank_id="117" '
    217217            'acct_num="1014066976"' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.