fix: Filter Discount Account list
This commit is contained in:
parent
0d5ad3b1bb
commit
b22dba1146
@ -510,15 +510,6 @@ cur_frm.set_query("income_account", "items", function(doc) {
|
||||
}
|
||||
});
|
||||
|
||||
// Discount Account in Details Table
|
||||
// --------------------------------
|
||||
cur_frm.set_query("discount_account", "items", function(doc) {
|
||||
return{
|
||||
query: "erpnext.controllers.queries.get_income_account",
|
||||
filters: {'company': doc.company}
|
||||
}
|
||||
});
|
||||
|
||||
// Cost Center in Details Table
|
||||
// -----------------------------
|
||||
cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) {
|
||||
@ -626,6 +617,19 @@ frappe.ui.form.on('Sales Invoice', {
|
||||
}
|
||||
}
|
||||
|
||||
// discount account
|
||||
frm.fields_dict['items'].grid.get_field('discount_account').get_query = function(doc) {
|
||||
if (erpnext.is_perpetual_inventory_enabled(doc.company)) {
|
||||
return {
|
||||
filters: {
|
||||
'report_type': 'Profit and Loss',
|
||||
'company': doc.company,
|
||||
"is_group": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frm.fields_dict['items'].grid.get_field('deferred_revenue_account').get_query = function(doc) {
|
||||
return {
|
||||
filters: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user