[Fix] Timesheet to time issue
This commit is contained in:
parent
cfd9b1a24c
commit
3176bc93c1
@ -78,15 +78,8 @@ frappe.ui.form.on("Timesheet Detail", {
|
|||||||
var child = locals[cdt][cdn];
|
var child = locals[cdt][cdn];
|
||||||
|
|
||||||
if(frm._setting_hours) return;
|
if(frm._setting_hours) return;
|
||||||
|
frappe.model.set_value(cdt, cdn, "hours", moment(child.to_time).diff(moment(child.from_time),
|
||||||
if(flt(child.hours) == 0.0){
|
"seconds") / 3600);
|
||||||
frappe.model.set_value(cdt, cdn, "hours", moment(child.to_time).diff(moment(child.from_time),
|
|
||||||
"seconds") / 3600);
|
|
||||||
}else{
|
|
||||||
var d = moment(child.to_time);
|
|
||||||
d.add(child.hours, "hours");
|
|
||||||
frappe.model.set_value(cdt, cdn, "from_time", d.format(moment.defaultDatetimeFormat));
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
hours: function(frm, cdt, cdn) {
|
hours: function(frm, cdt, cdn) {
|
||||||
|
Loading…
Reference in New Issue
Block a user