[Fix] Patient Appointment Calendar not showing data properly (#15052)

This commit is contained in:
rohitwaghchaure 2018-07-31 16:01:02 +05:30 committed by Nabin Hait
parent ebdefade9b
commit dc7004e083

View File

@ -292,10 +292,10 @@ def get_events(start, end, filters=None):
conditions = get_event_conditions("Patient Appointment", filters)
data = frappe.db.sql("""select name, patient, physician, status,
duration, timestamp(appointment_date, appointment_time) as
'start' from `tabPatient Appointment` where
'appointment_date' from `tabPatient Appointment` where
(appointment_date between %(start)s and %(end)s)
and docstatus < 2 {conditions}""".format(conditions=conditions),
{"start": start, "end": end}, as_dict=True, update={"allDay": 0})
for item in data:
item.end = item.start + datetime.timedelta(minutes = item.duration)
item.appointment_datetime = item.appointment_date + datetime.timedelta(minutes = item.duration)
return data