mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
fix: job card timer issue
This commit is contained in:
@@ -86,7 +86,9 @@ frappe.ui.form.on('Job Card', {
|
|||||||
frm.set_value('current_time' , 0);
|
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) {
|
complete_job: function(frm, completed_time, completed_qty) {
|
||||||
@@ -111,12 +113,22 @@ frappe.ui.form.on('Job Card', {
|
|||||||
|
|
||||||
validate: function(frm) {
|
validate: function(frm) {
|
||||||
if ((!frm.doc.time_logs || !frm.doc.time_logs.length) && frm.doc.started_time) {
|
if ((!frm.doc.time_logs || !frm.doc.time_logs.length) && frm.doc.started_time) {
|
||||||
frm.set_value('started_time' , '');
|
frm.trigger("reset_timer");
|
||||||
frm.set_value('job_started', 0);
|
|
||||||
frm.set_value('current_time' , 0);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
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) {
|
make_dashboard: function(frm) {
|
||||||
if(frm.doc.__islocal)
|
if(frm.doc.__islocal)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user