Files
erpnext/erpnext/www/payment_setup_certification.py
Chillar Anand 4b2be2999f chore: Cleanup imports (#27320)
* chore: Added isort to pre-commit config

* chore: Sort imports with isort

* chore: Remove imports with pycln

* chore: Sort imports with isort

* chore: Fix import issues

* chore: Fix sider issues

* chore: linting

* chore: linting / sorting import

from ecommerce refactor merge

* ci: dont allow unused imports

* chore: sort / clean ecommerce imports

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-09-03 18:57:43 +05:30

22 lines
699 B
Python

from __future__ import unicode_literals
import frappe
no_cache = 1
def get_context(context):
if frappe.session.user != 'Guest':
context.all_certifications = get_all_certifications_of_a_member()
context.show_sidebar = True
def get_all_certifications_of_a_member():
'''Returns all certifications'''
all_certifications = []
all_certifications = frappe.db.sql(""" select cc.name,cc.from_date,cc.to_date,ca.amount,ca.currency
from `tabCertified Consultant` cc
inner join `tabCertification Application` ca
on cc.certification_application = ca.name
where paid = 1 and email = %(user)s order by cc.to_date desc""" ,{'user': frappe.session.user},as_dict=True)
return all_certifications