mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
Merge pull request #6784 from RobertSchouten/calendar_fix
[fix] calendar range fixes
This commit is contained in:
@@ -408,13 +408,13 @@ def add_leaves(events, start, end, match_conditions=None):
|
||||
query = """select name, from_date, to_date, employee_name, half_day,
|
||||
status, employee, docstatus
|
||||
from `tabLeave Application` where
|
||||
(from_date between %s and %s or to_date between %s and %s)
|
||||
from_date <= %(end)s and to_date >= %(start)s <= to_date
|
||||
and docstatus < 2
|
||||
and status!="Rejected" """
|
||||
if match_conditions:
|
||||
query += " and " + match_conditions
|
||||
|
||||
for d in frappe.db.sql(query, (start, end, start, end), as_dict=True):
|
||||
for d in frappe.db.sql(query, {"start":start, "end": end}, as_dict=True):
|
||||
e = {
|
||||
"name": d.name,
|
||||
"doctype": "Leave Application",
|
||||
|
||||
Reference in New Issue
Block a user