From 096b943b0cab3807777dee933a725299fc810766 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 25 Jun 2018 22:37:43 +0530 Subject: [PATCH] [minor] fixes to moment.defaultDateFormat and daily work summary eplies --- erpnext/crm/doctype/lead/lead.js | 2 +- .../daily_work_summary_replies.py | 18 +++++++++++++----- .../projects/doctype/timesheet/timesheet.js | 2 +- erpnext/public/js/projects/timer.js | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.js b/erpnext/crm/doctype/lead/lead.js index 19bf868ad0..1af45504d4 100644 --- a/erpnext/crm/doctype/lead/lead.js +++ b/erpnext/crm/doctype/lead/lead.js @@ -81,7 +81,7 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ if (this.frm.doc.contact_date) { let d = moment(this.frm.doc.contact_date); d.add(1, "hours"); - this.frm.set_value("ends_on", d.format(moment.defaultDatetimeFormat)); + this.frm.set_value("ends_on", d.format(frappe.defaultDatetimeFormat)); } } }); diff --git a/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py b/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py index f5eabf5415..aa8eea5d74 100644 --- a/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py +++ b/erpnext/hr/report/daily_work_summary_replies/daily_work_summary_replies.py @@ -17,13 +17,20 @@ def get_columns(filters=None): "label": _("User"), "fieldname": "user", "fieldtype": "Data", - "width": 800 + "width": 300 }, { - "label": _("Reply Count"), + "label": _("Replies"), "fieldname": "count", "fieldtype": "data", - "width": 150, + "width": 100, + "align": 'right', + }, + { + "label": _("Total"), + "fieldname": "total", + "fieldtype": "data", + "width": 100, "align": 'right', } ] @@ -42,8 +49,9 @@ def get_data(filters): ['sent_or_received', '=', 'Received']], order_by='creation asc') data = [] + total = len(daily_summary_emails) for user in get_user_emails_from_group(filters.group): - userName = frappe.get_value('User', user, 'full_name') + user_name = frappe.get_value('User', user, 'full_name') count = len([d for d in replies if d.sender == user]) - data.append([userName, "{0} / {1}".format(count, len(daily_summary_emails))]) + data.append([user_name, count, total]) return data \ No newline at end of file diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index f719ad8895..5234df67ff 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -212,7 +212,7 @@ var calculate_end_time = function(frm, cdt, cdn) { d.add(child.hours, "hours"); frm._setting_hours = true; frappe.model.set_value(cdt, cdn, "to_time", - d.format(moment.defaultDatetimeFormat)).then(() => { + d.format(frappe.defaultDatetimeFormat)).then(() => { frm._setting_hours = false; }); } diff --git a/erpnext/public/js/projects/timer.js b/erpnext/public/js/projects/timer.js index 0a737a63a8..8b1d1b158b 100644 --- a/erpnext/public/js/projects/timer.js +++ b/erpnext/public/js/projects/timer.js @@ -79,7 +79,7 @@ erpnext.timesheet.control_timer = function(frm, dialog, row, timestamp=0) { let d = moment(row.from_time); if(row.expected_hours) { d.add(row.expected_hours, "hours"); - row.to_time = d.format(moment.defaultDatetimeFormat); + row.to_time = d.format(frappe.defaultDatetimeFormat); } frm.refresh_field("time_logs"); frm.save();