[minor] fixes to moment.defaultDateFormat and daily work summary eplies

This commit is contained in:
Rushabh Mehta 2018-06-25 22:37:43 +05:30
parent 5c13cb3221
commit 096b943b0c
4 changed files with 16 additions and 8 deletions

View File

@ -81,7 +81,7 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
if (this.frm.doc.contact_date) { if (this.frm.doc.contact_date) {
let d = moment(this.frm.doc.contact_date); let d = moment(this.frm.doc.contact_date);
d.add(1, "hours"); d.add(1, "hours");
this.frm.set_value("ends_on", d.format(moment.defaultDatetimeFormat)); this.frm.set_value("ends_on", d.format(frappe.defaultDatetimeFormat));
} }
} }
}); });

View File

@ -17,13 +17,20 @@ def get_columns(filters=None):
"label": _("User"), "label": _("User"),
"fieldname": "user", "fieldname": "user",
"fieldtype": "Data", "fieldtype": "Data",
"width": 800 "width": 300
}, },
{ {
"label": _("Reply Count"), "label": _("Replies"),
"fieldname": "count", "fieldname": "count",
"fieldtype": "data", "fieldtype": "data",
"width": 150, "width": 100,
"align": 'right',
},
{
"label": _("Total"),
"fieldname": "total",
"fieldtype": "data",
"width": 100,
"align": 'right', "align": 'right',
} }
] ]
@ -42,8 +49,9 @@ def get_data(filters):
['sent_or_received', '=', 'Received']], ['sent_or_received', '=', 'Received']],
order_by='creation asc') order_by='creation asc')
data = [] data = []
total = len(daily_summary_emails)
for user in get_user_emails_from_group(filters.group): 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]) 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 return data

View File

@ -212,7 +212,7 @@ var calculate_end_time = function(frm, cdt, cdn) {
d.add(child.hours, "hours"); d.add(child.hours, "hours");
frm._setting_hours = true; frm._setting_hours = true;
frappe.model.set_value(cdt, cdn, "to_time", frappe.model.set_value(cdt, cdn, "to_time",
d.format(moment.defaultDatetimeFormat)).then(() => { d.format(frappe.defaultDatetimeFormat)).then(() => {
frm._setting_hours = false; frm._setting_hours = false;
}); });
} }

View File

@ -79,7 +79,7 @@ erpnext.timesheet.control_timer = function(frm, dialog, row, timestamp=0) {
let d = moment(row.from_time); let d = moment(row.from_time);
if(row.expected_hours) { if(row.expected_hours) {
d.add(row.expected_hours, "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.refresh_field("time_logs");
frm.save(); frm.save();