diff --git a/erpnext/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js index 1a41172a970d..4578ac3f6ecf 100644 --- a/erpnext/accounts/report/sales_register/sales_register.js +++ b/erpnext/accounts/report/sales_register/sales_register.js @@ -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"), diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index 0ba7186fa674..ec6dd729082a 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -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"