Changeset 6877


Ignore:
Timestamp:
13 Oct 2011, 06:06:11 (13 years ago)
Author:
Henrik Bettermann
Message:

In Student Online Payments we have to store the item session. Thus we need StudentOnlinePayment? must get its own interface which includes a session attribute.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r6876 r6877  
    3737    IStudentPersonal, IStudentBase, IStudentStudyCourse,
    3838    IStudentAccommodation, IStudentClearanceEdit, IStudentStudyLevel,
    39     ICourseTicket, ICourseTicketAdd, IStudentPaymentsContainer
     39    ICourseTicket, ICourseTicketAdd, IStudentPaymentsContainer,
     40    IStudentOnlinePayment
    4041    )
    4142from waeup.sirp.students.catalog import search
     
    4546from waeup.sirp.students.utils import getPaymentDetails
    4647from waeup.sirp.browser.resources import toggleall
    47 from waeup.sirp.payments.interfaces import IOnlinePayment
    4848
    4949# Save function used for save methods in manager pages
     
    107107    """A breadcrumb for course lists.
    108108    """
    109     grok.context(IOnlinePayment)
     109    grok.context(IStudentOnlinePayment)
    110110
    111111    @property
     
    857857    grok.name('addop')
    858858    grok.require('waeup.handleStudent')
    859     form_fields = grok.AutoFields(IOnlinePayment).select(
     859    form_fields = grok.AutoFields(IStudentOnlinePayment).select(
    860860        'p_category')
    861861    #grok.template('addpaymentpage')
     
    872872        payment.p_id = "p%s" % timestamp
    873873        (payment.amount_auth,
    874             payment.p_item,
     874            payment.p_item, payment.p_session,
    875875            payment.surcharge_1,
    876876            payment.surcharge_2,
     
    889889    """ Page to view an online payment ticket
    890890    """
    891     grok.context(IOnlinePayment)
     891    grok.context(IStudentOnlinePayment)
    892892    grok.name('index')
    893893    grok.require('waeup.viewStudent')
    894     form_fields = grok.AutoFields(IOnlinePayment)
     894    form_fields = grok.AutoFields(IStudentOnlinePayment)
    895895    form_fields['creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    896896    form_fields['payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r6874 r6877  
    1111  contextual_reg_num_source, contextual_mat_num_source,
    1212  )
    13 from waeup.sirp.payments.interfaces import IPaymentsContainer
     13from waeup.sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment
    1414
    1515class IStudentsContainer(IWAeUPObject):
     
    320320    """
    321321
     322class IStudentOnlinePayment(IOnlinePayment):
     323    """A student payment via payment gateways.
     324
     325    """
     326
     327    p_session = schema.Choice(
     328        title = u'Payment Session',
     329        source = academic_sessions_vocab,
     330        required = False,
     331        )
     332
     333IStudentOnlinePayment['p_session'].order = IStudentOnlinePayment[
     334    'p_item'].order
     335
    322336# Interfaces for students only
    323337
  • main/waeup.sirp/trunk/src/waeup/sirp/students/payments.py

    r6875 r6877  
    2121from zope.component.interfaces import IFactory
    2222from zope.interface import implementedBy
    23 from waeup.sirp.students.interfaces import IStudentPaymentsContainer, IStudentNavigation
     23from waeup.sirp.students.interfaces import (
     24    IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment)
    2425from waeup.sirp.payments import PaymentsContainer, OnlinePayment
    25 from waeup.sirp.payments.interfaces import IOnlinePayment
    2626from waeup.sirp.utils.helpers import attrs_to_fields
    2727
     
    4444    """This is an online payment.
    4545    """
    46     grok.implements(IOnlinePayment, IStudentNavigation)
    47     grok.provides(IOnlinePayment)
     46    grok.implements(IStudentOnlinePayment, IStudentNavigation)
     47    grok.provides(IStudentOnlinePayment)
    4848
    4949    def __init__(self):
  • main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py

    r6876 r6877  
    2222
    2323def getPaymentDetails(category, student):
    24     #import pdb; pdb.set_trace()
    25     session_string = academic_sessions_vocab.by_value[
    26         student['studycourse'].current_session].title
     24    p_session = student['studycourse'].current_session
    2725    surcharge_1 = surcharge_2 = surcharge_3 = 0
     26    p_item = u''
    2827    if category == 'transfer':
    2928        amount = 500
    30         item = u'Session %s' % session_string
    3129    elif category == 'gown':
    3230        amount = 500
    33         item = u'Session %s' % session_string
    3431    elif category == 'hostel_maintenance':
    3532        amount = 300
    36         item = u'Session %s' % session_string
    3733    elif category == 'schoolfee':
    3834        surcharge_1 = 1500 # BT amount
    3935        surcharge_2 = 300 # Interswitch amount
    4036        amount = getSchoolFee(student, surcharge_1 + surcharge_2)
    41         item = u'Session %s' % session_string
    42     return amount, item, surcharge_1, surcharge_2, surcharge_3
     37        code = student['studycourse'].certificate.code
     38        #session_string = academic_sessions_vocab.by_value[p_session + 1].title
     39        p_item = code
     40        p_session += 1
     41    return amount, p_item, p_session, surcharge_1, surcharge_2, surcharge_3
    4342
    4443# To be moved to the FUTMinna customization package
Note: See TracChangeset for help on using the changeset viewer.