Skip to content

Commit

Permalink
feat:add customer group filter in sales register
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandhinidevi123 committed Nov 27, 2023
1 parent 657bb9d commit 5a97fa6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions erpnext/accounts/report/sales_register/sales_register.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ frappe.query_reports["Sales Register"] = {
"fieldtype": "Link",
"options": "Customer"
},
{
"fieldname":"customer_group",
"label": __("Customer Group"),
"fieldtype": "Link",
"options": "Customer Group"
},
{
"fieldname":"company",
"label": __("Company"),
Expand Down
3 changes: 3 additions & 0 deletions erpnext/accounts/report/sales_register/sales_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ def get_invoices(filters, additional_query_columns):
if filters.get("customer"):
query = query.where(si.customer == filters.customer)

if filters.get("customer_group"):
query = query.where(si.customer_group == filters.customer_group)

query = get_conditions(filters, query, "Sales Invoice")
query = apply_common_conditions(
filters, query, doctype="Sales Invoice", child_doctype="Sales Invoice Item"
Expand Down

0 comments on commit 5a97fa6

Please sign in to comment.