add get leave period method
diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py
index 057f406..be8c948 100644
--- a/erpnext/hr/utils.py
+++ b/erpnext/hr/utils.py
@@ -49,3 +49,9 @@
 			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))