Merge pull request #7614 from KanchanChauhan/account-filters-payroll
[Fix] Account filter in Process Payroll and Salary Component
This commit is contained in:
commit
101aaed643
@ -10,6 +10,19 @@ frappe.ui.form.on("Process Payroll", {
|
|||||||
frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet);
|
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) {
|
refresh: function(frm) {
|
||||||
frm.disable_save();
|
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -2,7 +2,16 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Salary Component', {
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user