fix: select sal comp while making sal struct

This commit is contained in:
Afshan 2021-01-19 19:29:31 +05:30
parent c474caba70
commit c69ab6d184
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