From 6594c841a7d38847c7d8b51eed21d7325fc06c2b Mon Sep 17 00:00:00 2001 From: bcornwellmott Date: Mon, 12 Sep 2016 04:13:23 -0700 Subject: [PATCH] Added color coding to timesheet calendars (#6269) --- erpnext/projects/doctype/timesheet/timesheet.py | 2 +- erpnext/projects/doctype/timesheet/timesheet_calendar.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 63cb8981d02..31a98d9ec55 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -311,7 +311,7 @@ def get_events(start, end, filters=None): filters = json.loads(filters) conditions = get_conditions(filters) - return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.parent as parent, + return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.docstatus as status, `tabTimesheet Detail`.parent as parent, from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`, `tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and `tabTimesheet`.docstatus < 2 and (from_time between %(start)s and %(end)s) {conditions}""".format(conditions=conditions), diff --git a/erpnext/projects/doctype/timesheet/timesheet_calendar.js b/erpnext/projects/doctype/timesheet/timesheet_calendar.js index 6db3e5aacd4..a41ba38a7be 100644 --- a/erpnext/projects/doctype/timesheet/timesheet_calendar.js +++ b/erpnext/projects/doctype/timesheet/timesheet_calendar.js @@ -8,6 +8,11 @@ frappe.views.calendar["Timesheet"] = { "allDay": "allDay", "child_name": "name" }, + style_map: { + "0": "info", + "1": "standard", + "2": "danger" + }, gantt: true, filters: [ {