Changeset 17246


Ignore:
Timestamp:
28 Dec 2022, 09:57:26 (21 months ago)
Author:
Henrik Bettermann
Message:

Add p_currency field.

Location:
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/payments/interfaces.py

    r17242 r17246  
    1818from zope.interface import Attribute
    1919from zope import schema
    20 from waeup.kofa.interfaces import SimpleKofaVocabulary
     20from waeup.kofa.interfaces import (
     21    SimpleKofaVocabulary, ContextualDictSourceFactoryBase)
    2122from waeup.kofa.payments.interfaces import IPayment
    2223from kofacustom.nigeria.interfaces import MessageFactory as _
     24
     25class CurrencySymbolSource(ContextualDictSourceFactoryBase):
     26    """A payment category source delivers all categories of payments.
     27
     28    """
     29    DICT_NAME = 'CURRENCY_DICT'
    2330
    2431class INigeriaOnlinePayment(IPayment):
     
    5663
    5764    # Only defined in kofacustom.nigeria package
     65
     66    p_currency = schema.Choice(
     67        title = _(u'Currency'),
     68        source = CurrencySymbolSource(),
     69        required = False,
     70        default = 'NGN',
     71        )
    5872
    5973    r_pay_reference = schema.TextLine(
     
    125139INigeriaOnlinePayment['net_amt'].order = INigeriaOnlinePayment[
    126140    'amount_auth'].order
     141INigeriaOnlinePayment['p_currency'].order = INigeriaOnlinePayment[
     142    'amount_auth'].order
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py

    r17242 r17246  
    123123        result = open(self.outfile, 'rb').read()
    124124        self.assertMatches(
    125             'ac,amount_auth,creation_date,gateway_amt,net_amt,p_category,p_combi,p_current,'
     125            'ac,amount_auth,creation_date,gateway_amt,net_amt,p_category,p_combi,p_currency,p_current,'
    126126            'p_id,p_item,p_level,p_option,p_session,p_split_data,p_state,payment_date,provider_amt,'
    127127            'r_amount_approved,r_card_num,r_code,r_company,r_desc,'
    128128            'r_pay_reference,r_payment_link,thirdparty_amt,student_id,state,'
    129129            'current_session\r\n'
    130             '666,12.12,2012-04-01 13:12:01#,,,schoolfee,[],1,my-id,p-item,'
     130            '666,12.12,2012-04-01 13:12:01#,,,schoolfee,[],,1,my-id,p-item,'
    131131            '100,,%s,,paid,2012-04-01 14:12:01#,,12.12,'
    132132            '789,r-code,interswitch,,,,,A111111,created,2012\r\n' % (curr_year-6),
     
    189189            result,
    190190            'ac,amount_auth,creation_date,formatted_p_date,gateway_amt,net_amt,'
    191             'p_category,p_combi,p_current,p_id,p_item,p_level,p_option,p_session,p_split_data,p_state,'
     191            'p_category,p_combi,p_currency,p_current,p_id,p_item,p_level,p_option,p_session,p_split_data,p_state,'
    192192            'payment_date,provider_amt,r_amount_approved,r_card_num,r_code,'
    193193            'r_company,r_desc,r_pay_reference,r_payment_link,thirdparty_amt,student_id,'
     
    195195            'current_session,entry_session,entry_mode,faccode,depcode,certcode,lga\r\n'
    196196
    197             '666,12.12,%s-04-01 13:12:01#,,,,schoolfee,[],1,my-id,p-item,'
     197            '666,12.12,%s-04-01 13:12:01#,,,,schoolfee,[],,1,my-id,p-item,'
    198198            '100,,%s,,paid,%s-04-01 14:12:01#,,12.12,,r-code,,,,,,A111111,'
    199199            '234,123,Anna,M.,Tester,f,created,2012,2010,ug_ft,NA,NA,CERT1,\r\n'
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/utils/utils.py

    r16922 r17246  
    363363        }
    364364
     365    CURRENCY_DICT = {
     366        'NGN': u"\N{naira sign} (Naira)",
     367        'EUR': u"\N{euro sign} (Euro)",
     368        'USD': u"\N{dollar sign} (US Dollar)",
     369        'GBP': u"\N{pound sign} (Pound Sterling)",
     370        }
     371
    365372    @property
    366373    def tzinfo(self):
Note: See TracChangeset for help on using the changeset viewer.