mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 21:52:21 +01:00
fix(stock): fetch batch wise valuation rate in get_items
(cherry picked from commit c5df570262)
This commit is contained in:
@@ -1272,15 +1272,11 @@ def get_items(warehouse, posting_date, posting_time, company, item_code=None, ig
|
|||||||
|
|
||||||
for d in items:
|
for d in items:
|
||||||
if (d.item_code, d.warehouse) in itemwise_batch_data:
|
if (d.item_code, d.warehouse) in itemwise_batch_data:
|
||||||
valuation_rate = get_stock_balance(
|
|
||||||
d.item_code, d.warehouse, posting_date, posting_time, with_valuation_rate=True
|
|
||||||
)[1]
|
|
||||||
|
|
||||||
for row in itemwise_batch_data.get((d.item_code, d.warehouse)):
|
for row in itemwise_batch_data.get((d.item_code, d.warehouse)):
|
||||||
if ignore_empty_stock and not row.qty:
|
if ignore_empty_stock and not row.qty:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
args = get_item_data(row, row.qty, valuation_rate)
|
args = get_item_data(row, row.qty, row.valuation_rate)
|
||||||
res.append(args)
|
res.append(args)
|
||||||
else:
|
else:
|
||||||
stock_bal = get_stock_balance(
|
stock_bal = get_stock_balance(
|
||||||
@@ -1414,6 +1410,7 @@ def get_itemwise_batch(warehouse, posting_date, company, item_code=None):
|
|||||||
"item_code": row[0],
|
"item_code": row[0],
|
||||||
"warehouse": row[3],
|
"warehouse": row[3],
|
||||||
"qty": row[8],
|
"qty": row[8],
|
||||||
|
"valuation_rate": row[9],
|
||||||
"item_name": row[1],
|
"item_name": row[1],
|
||||||
"batch_no": row[4],
|
"batch_no": row[4],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user