Fix error

This commit is contained in:
Shreya 2018-05-16 16:14:34 +05:30
parent a7559be5b2
commit fda15702bc

View File

@ -84,15 +84,17 @@ frappe.ui.form.on('Employee Advance', {
},
employee: function (frm) {
return frappe.call({
method: "erpnext.hr.doctype.employee_advance.employee_advance.get_due_advance_amount",
args: {
"employee": frm.doc.employee,
"posting_date": frm.doc.posting_date
},
callback: function(r) {
frm.set_value("due_advance_amount",r.message);
}
});
if (frm.doc.employee) {
return frappe.call({
method: "erpnext.hr.doctype.employee_advance.employee_advance.get_due_advance_amount",
args: {
"employee": frm.doc.employee,
"posting_date": frm.doc.posting_date
},
callback: function(r) {
frm.set_value("due_advance_amount",r.message);
}
});
}
}
});