Ignore:
Timestamp:
16 Feb 2007, 12:39:56 (18 years ago)
Author:
Henrik Bettermann
Message:

approve payment modified
payments_view changed to show links

File:
1 edited

Legend:

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

    r1338 r1427  
    1313"""
    1414import logging
    15 logger = logging.getLogger('EPayment.')
     15logger = logging.getLogger('EPayment.Info')
    1616import DateTime
    1717request = context.REQUEST
     
    2323#student = getattr(students,student_id)
    2424s_brain = context.students_catalog(id = student_id)[0]
     25
    2526payments = []
    2627#from Products.zdb import set_trace;set_trace()
    27 for o_id in context.objectIds():
    28     d = {}
    29     d['id'] = o_id
    30     res = context.portal_catalog(id=o_id)
    31     if res:
    32         title = res[0].Title
    33         d['title'] = title or o_id
    34     else:
    35         d['title'] = "no Title"
    36     payments.append(d)
     28
    3729info = {}
    3830is_so = info['is_so'] = context.isSectionOfficer()
     31
     32res = context.portal_catalog(portal_type='Student',id = student_id)
     33if res:
     34    info['review_state'] = res[0].review_state
     35
    3936info['student_name'] = s_brain.name
     37payments_path = "%s/campus/students/%s/payments" % (context.portal_url.getPortalPath(),student_id)
     38sos = context.portal_catalog(container_path=payments_path)
     39info['is_so'] = is_so
     40
     41for so in sos:
     42
     43    row = {}
     44    row['id'] = so.getId
     45    row['title'] = so.Title
     46    url = row['url'] = "%s/%s" % (payments_path,so.getId)
     47    so_object = context.restrictedTraverse(url,default=None).getContent()
     48    row['type'] = so.portal_type
     49    review_state = row['review_state'] = so.review_state
     50    if so_object.type_description.startswith('School Fee'):
     51        row['is_approvable'] = is_so and (review_state == "opened") and info['review_state'] == 'cleared_and_validated'
     52    else:
     53        row['is_approvable'] = is_so and (review_state == "opened")
     54    if (review_state == "closed") and so_object.resp_code in ('SC','00','AP',):
     55        row['confirmed'] = 'active'
     56    else:
     57        row['confirmed'] = ''
     58    payments.append(row)
     59   
     60
    4061info['payments'] = payments
    4162return info
Note: See TracChangeset for help on using the changeset viewer.