add get leave period method

This commit is contained in:
Saurabh 2018-05-10 19:47:41 +05:30
parent 46b23f8e6e
commit a35dad7610

View File

@ -49,3 +49,9 @@ def update_employee(employee, details, cancel=False):
new_data = get_datetime(new_data)
setattr(employee, item.fieldname, new_data)
return employee
def get_leave_period(from_date, to_date, company):
return frappe.db.sql("""select name from `tabLeave Period`
where is_active=1 and company=%s
and to_date >= %s and from_date <= %s""", (company, to_date, from_date))