Changeset 16222 for main


Ignore:
Timestamp:
1 Sep 2020, 06:11:13 (4 years ago)
Author:
Henrik Bettermann
Message:

Implement Required Combi Payment.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py

    r16162 r16222  
    160160        # and add the gateway amount.
    161161        provider_amt = 0.0
    162         if self.context.p_category == 'registration':
     162        if self.context.p_category == 'registration' or \
     163            self.context.p_category == 'required_combi':
    163164            provider_amt = 5000.0
    164165        if not self.context.r_company:
     
    222223        # and add the gateway amount.
    223224        provider_amt = 0.0
    224         if self.context.p_category == 'registration':
     225        if self.context.p_category == 'registration'or \
     226            self.context.p_category == 'required_combi':
    225227            provider_amt = 5000.0
    226228        if not self.context.r_company:
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py

    r16142 r16222  
    117117            xmldict['institution_bank_id'] = '117'
    118118            self.pay_item_id = '102'
    119         if self.context.p_category == 'registration':
     119        if self.context.p_category == 'registration' or \
     120            self.context.p_category == 'required_combi':
    120121            provider_amt = 5000.0
    121122        if self.context.p_category in (
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_utils.py

    r16136 r16222  
    5252        self.assertEqual(error,
    5353            'Registration Fee, Book Deposit, Development Fee, Municipal Fee, '
    54             'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee.')
     54            'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee. '
     55            'Make either single payments or make a \'Required Combi Payment\'.')
     56        # A 'Required Combi Payment' is sufficient.
    5557        reg_payment = createObject('waeup.StudentOnlinePayment')
    56         reg_payment.p_category = u'registration'
     58        reg_payment.p_category = u'required_combi'
    5759        reg_payment.p_id = u'anyid'
    5860        reg_payment.p_state = u'paid'
     
    6062        self.student['payments']['anykey'] = reg_payment
    6163        error, payment = utils.setPaymentDetails('schoolfee',self.student)
     64        self.assertEqual(error, None)
     65        # Let's try with single payments.
     66        reg_payment.p_category = u'registration'
     67        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    6268        self.assertEqual(error,
    6369            'Book Deposit, Development Fee, Municipal Fee, Parents Consultative '
    64             'Forum (PCF) Fee must be paid before Tution Fee.')
     70            'Forum (PCF) Fee must be paid before Tution Fee. '
     71            'Make either single payments or make a \'Required Combi Payment\'.')
    6572        IWorkflowState(self.student).setState('returning')
    6673        configuration = createObject('waeup.SessionConfiguration')
     
    7178        self.assertEqual(error,
    7279            'Registration Fee, Book Deposit, Development Fee, Municipal Fee, '
    73             'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee.')
     80            'Parents Consultative Forum (PCF) Fee must be paid before Tution Fee. '
     81            'Make either single payments or make a \'Required Combi Payment\'.')
    7482        reg_payment.p_session = 2005
    7583        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    7684        self.assertEqual(error,
    7785            'Book Deposit, Development Fee, Municipal Fee, Parents Consultative '
    78             'Forum (PCF) Fee must be paid before Tution Fee.')
     86            'Forum (PCF) Fee must be paid before Tution Fee. '
     87            'Make either single payments or make a \'Required Combi Payment\'.')
    7988        pcf_payment = createObject('waeup.StudentOnlinePayment')
    8089        pcf_payment.p_category = u'parentsconsult'
     
    8594        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    8695        self.assertEqual(error,
    87             'Book Deposit, Development Fee, Municipal Fee must be paid before Tution Fee.')
     96            'Book Deposit, Development Fee, Municipal Fee must be paid before Tution Fee. '
     97            'Make either single payments or make a \'Required Combi Payment\'.')
    8898        munic_payment = createObject('waeup.StudentOnlinePayment')
    8999        munic_payment.p_category = u'municipal_fresh'
     
    94104        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    95105        self.assertEqual(error,
    96             'Book Deposit, Development Fee must be paid before Tution Fee.')
     106            'Book Deposit, Development Fee must be paid before Tution Fee. '
     107            'Make either single payments or make a \'Required Combi Payment\'.')
    97108        book_payment = createObject('waeup.StudentOnlinePayment')
    98109        book_payment.p_category = u'book'
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py

    r16140 r16222  
    6868            for category in self.REQUIRED_PAYMENTS.keys():
    6969                for ticket in student['payments'].values():
     70                    if ticket.p_category == 'required_combi' and \
     71                        ticket.p_session == session and \
     72                        ticket.p_state == 'paid':
     73                        cats_missing = None
     74                        break
    7075                    if ticket.p_state == 'paid' and \
    7176                        ticket.p_category.startswith(category) and \
    7277                        ticket.p_session == session:
    7378                        del cats_missing[category]
    74         if cats_missing:
    75             return "%s must be paid before Tution Fee." % ', '.join(
    76                 cats_missing.values())
    77         return
     79                if not cats_missing:
     80                    return
     81        return "%s must be paid before Tution Fee. Make either single payments or make a 'Required Combi Payment'." % ', '.join(
     82            cats_missing.values())
    7883
    7984    def setPaymentDetails(self, category, student,
     
    194199                p_item += u'%s + ' % categories[cat]
    195200            p_item = p_item.strip(' + ')
     201        elif category == 'required_combi':
     202            rp = deepcopy(self.REQUIRED_PAYMENTS)
     203            for cat in rp:
     204                fee_name = cat + '_fee'
     205                cat_amount = getattr(academic_session, fee_name, 0.0)
     206                if not cat_amount:
     207                    return _('%s undefined.' % rp[cat]), None
     208                amount += cat_amount
     209                p_item += u'%s + ' % rp[cat]
     210            p_item = p_item.strip(' + ')
    196211        else:
    197212            fee_name = category + '_fee'
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py

    r16212 r16222  
    7272        'resit9': '9 Make-Up Examination Courses',
    7373        'id_card': 'Student ID Card',
     74        'required_combi': 'Required Combi Payment',
    7475        }
    7576
     
    119120        'resit9': '9 Make-Up Examination Courses',
    120121        'id_card': 'Student ID Card',
     122        'required_combi': 'Required Combi Payment',
    121123        }
    122124
     
    150152
    151153    COMBI_PAYMENT_CATEGORIES = {
     154        #'registration': 'Registration Fee',
    152155        'grad_clearance': 'Clearance Fee',
    153156        'late_registration': 'Late Registration Fee',
    154157        'science': 'Science Bench Fee',
    155158        'clinical': 'Clinical Fee (Medical Students)',
    156         'develop': 'Development Fee',
    157         'municipal_fresh': 'Municipal Fee (Fresh Students)',
    158         'municipal_returning': 'Municipal Fee (Returning Students)',
     159        #'develop': 'Development Fee',
     160        #'municipal_fresh': 'Municipal Fee (Fresh Students)',
     161        #'municipal_returning': 'Municipal Fee (Returning Students)',
    159162        'alumni': 'Alumni Fee',
    160163        'conv': 'Convocation Fee',
     
    162165        'waecneco': 'WAEC and NECO Verification',
    163166        'jambver': 'JAMB Verification',
    164         'book': 'Book Deposit',
    165         'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
     167        #'book': 'Book Deposit',
     168        #'parentsconsult': 'Parents Consultative Forum (PCF) Fee',
    166169        'pharmlab': 'Pharmacy Lab Support Fee',
    167170        'lo_ident': 'Letter of Identification Fee',
Note: See TracChangeset for help on using the changeset viewer.