Skip to content

Commit

Permalink
feat: add Valuation Method column in Stock Ledger Variance report
Browse files Browse the repository at this point in the history
(cherry picked from commit 16c297c)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Dec 5, 2023
1 parent c5efbd7 commit 943f1b3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions erpnext/stock/report/stock_ledger_variance/stock_ledger_variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def get_columns():
"label": _("Warehouse"),
"options": "Warehouse",
},
{
"fieldname": "valuation_method",
"fieldtype": "Data",
"label": _("Valuation Method"),
},
{
"fieldname": "voucher_type",
"fieldtype": "Link",
Expand Down Expand Up @@ -210,7 +215,14 @@ def get_data(filters=None):
if has_difference(
row, precision, filters.difference_in, item_warehouse.valuation_method or valuation_method
):
data.append(add_item_warehouse_details(row, item_warehouse))
row.update(
{
"item_code": item_warehouse.item_code,
"warehouse": item_warehouse.warehouse,
"valuation_method": item_warehouse.valuation_method or valuation_method,
}
)
data.append(row)
break

return data
Expand Down Expand Up @@ -276,15 +288,3 @@ def has_difference(row, precision, difference_in, valuation_method):
qty_diff or value_diff or valuation_diff
):
return True


def add_item_warehouse_details(row, item_warehouse):
row.update(
{
"item_code": item_warehouse.item_code,
"warehouse": item_warehouse.warehouse,
"valuation_method": item_warehouse.valuation_method,
}
)

return row

0 comments on commit 943f1b3

Please sign in to comment.