fix: salary component account filter

This commit is contained in:
pateljannat
2021-07-23 13:06:57 +05:30
parent 01f8833bd1
commit 2e5a358e96

View File

@@ -5,10 +5,17 @@ frappe.ui.form.on('Salary Component', {
setup: function(frm) {
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
var root_type = "Liability";
if (frm.doc.type == "Deduction") {
root_type = "Expense";
}
return {
filters: {
"is_group": 0,
"company": d.company
"company": d.company,
"root_type": root_type
}
};
});