Browse Source
fix: Salary component account filter (#26604)
* fix: salary component account filter
* fix: cleanup
develop
Jannat Patel
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
2 deletions
-
erpnext/payroll/doctype/salary_component/salary_component.js
|
|
@ -4,11 +4,18 @@ |
|
|
|
frappe.ui.form.on('Salary Component', { |
|
|
|
setup: function(frm) { |
|
|
|
frm.set_query("account", "accounts", function(doc, cdt, cdn) { |
|
|
|
var d = locals[cdt][cdn]; |
|
|
|
let d = frappe.get_doc(cdt, cdn); |
|
|
|
|
|
|
|
let 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 |
|
|
|
} |
|
|
|
}; |
|
|
|
}); |
|
|
|