fix: job card timer issue

This commit is contained in:
Rohit Waghchaure
2020-04-17 00:54:20 +05:30
parent 61fc2d3263
commit da83af1213

View File

@@ -86,7 +86,9 @@ frappe.ui.form.on('Job Card', {
frm.set_value('current_time' , 0);
}
frm.save();
frm.save("Save", () => {}, "", () => {
frm.doc.time_logs.pop(-1);
});
},
complete_job: function(frm, completed_time, completed_qty) {
@@ -111,12 +113,22 @@ frappe.ui.form.on('Job Card', {
validate: function(frm) {
if ((!frm.doc.time_logs || !frm.doc.time_logs.length) && frm.doc.started_time) {
frm.set_value('started_time' , '');
frm.set_value('job_started', 0);
frm.set_value('current_time' , 0);
frm.trigger("reset_timer");
}
},
employee: function(frm) {
if (frm.doc.job_started && !frm.doc.current_time) {
frm.trigger("reset_timer");
}
},
reset_timer: function(frm) {
frm.set_value('started_time' , '');
frm.set_value('job_started', 0);
frm.set_value('current_time' , 0);
},
make_dashboard: function(frm) {
if(frm.doc.__islocal)
return;