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