minor fixes

This commit is contained in:
Saurabh 2015-10-07 11:27:25 +05:30
parent 74eb8e34da
commit b0dbdc1439

View File

@ -79,7 +79,7 @@ def get_events(start, end, filters=None):
fiscal_year = json.loads(filters).get("fiscal_year") fiscal_year = json.loads(filters).get("fiscal_year")
if not fiscal_year: if not fiscal_year:
fiscal_year = frappe.get_doc("Global Defaults").current_fiscal_year fiscal_year = frappe.db.get_value("Global Defaults", None, "current_fiscal_year")
yr_start_date, yr_end_date = get_fy_start_end_dates(fiscal_year) yr_start_date, yr_end_date = get_fy_start_end_dates(fiscal_year)
@ -95,7 +95,5 @@ def get_events(start, end, filters=None):
return data return data
def get_fy_start_end_dates(fiscal_year): def get_fy_start_end_dates(fiscal_year):
return frappe.db.sql("""select year_start_date, year_end_date return frappe.db.get_value("Fiscal Year", fiscal_year, ["year_start_date", "year_end_date"])
from `tabFiscal Year` where name=%s""", (fiscal_year,))[0]