fix: showing on_going shift on calendar

This commit is contained in:
Anurag Mishra 2020-08-12 13:35:25 +05:30
parent 74f0a1ab7c
commit c2710e05ce

View File

@ -91,11 +91,13 @@ def add_assignments(events, start, end, conditions=None):
employee, docstatus
from `tabShift Assignment` where
start_date >= %(start_date)s
and docstatus < 2""".format()
or end_date <= %(end_date)s
or (%(start_date)s between start_date and end_date and %(end_date)s between start_date and end_date)
and docstatus = 1"""
if conditions:
query += conditions
for d in frappe.db.sql(query, {"start_date":start}, as_dict=True):
for d in frappe.db.sql(query, {"start_date":start, "end_date":end}, as_dict=True):
e = {
"name": d.name,
"doctype": "Shift Assignment",