[Fixes] minor fix for fiscal year in holiday list
This commit is contained in:
parent
1d753c92b1
commit
74eb8e34da
@ -78,6 +78,9 @@ def get_events(start, end, filters=None):
|
|||||||
if filters:
|
if filters:
|
||||||
fiscal_year = json.loads(filters).get("fiscal_year")
|
fiscal_year = json.loads(filters).get("fiscal_year")
|
||||||
|
|
||||||
|
if not fiscal_year:
|
||||||
|
fiscal_year = frappe.get_doc("Global Defaults").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)
|
||||||
|
|
||||||
data = frappe.db.sql("""select hl.name, hld.holiday_date, hld.description
|
data = frappe.db.sql("""select hl.name, hld.holiday_date, hld.description
|
||||||
@ -93,9 +96,6 @@ def get_events(start, end, filters=None):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def get_fy_start_end_dates(fiscal_year=None):
|
def get_fy_start_end_dates(fiscal_year):
|
||||||
if not fiscal_year:
|
|
||||||
fiscal_year = frappe.get_doc("Global Defaults").current_fiscal_year
|
|
||||||
|
|
||||||
return frappe.db.sql("""select year_start_date, year_end_date
|
return frappe.db.sql("""select year_start_date, year_end_date
|
||||||
from `tabFiscal Year` where name=%s""", (fiscal_year,))[0]
|
from `tabFiscal Year` where name=%s""", (fiscal_year,))[0]
|
Loading…
x
Reference in New Issue
Block a user