Merge pull request #14084 from shreyashah115/fixes

[minor] Fix error
This commit is contained in:
rohitwaghchaure 2018-05-16 16:21:14 +05:30 committed by GitHub
commit de796266f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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