mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
fix: selecting salary component (#24121)
This commit is contained in:
@@ -12,14 +12,6 @@ frappe.ui.form.on('Additional Salary', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!frm.doc.currency) return;
|
|
||||||
frm.set_query("salary_component", function() {
|
|
||||||
return {
|
|
||||||
query: "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
|
||||||
filters: {currency: frm.doc.currency, company: frm.doc.company}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
employee: function(frm) {
|
employee: function(frm) {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ frappe.ui.form.on('Employee Incentive', {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!frm.doc.currency) return;
|
if (!frm.doc.company) return;
|
||||||
frm.set_query("salary_component", function() {
|
frm.set_query("salary_component", function() {
|
||||||
return {
|
return {
|
||||||
query: "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
query: "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
filters: {type: "earning", company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -55,17 +55,17 @@ frappe.ui.form.on('Salary Structure', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
set_earning_deduction_component: function(frm) {
|
set_earning_deduction_component: function(frm) {
|
||||||
if(!frm.doc.currency && !frm.doc.company) return;
|
if(!frm.doc.company) return;
|
||||||
frm.set_query("salary_component", "earnings", function() {
|
frm.set_query("salary_component", "earnings", function() {
|
||||||
return {
|
return {
|
||||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||||
filters: {type: "earning", currency: frm.doc.currency, company: frm.doc.company}
|
filters: {type: "earning", company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
frm.set_query("salary_component", "deductions", function() {
|
frm.set_query("salary_component", "deductions", function() {
|
||||||
return {
|
return {
|
||||||
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
query : "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
||||||
filters: {type: "deduction", currency: frm.doc.currency, company: frm.doc.company}
|
filters: {type: "deduction", company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -74,7 +74,6 @@ frappe.ui.form.on('Salary Structure', {
|
|||||||
currency: function(frm) {
|
currency: function(frm) {
|
||||||
calculate_totals(frm.doc);
|
calculate_totals(frm.doc);
|
||||||
frm.trigger("set_dynamic_labels")
|
frm.trigger("set_dynamic_labels")
|
||||||
frm.trigger('set_earning_deduction_component');
|
|
||||||
frm.refresh()
|
frm.refresh()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ def get_employees(salary_structure):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_earning_deduction_components(doctype, txt, searchfield, start, page_len, filters):
|
def get_earning_deduction_components(doctype, txt, searchfield, start, page_len, filters):
|
||||||
if len(filters) < 3:
|
if len(filters) < 2:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
|
|||||||
Reference in New Issue
Block a user