Merge branch 'develop' into tcs_calculation
This commit is contained in:
commit
31eb740aef
@ -53,8 +53,7 @@ frappe.ui.form.on('Additional Salary', {
|
|||||||
if (!frm.doc.company) 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",
|
filters: {type: ["in", ["earning", "deduction"]], company: frm.doc.company}
|
||||||
filters: {type: "earning", company: frm.doc.company}
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,15 +10,7 @@ frappe.ui.form.on('Employee Incentive', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
frm.trigger('set_earning_component');
|
||||||
if (!frm.doc.company) return;
|
|
||||||
frm.set_query("salary_component", function() {
|
|
||||||
return {
|
|
||||||
query: "erpnext.payroll.doctype.salary_structure.salary_structure.get_earning_deduction_components",
|
|
||||||
filters: {type: "earning", company: frm.doc.company}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
employee: function(frm) {
|
employee: function(frm) {
|
||||||
@ -45,11 +37,21 @@ frappe.ui.form.on('Employee Incentive', {
|
|||||||
callback: function(data) {
|
callback: function(data) {
|
||||||
if (data.message) {
|
if (data.message) {
|
||||||
frm.set_value("company", data.message.company);
|
frm.set_value("company", data.message.company);
|
||||||
|
frm.trigger('set_earning_component');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_earning_component: function(frm) {
|
||||||
|
if (!frm.doc.company) return;
|
||||||
|
frm.set_query("salary_component", function() {
|
||||||
|
return {
|
||||||
|
filters: {type: "earning", company: frm.doc.company}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
get_employee_currency: function(frm) {
|
get_employee_currency: function(frm) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment.get_employee_currency",
|
method: "erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment.get_employee_currency",
|
||||||
|
|||||||
@ -58,13 +58,11 @@ frappe.ui.form.on('Salary Structure', {
|
|||||||
if(!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",
|
|
||||||
filters: {type: "earning", 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",
|
|
||||||
filters: {type: "deduction", company: frm.doc.company}
|
filters: {type: "deduction", company: frm.doc.company}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@ -207,22 +207,3 @@ def get_employees(salary_structure):
|
|||||||
|
|
||||||
return list(set([d.employee for d in employees]))
|
return list(set([d.employee for d in employees]))
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
|
||||||
def get_earning_deduction_components(doctype, txt, searchfield, start, page_len, filters):
|
|
||||||
if len(filters) < 2:
|
|
||||||
return {}
|
|
||||||
|
|
||||||
return frappe.db.sql("""
|
|
||||||
select t1.salary_component
|
|
||||||
from `tabSalary Component` t1, `tabSalary Component Account` t2
|
|
||||||
where (t1.name = t2.parent
|
|
||||||
and t1.type = %(type)s
|
|
||||||
and t2.company = %(company)s)
|
|
||||||
or (t1.type = %(type)s
|
|
||||||
and t1.statistical_component = 1)
|
|
||||||
order by salary_component
|
|
||||||
""",{
|
|
||||||
"type": filters['type'],
|
|
||||||
"company": filters['company']
|
|
||||||
})
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user