Changeset 1283 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
12 Jan 2007, 13:14:45 (18 years ago)
Author:
joachim
Message:

pay_by_sc ready for testing

Location:
WAeUP_SRP/trunk/skins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_epayment/getPaymentsFolderInfo.py

    r1238 r1283  
    2424s_brain = context.students_catalog(id = student_id)[0]
    2525payments = []
     26#from Products.zdb import set_trace;set_trace()
    2627for o_id in context.objectIds():
    2728    d = {}
     
    3435        d['title'] = "no Title"
    3536    payments.append(d)
    36 #from Products.zdb import set_trace;set_trace()
    3737info = {}
    3838is_so = info['is_so'] = context.isSectionOfficer()
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py

    r1274 r1283  
    2222student_id = context.getStudentId()
    2323if student_id is None:
    24     return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     24    return request.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    2525
    2626student = getattr(students,student_id)
    2727sbrain = context.students_catalog(id=student_id)[0]
    2828amount,description = context.getSchoolFee(sbrain.faculty)
    29 validate = request.has_key("cpsdocument_edit_button")
     29res = context.portal_catalog(portal_type="Certificate",
     30                                     id = sbrain.course)
     31if not res:
     32    logger.info('"%s","certificate not found", "%s"' % (student_id,course))
     33    prefix = ""
     34else:   
     35    prefix = res[0].getObject().getContent().school_fee_code
     36    if not prefix or prefix == 'none':
     37        prefix = res[0].getPath().split('/')[-4]
     38
     39validate = request.has_key("cpsdocument_create_button")
    3040res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
    3141                      schema_id= 'epayment',
    3242                      context=context,
    33                       mapping=validate and REQUEST,
     43                      mapping=validate and request,
    3444                      ob={},
    3545                      layout_mode="create",
     
    6171else:
    6272    payments = getattr(student,'payments')
     73#from Products.zdb import set_trace; set_trace()
    6374info = {}
    64 order_id = info['order_id'] = ds.get('payment_id')
     75order_id = ds.get('pin_n')
    6576p_id = "p%s" % order_id
    6677now = DateTime.DateTime()
    6778info['date'] = now
    68 info['type_code'] = "schoolfee_%s"
    69 info['type_code'] = 'description'
    70 info['amount'] = amount
     79info['amount'] = "n/a"
     80pin = info['order_id'] = ds.get('pin')
     81info['type_code'] = "schoolfee_%s" % pin
     82info['type_description'] = 'Schoolfee SC %s' % pin
    7183payments.invokeFactory('Payment', p_id)
    7284payment = getattr(payments,p_id)
    73 #from Products.zdb import set_trace;set_trace()
     85wftool = context.portal_workflow
     86wftool.doActionFor(payment,'open')
    7487payment.getContent().edit(mapping=info)
    75 url = "%s/payments/%s" % (student.absolute_url(),p_id)
     88wftool.doActionFor(payment,'close')
     89wftool.doActionFor(student,'enter_school_fee_pin')
     90url = "%s/payments" % (student.absolute_url())
    7691request.RESPONSE.redirect(url)
    7792
  • WAeUP_SRP/trunk/skins/waeup_student/student_index.py

    r1243 r1283  
    2626    elif context.portal_type == 'StudentClearance':
    2727        return context.clearance_view()
     28    elif context.portal_type == 'PaymentsFolder':
     29        return context.payments_view()
    2830    elif context.portal_type == 'Student':
    2931        return redirect("%s/student_view" % context.absolute_url())
Note: See TracChangeset for help on using the changeset viewer.