Skip to content

Commit

Permalink
feat: add customer group filter in sales register (#38365)
Browse files Browse the repository at this point in the history
feat: add customer group filter in sales register

(cherry picked from commit 5a97fa6)

Co-authored-by: Nandhinidevi123 <nandhini.devi@thirvusoft.in>
  • Loading branch information
mergify[bot] and Nandhinidevi123 authored Dec 2, 2023
1 parent c797c53 commit 185b715
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 185b715

Please sign in to comment.