fix: item_code filter in item-wise sales register

This commit is contained in:
Nihantra Patel
2024-08-06 15:54:05 +05:30
parent 83928bbf78
commit f0f8a2f01b
2 changed files with 10 additions and 1 deletions

View File

@@ -54,6 +54,12 @@ frappe.query_reports["Item-wise Sales Register"] = {
fieldtype: "Link",
options: "Brand",
},
{
fieldname: "item_code",
label: __("Item"),
fieldtype: "Link",
options: "Item",
},
{
fieldname: "item_group",
label: __("Item Group"),

View File

@@ -342,7 +342,7 @@ def get_columns(additional_table_columns, filters):
def apply_conditions(query, si, sii, filters, additional_conditions=None):
for opts in ("company", "customer", "item_code"):
for opts in ("company", "customer"):
if filters.get(opts):
query = query.where(si[opts] == filters[opts])
@@ -371,6 +371,9 @@ def apply_conditions(query, si, sii, filters, additional_conditions=None):
if filters.get("brand"):
query = query.where(sii.brand == filters.get("brand"))
if filters.get("item_code"):
query = query.where(sii.item_code == filters.get("item_code"))
if filters.get("item_group"):
query = query.where(sii.item_group == filters.get("item_group"))