mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 00:25:01 +00:00
fix: fixed the query for sales invoice in sale partner related reports
This commit is contained in:
@@ -106,4 +106,7 @@ def get_conditions(filters, date_field):
|
||||
if filters.get("to_date"):
|
||||
conditions += f" and {date_field} <= %(to_date)s"
|
||||
|
||||
if filters.get("doctype") == "Sales Invoice":
|
||||
conditions += " and not (is_consolidated = 1 and is_created_using_pos = 0)"
|
||||
|
||||
return conditions
|
||||
|
||||
@@ -248,6 +248,9 @@ def get_actual_data(filters, sales_users_or_territory_data, date_field, sales_fi
|
||||
net_amount = child_doc.base_net_amount
|
||||
sales_field_col = parent_doc[sales_field]
|
||||
|
||||
if filters.get("doctype") == "Sales Invoice":
|
||||
query = query.where(~((parent_doc.is_consolidated == 0) & (parent_doc.is_created_using_pos == 1)))
|
||||
|
||||
query = query.select(
|
||||
child_doc.item_group,
|
||||
parent_doc[date_field],
|
||||
|
||||
@@ -137,6 +137,9 @@ def get_conditions(filters, date_field):
|
||||
if filters.get("brand"):
|
||||
conditions += " and dt_item.brand = %(brand)s"
|
||||
|
||||
if filters.get("doctype") == "Sales Invoice":
|
||||
conditions += " and not (is_consolidated = 1 and is_created_using_pos = 0)"
|
||||
|
||||
if filters.get("item_group"):
|
||||
lft, rgt = frappe.get_cached_value("Item Group", filters.get("item_group"), ["lft", "rgt"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user