Changeset 8429


Ignore:
Timestamp:
12 May 2012, 08:36:08 (13 years ago)
Author:
Henrik Bettermann
Message:

Add response description payment which displays the user id of the person who approved a payment.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py

    r8420 r8429  
    131131        )
    132132
     133    r_desc = schema.TextLine(
     134        title = _(u'Response Description'),
     135        default = None,
     136        required = False,
     137        readonly = False,
     138        )
     139
    133140    def approve():
    134141        "Approve an online payment and set to paid."
  • main/waeup.kofa/trunk/src/waeup/kofa/payments/payment.py

    r8420 r8429  
    2323from grok import index
    2424from zope.component import getUtility
     25from zope.i18n import translate
    2526from waeup.kofa.interfaces import IKofaUtils
    2627from waeup.kofa.interfaces import MessageFactory as _
     
    8182        self.r_code = u'AP'
    8283        self.p_state = 'paid'
    83         #user = get_current_principal()
     84        user = get_current_principal()
     85        r_desc = _('Payment approved by ${a}', mapping = {'a': user.id})
     86        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     87        self.r_desc = translate(r_desc, 'waeup.kofa',
     88            target_language=portal_language)
    8489        self.payment_date = datetime.utcnow()
    8590        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r8428 r8429  
    13991399        self.assertEqual(payment.r_amount_approved, 3456.0)
    14001400        self.assertEqual(payment.r_code, 'AP')
     1401        self.assertEqual(payment.r_desc, u'Payment approved by K1000000')
    14011402        # The new CLR-0 pin has been created
    14021403        self.assertEqual(len(self.app['accesscodes']['CLR-0']),1)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r8411 r8429  
    370370            'ac,amount_auth,creation_date,matric_number,p_category,p_id,'
    371371            'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,'
    372             'r_code,reg_number\r\n'
    373 
    374             ',0.0,2012-04-01 13:12:01,,schoolfee,,,,,unpaid,,0.0,,\r\n'
     372            'r_code,r_desc,reg_number\r\n'
     373
     374            ',0.0,2012-04-01 13:12:01,,schoolfee,,,,,unpaid,,0.0,,,\r\n'
    375375            )
    376376        return
     
    388388            'ac,amount_auth,creation_date,matric_number,p_category,p_id,'
    389389            'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,'
    390             'r_code,reg_number\r\n'
     390            'r_code,r_desc,reg_number\r\n'
    391391
    392392            '666,0.0,2012-04-01 13:12:01,M123456,schoolfee,my-id,'
    393393            'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,'
    394             'r-code,123456\r\n'
     394            'r-code,,123456\r\n'
    395395            )
    396396        return
     
    407407            'ac,amount_auth,creation_date,matric_number,p_category,p_id,'
    408408            'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,'
    409             'r_code,reg_number\r\n'
     409            'r_code,r_desc,reg_number\r\n'
    410410
    411411            '666,0.0,2012-04-01 13:12:01,M123456,schoolfee,my-id,'
    412412            'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,'
    413             'r-code,123456\r\n'
     413            'r-code,,123456\r\n'
    414414            )
    415415        return
     
    426426            'ac,amount_auth,creation_date,matric_number,p_category,p_id,'
    427427            'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,'
    428             'r_code,reg_number\r\n'
     428            'r_code,r_desc,reg_number\r\n'
    429429
    430430            '666,0.0,2012-04-01 13:12:01,M123456,schoolfee,my-id,'
    431431            'p-item,100,2012,unpaid,2012-04-01 14:12:01,12.12,'
    432             'r-code,123456\r\n'
    433             )
    434         return
     432            'r-code,,123456\r\n'
     433            )
     434        return
Note: See TracChangeset for help on using the changeset viewer.