Changeset 16233 for main


Ignore:
Timestamp:
10 Sep 2020, 09:33:13 (4 years ago)
Author:
Henrik Bettermann
Message:

Implement PG schoolfee payments.

Show provider_amt in payment ticket pages.

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

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/tests/test_browser.py

    r16220 r16233  
    109109        self.assertEqual(self.applicant.course2, None)
    110110        IWorkflowState(self.applicant).setState('submitted')
    111         self.browser.open(self.manage_path)
     111        self.browser.open(self.view_path)
    112112        self.browser.getLink("Download application slip").click()
    113113        self.assertEqual(self.browser.headers['Status'], '200 Ok')
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/etranzact/browser.py

    r16222 r16233  
    160160        # and add the gateway amount.
    161161        provider_amt = 0.0
    162         if self.context.p_category == 'registration' or \
    163             self.context.p_category == 'required_combi':
     162        if self.context.p_category in (
     163            'registration', 'required_combi', 'pg_other'):
    164164            provider_amt = 5000.0
    165165        if not self.context.r_company:
     
    223223        # and add the gateway amount.
    224224        provider_amt = 0.0
    225         if self.context.p_category == 'registration'or \
    226             self.context.p_category == 'required_combi':
     225        if self.context.p_category in (
     226            'registration', 'required_combi', 'pg_other'):
    227227            provider_amt = 5000.0
    228228        if not self.context.r_company:
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interfaces.py

    r16212 r16233  
    224224    id_card_fee = schema.Float(
    225225        title = _(u'Student ID Card Fee'),
     226        default = 0.0,
     227        required = True,
     228        )
     229    pg_other_fee = schema.Float(
     230        title = _(u'PG Other Charges'),
    226231        default = 0.0,
    227232        required = True,
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/interswitch/browser.py

    r16222 r16233  
    117117            xmldict['institution_bank_id'] = '117'
    118118            self.pay_item_id = '102'
    119         if self.context.p_category == 'registration' or \
    120             self.context.p_category == 'required_combi':
     119        if self.context.p_category in (
     120            'registration', 'required_combi', 'pg_other'):
    121121            provider_amt = 5000.0
    122122        if self.context.p_category in (
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16180 r16233  
    314314            mergefiles=mergefiles,
    315315            watermark=watermark)
     316
     317class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage):
     318    """ Page to view an online payment ticket. We do not omit provider_amt.
     319    """
     320    form_fields = grok.AutoFields(ICustomStudentOnlinePayment).omit(
     321        'gateway_amt', 'thirdparty_amt', 'p_item','p_combi')
     322    form_fields[
     323        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     324    form_fields[
     325        'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     326
     327class CustomExportPDFPaymentSlip(NigeriaExportPDFPaymentSlip):
     328    """Deliver a PDF slip of the context. We do not omit provider_amt.
     329    """
     330    form_fields = grok.AutoFields(ICustomStudentOnlinePayment).omit(
     331        'gateway_amt', 'thirdparty_amt', 'p_item',
     332        'p_split_data','p_combi')
     333    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     334    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/interfaces.py

    r15859 r16233  
    104104ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
    105105    'p_session'].order
     106ICustomStudentOnlinePayment['provider_amt'].order = ICustomStudentOnlinePayment[
     107    'net_amt'].order
    106108
    107109class ICustomCourseTicket(INigeriaCourseTicket):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/utils.py

    r16223 r16233  
    6161        }
    6262
     63    REQUIRED_PAYMENTS_PG = {
     64        'pg_other': 'PG Other Charges',
     65        }
     66
    6367    def warnCreditsOOR(self, studylevel, course=None):
    6468        """Return message if credits are out of range. In the base
     
    7276
    7377    def _requiredPaymentsMissing(self, student, session):
    74         if student.is_fresh:
     78        if student.is_postgrad:
     79            rp = self.REQUIRED_PAYMENTS_PG
     80        elif student.is_fresh:
    7581            rp = self.REQUIRED_PAYMENTS_FRESH
    7682        else:
     
    213219            p_item = p_item.strip(' + ')
    214220        elif category == 'required_combi':
    215             if student.is_fresh:
    216                 rp = deepcopy(self.REQUIRED_PAYMENTS_FRESH)
     221            if student.is_postgrad:
     222                rp = self.REQUIRED_PAYMENTS_PG
     223            elif student.is_fresh:
     224                rp = self.REQUIRED_PAYMENTS_FRESH
    217225            else:
    218                 rp = deepcopy(self.REQUIRED_PAYMENTS_RETURNING)
     226                rp = self.REQUIRED_PAYMENTS_RETURNING
    219227            for cat in rp:
    220228                fee_name = cat + '_fee'
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py

    r16223 r16233  
    7373        'id_card': 'Student ID Card',
    7474        'required_combi': 'Required Combi Payment',
     75        'pg_other': 'PG Other Charges',
    7576        }
    7677
    7778    SELECTABLE_PAYMENT_CATEGORIES = {
    78         'schoolfee': 'Tuition, Accommodation, Adm. Charges (total amount)',
    79         'schoolfee40': 'Tuition, Accommodation, Adm. Charges (40% - 1st instalment)',
    80         'secondinstal': 'Tuition, Accommodation, Adm. Charges (60% - 2nd instalment)',
     79        'schoolfee': 'Tuition Plus (total amount)',
     80        'schoolfee40': 'Tuition Plus (40% - 1st instalment)',
     81        'secondinstal': 'Tuition Plus (60% - 2nd instalment)',
    8182        'registration': 'Registration Fee',
    8283        'clearance': 'Acceptance Fee',
     
    121122        'id_card': 'Student ID Card',
    122123        'required_combi': 'Required Combi Payment',
     124        'pg_other': 'PG Other Charges',
    123125        }
    124126
    125127    PREVIOUS_PAYMENT_CATEGORIES = {
    126         'schoolfee': 'Tuition, Accommodation, Adm. Charges (total amount)',
     128        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
    127129        'registration': 'Registration Fee',
    128130        'clearance': 'Acceptance Fee',
     
    149151        'fine': 'Fine',
    150152        'id_card': 'Student ID Card',
     153        'pg_other': 'PG Other Charges',
    151154        }
    152155
     
    174177        'fine': 'Fine',
    175178        'id_card': 'Student ID Card',
     179        'pg_other': 'PG Other Charges',
    176180        }
    177181
    178182    BALANCE_PAYMENT_CATEGORIES = {
    179         'schoolfee': 'Tuition, Accommodation, Adm. Charges (total amount)',
     183        'schoolfee': 'Tuition, Accommodation, Adm. Charges',
    180184        }
    181185
Note: See TracChangeset for help on using the changeset viewer.