Skip to content

Commit

Permalink
Merge pull request #38365 from Nandhinidevi123/sales_register
Browse files Browse the repository at this point in the history
feat:add customer group filter in sales register
  • Loading branch information
rohitwaghchaure authored Nov 29, 2023
2 parents fddf341 + 5a97fa6 commit 258148b
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 258148b

Please sign in to comment.