fix: Patient Appointment - Calendar - set color from appointment type
This commit is contained in:
parent
bf0b6fd8a9
commit
b2c9268ece
@ -337,11 +337,19 @@ def get_events(start, end, filters=None):
|
|||||||
from frappe.desk.calendar import get_event_conditions
|
from frappe.desk.calendar import get_event_conditions
|
||||||
conditions = get_event_conditions("Patient Appointment", filters)
|
conditions = get_event_conditions("Patient Appointment", filters)
|
||||||
|
|
||||||
data = frappe.db.sql("""select name, patient, practitioner, status,
|
data = frappe.db.sql("""
|
||||||
duration, timestamp(appointment_date, appointment_time) as
|
select
|
||||||
'start' from `tabPatient Appointment` where
|
`tabPatient Appointment`.name, `tabPatient Appointment`.patient,
|
||||||
(appointment_date between %(start)s and %(end)s)
|
`tabPatient Appointment`.practitioner, `tabPatient Appointment`.status,
|
||||||
and docstatus < 2 {conditions}""".format(conditions=conditions),
|
`tabPatient Appointment`.duration,
|
||||||
|
timestamp(`tabPatient Appointment`.appointment_date, `tabPatient Appointment`.appointment_time) as 'start',
|
||||||
|
`tabAppointment Type`.color
|
||||||
|
from
|
||||||
|
`tabPatient Appointment`
|
||||||
|
left join `tabAppointment Type` on `tabPatient Appointment`.appointment_type=`tabAppointment Type`.name
|
||||||
|
where
|
||||||
|
(`tabPatient Appointment`.appointment_date between %(start)s and %(end)s)
|
||||||
|
and `tabPatient Appointment`.docstatus < 2 {conditions}""".format(conditions=conditions),
|
||||||
{"start": start, "end": end}, as_dict=True, update={"allDay": 0})
|
{"start": start, "end": end}, as_dict=True, update={"allDay": 0})
|
||||||
|
|
||||||
for item in data:
|
for item in data:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user