Ignore:
Timestamp:
8 Nov 2021, 18:52:17 (3 years ago)
Author:
Henrik Bettermann
Message:

Customize SchoolFeePaymentsOverviewExporter?.

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

Legend:

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

    r16686 r16706  
    2626    InterswitchPaymentVerifyWebservicePageStudent,
    2727    InterswitchPageStudent, InterswitchPageApplicant,
    28     )
    29 from kofacustom.nigeria.interswitch.paydirectbrowser import (
    30     PAYDirectPageStudent, PAYDirectPageApplicant,
    31     StudentRefNumberSlip, ApplicantRefNumberSlip,
    3228    )
    3329from kofacustom.iuokada.students.interfaces import ICustomStudentOnlinePayment
     
    278274# PAYDirect added on 19/05/2021
    279275
     276from kofacustom.nigeria.interswitch.paydirectbrowser import (
     277    PAYDirectPageStudent, PAYDirectPageApplicant,
     278    StudentRefNumberSlip, ApplicantRefNumberSlip,
     279    )
     280
    280281PAYDIRECT_HOST = 'orion.interswitchng.com'
    281282PAYDIRECT_URL = '/bookonhold/bookonhold.asmx'
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/export.py

    r16665 r16706  
    1818"""Exporters for student related stuff.
    1919"""
     20from waeup.kofa.students.export import (
     21    SchoolFeePaymentsOverviewExporter, StudentExporter)
    2022from kofacustom.iuokada.students.interfaces import (
    2123    ICustomStudent,
     
    9395            value, name, context=context)
    9496
     97class CustomSchoolFeePaymentsOverviewExporter(SchoolFeePaymentsOverviewExporter):
     98    """
     99    """
     100
     101    def mangle_value(self, value, name, context=None):
     102        """
     103        """
     104        if name in self.year_range_tuple and context is not None:
     105            value = 0
     106            for ticket in context['payments'].values():
     107                if ticket.p_category in (
     108                    'schoolfee',
     109                    'schoolfee40',
     110                    'secondinstal ',
     111                    'clearance',) and ticket.p_session == int(name):
     112                    if ticket.p_state == 'waived':
     113                        value = 'waived'
     114                        break
     115                    if ticket.p_state == 'scholarship':
     116                        value = 'scholarship'
     117                        break
     118                    if ticket.p_state == 'paid':
     119                        try:
     120                            value += ticket.amount_auth
     121                        except TypeError:
     122                            pass
     123            if value == 0:
     124                value = ''
     125            elif isinstance(value, float):
     126                value = round(value, 2)
     127        return super(
     128            StudentExporter, self).mangle_value(
     129            value, name, context=context)
     130
Note: See TracChangeset for help on using the changeset viewer.