From 741bd29b74fbd136d4fbd3146732784ddaffae0f Mon Sep 17 00:00:00 2001 From: Ranjith Kurungadam Date: Mon, 15 Oct 2018 14:52:38 +0530 Subject: [PATCH] fix: Patient Appointment Calendar (#15684) --- .../patient_appointment.py | 4 +-- .../patient_appointment_calendar.js | 34 +------------------ 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py index 7d948b8187b..5364031fce1 100755 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py @@ -339,13 +339,13 @@ def get_events(start, end, filters=None): data = frappe.db.sql("""select name, patient, practitioner, status, duration, timestamp(appointment_date, appointment_time) as - 'appointment_date' from `tabPatient Appointment` where + 'start' 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.appointment_datetime = item.appointment_date + datetime.timedelta(minutes = item.duration) + item.end = item.start + datetime.timedelta(minutes = item.duration) return data diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js index fc674a8a3e1..2249d2a2059 100644 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js @@ -10,37 +10,5 @@ frappe.views.calendar["Patient Appointment"] = { }, order_by: "appointment_date", gantt: true, - get_events_method: "erpnext.healthcare.doctype.patient_appointment.patient_appointment.get_events", - filters: [ - { - 'fieldtype': 'Link', - 'fieldname': 'practitioner', - 'options': 'Healthcare Practitioner', - 'label': __('Healthcare Practitioner') - }, - { - 'fieldtype': 'Link', - 'fieldname': 'patient', - 'options': 'Patient', - 'label': __('Patient') - }, - { - 'fieldtype': 'Link', - 'fieldname': 'appointment_type', - 'options': 'Appointment Type', - 'label': __('Appointment Type') - }, - { - 'fieldtype': 'Link', - 'fieldname': 'department', - 'options': 'Medical Department', - 'label': __('Department') - }, - { - 'fieldtype': 'Select', - 'fieldname': 'status', - 'options': 'Scheduled\nOpen\nClosed\nPending', - 'label': __('Status') - } - ] + get_events_method: "erpnext.healthcare.doctype.patient_appointment.patient_appointment.get_events" };