Skip to content

Commit

Permalink
fix: Expense Account filter in Sales Invoice (#35944)
Browse files Browse the repository at this point in the history
fix: Expense Account filter in Sales Invoice (#35944)

(cherry picked from commit d54f524)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
  • Loading branch information
mergify[bot] and deepeshgarg007 authored Jul 1, 2023
1 parent 0602ddc commit b63fbe4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
13 changes: 0 additions & 13 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,19 +653,6 @@ frappe.ui.form.on('Sales Invoice', {
}
}

// expense account
frm.fields_dict['items'].grid.get_field('expense_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
}
}
}
}

// discount account
frm.fields_dict['items'].grid.get_field('discount_account').get_query = function(doc) {
return {
Expand Down
4 changes: 3 additions & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
this.frm.set_query("expense_account", "items", function(doc) {
return {
filters: {
"company": doc.company
"company": doc.company,
"report_type": "Profit and Loss",
"is_group": 0
}
};
});
Expand Down

0 comments on commit b63fbe4

Please sign in to comment.