Changeset 8270 for main/waeup.uniben


Ignore:
Timestamp:
25 Apr 2012, 06:45:16 (13 years ago)
Author:
Henrik Bettermann
Message:

Set p_level and p_session after school fee payment according to getReturningData.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r8265 r8270  
    344344    """A student payment via payment gateways.
    345345
    346     """
     346    This Interface does not inherit from IStudentOnlinePayment.
     347    Thus all fields from IStudentOnlinePayment have to be repeated here.
     348    """
     349
     350    p_level = schema.Int(
     351        title = _(u'Payment Level'),
     352        required = False,
     353        readonly = True,
     354        )
     355ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
     356    'p_session'].order
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r8265 r8270  
    7878
    7979    # not yet changed
    80     def setReturningData(self, student):
    81         student['studycourse'].current_level += 100
    82         student['studycourse'].current_session += 1
    83         verdict = student['studycourse'].current_verdict
    84         student['studycourse'].current_verdict = '0'
    85         student['studycourse'].previous_verdict = verdict
    86         return
     80    def getReturningData(self, student):
     81        """ This method defines what happens after school fee payment
     82        depending on the student's senate verdict.
     83
     84        In the base configuration current level is always increased
     85        by 100 no matter which verdict has been assigned.
     86        """
     87        new_level = student['studycourse'].current_level + 100
     88        new_session = student['studycourse'].current_session + 1
     89        return new_session, new_level
    8790
    8891    def getPaymentDetails(self, category, student):
     
    9396        d['p_session'] = student['studycourse'].current_session
    9497        session = str(d['p_session'])
     98        d['p_level'] = student['studycourse'].current_level
    9599        try:
    96100            academic_session = grok.getSite()['configuration'][session]
     
    113117            code = student['studycourse'].certificate.code
    114118            d['p_item'] = code
    115             d['p_session'] += 1
     119            # In case of school fee payment the payment session and level
     120            # contain the values of the session the student has paid for
     121            d['p_session'], d['p_level'] = self.getReturningData(student)
    116122        if d['amount'] == 0.0:
    117123            d['error'] = _(u'Amount could not be determined.')
Note: See TracChangeset for help on using the changeset viewer.