set posting date only if null

This commit is contained in:
Shreya 2018-01-18 17:35:29 +05:30 committed by Saurabh
parent cbbee47625
commit 543feda2fb

View File

@ -5,7 +5,9 @@ var in_progress = false;
frappe.ui.form.on('Payroll Entry', {
onload: function (frm) {
frm.doc.posting_date = frappe.datetime.nowdate();
if (!frm.doc.posting_date) {
frm.doc.posting_date = frappe.datetime.nowdate();
}
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
},