Skip to content

Commit

Permalink
fix: added brand column in Warehouse wise Item Balance Age and Value … (
Browse files Browse the repository at this point in the history
#41280)

fix: added brand coulmn in Warehouse wise Item Balance Age and Value report
  • Loading branch information
rohitwaghchaure authored May 1, 2024
1 parent da3010a commit 1cbc200
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ def execute(filters=None):
item_value.setdefault((item, item_map[item]["item_group"]), [])
item_value[(item, item_map[item]["item_group"])].append(total_stock_value)

itemwise_brand = frappe._dict(get_itemwise_brand(items))
# sum bal_qty by item
for (item, item_group), wh_balance in item_balance.items():
if not item_ageing.get(item):
continue

total_stock_value = sum(item_value[(item, item_group)])
row = [item, item_map[item]["item_name"], item_group, total_stock_value]
row = [item, item_map[item]["item_name"], item_group, itemwise_brand.get(item), total_stock_value]

fifo_queue = item_ageing[item]["fifo_queue"]
average_age = 0.00
Expand All @@ -85,13 +86,18 @@ def execute(filters=None):
return columns, data


def get_itemwise_brand(items):
return frappe.get_all("Item", filters={"name": ("in", items)}, fields=["name", "brand"], as_list=1)


def get_columns(filters):
"""return columns"""

columns = [
_("Item") + ":Link/Item:150",
_("Item Name") + ":Link/Item:150",
_("Item Group") + "::120",
_("Brand") + ":Link/Brand:120",
_("Value") + ":Currency:120",
_("Age") + ":Float:120",
]
Expand Down

0 comments on commit 1cbc200

Please sign in to comment.