def member_detail(request): """ This view lets accountants view member details: - has their signature arrived? - how about the payment? Mostly all the info about an application or membership in the database can be seen here. """ from decimal import Decimal as D logged_in = authenticated_userid(request) memberid = request.matchdict['memberid'] LOG.info("member details of id %s checked by %s", memberid, logged_in) member = C3sMember.get_by_id(memberid) if member is None: # that memberid did not produce good results request.session.flash( "A Member with id " "{} could not be found in the DB. run for the backups!".format( memberid), 'message_to_staff') return HTTPFound( # back to base request.route_url('toolbox')) # get the members invoices from the DB invoices15 = Dues15Invoice.get_by_membership_no(member.membership_number) invoices16 = Dues16Invoice.get_by_membership_no(member.membership_number) invoices17 = Dues17Invoice.get_by_membership_no(member.membership_number) shares = request.registry.share_information.get_member_shares( member.membership_number) return { 'today': date.today().strftime('%Y-%m-%d'), 'D': D, 'member': member, 'shares': shares, 'invoices15': invoices15, 'invoices16': invoices16, 'invoices17': invoices17, # 'form': html }
def member_detail(request): """ This view lets accountants view member details: - has their signature arrived? - how about the payment? Mostly all the info about an application or membership in the database can be seen here. """ from decimal import Decimal as D logged_in = authenticated_userid(request) memberid = request.matchdict['memberid'] LOG.info("member details of id %s checked by %s", memberid, logged_in) member = C3sMember.get_by_id(memberid) if member is None: # that memberid did not produce good results request.session.flash( "A Member with id " "{} could not be found in the DB. run for the backups!".format( memberid), 'message_to_staff' ) return HTTPFound( # back to base request.route_url('toolbox')) # get the members invoices from the DB invoices15 = Dues15Invoice.get_by_membership_no(member.membership_number) invoices16 = Dues16Invoice.get_by_membership_no(member.membership_number) return { 'today': date.today().strftime('%Y-%m-%d'), 'D': D, 'member': member, 'invoices15': invoices15, 'invoices16': invoices16, # 'form': html }