blob: c65cddb5cacd5494f4942a4125025fb0efd45d77 [file] [log] [blame]
asbasawaraj4c263482018-06-15 10:04:19 +05301import frappe
asbasawaraj4c263482018-06-15 10:04:19 +05302
3no_cache = 1
4
5def get_context(context):
6 if frappe.session.user != 'Guest':
7 context.all_certifications = get_all_certifications_of_a_member()
8 context.show_sidebar = True
9
10
11def get_all_certifications_of_a_member():
12 '''Returns all certifications'''
13 all_certifications = []
14 all_certifications = frappe.db.sql(""" select cc.name,cc.from_date,cc.to_date,ca.amount,ca.currency
15 from `tabCertified Consultant` cc
16 inner join `tabCertification Application` ca
17 on cc.certification_application = ca.name
18 where paid = 1 and email = %(user)s order by cc.to_date desc""" ,{'user': frappe.session.user},as_dict=True)
19 return all_certifications