set posting date only if null

This commit is contained in:
Shreya 2018-01-18 17:35:29 +05:30
parent 570e29d5e7
commit d0b60e8254

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);
},