Merge pull request #7614 from KanchanChauhan/account-filters-payroll

[Fix] Account filter in Process Payroll and Salary Component
This commit is contained in:
Nabin Hait 2017-02-06 11:36:48 +05:30 committed by GitHub
commit 101aaed643
2 changed files with 24 additions and 12 deletions

View File

@ -10,6 +10,19 @@ frappe.ui.form.on("Process Payroll", {
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
},
setup: function(frm) {
frm.set_query("payment_account", function() {
var account_types = ["Bank", "Cash"];
return {
filters: {
"account_type": ["in", account_types],
"is_group": 0,
"company": frm.doc.company
}
}
})
},
refresh: function(frm) {
frm.disable_save();
},
@ -50,16 +63,6 @@ frappe.ui.form.on("Process Payroll", {
}
})
}
},
account: function(frm) {
var account_types = ["Bank", "Cash"];
return {
filters: {
"account_type": ["in", account_types],
"is_group": 0,
"company": frm.doc.company
}
}
}
})

View File

@ -2,7 +2,16 @@
// For license information, please see license.txt
frappe.ui.form.on('Salary Component', {
refresh: function(frm) {
setup: function(frm) {
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
filters: {
"root_type": "Expense",
"is_group": 0,
"company": d.company
}
}
})
}
});