Merge pull request #24415 from AfshanKhan/sal-comp-err

fix: select sal comp while making sal struct
This commit is contained in:
Afshan 2021-01-20 12:37:53 +05:30 committed by GitHub
commit 0ff9acfc9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -70,6 +70,9 @@ frappe.ui.form.on('Salary Structure', {
});
},
company: function(frm) {
frm.trigger('set_earning_deduction_component');
},
currency: function(frm) {
calculate_totals(frm.doc);
@ -117,6 +120,7 @@ frappe.ui.form.on('Salary Structure', {
fields_read_only.forEach(function(field) {
frappe.meta.get_docfield("Salary Detail", field, frm.doc.name).read_only = 1;
});
frm.trigger('set_earning_deduction_component');
},
assign_to_employees:function (frm) {

View File

@ -216,7 +216,7 @@ def get_earning_deduction_components(doctype, txt, searchfield, start, page_len,
return frappe.db.sql("""
select t1.salary_component
from `tabSalary Component` t1, `tabSalary Component Account` t2
where t1.salary_component = t2.parent
where t1.name = t2.parent
and t1.type = %s
and t2.company = %s
order by salary_component