mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 19:35:09 +00:00
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com> fix: keep from and to time blank until added explicitly (#53798)
This commit is contained in:
@@ -788,26 +788,12 @@ frappe.ui.form.on("Job Card Time Log", {
|
|||||||
|
|
||||||
frm.events.set_total_completed_qty(frm);
|
frm.events.set_total_completed_qty(frm);
|
||||||
},
|
},
|
||||||
|
|
||||||
time_in_mins(frm, cdt, cdn) {
|
|
||||||
let d = locals[cdt][cdn];
|
|
||||||
if (d.time_in_mins) {
|
|
||||||
d.to_time = add_mins_to_time(d.from_time, d.time_in_mins);
|
|
||||||
frappe.model.set_value(cdt, cdn, "to_time", d.to_time);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function get_seconds_diff(d1, d2) {
|
function get_seconds_diff(d1, d2) {
|
||||||
return moment(d1).diff(d2, "seconds");
|
return moment(d1).diff(d2, "seconds");
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_mins_to_time(datetime, mins) {
|
|
||||||
let new_date = moment(datetime).add(mins, "minutes");
|
|
||||||
|
|
||||||
return new_date.format("YYYY-MM-DD HH:mm:ss");
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_last_completed_row(time_logs) {
|
function get_last_completed_row(time_logs) {
|
||||||
let completed_rows = time_logs.filter((d) => d.to_time);
|
let completed_rows = time_logs.filter((d) => d.to_time);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user