diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index f73c435ffd3a2a3305e6238094d65097406cc7a0..33927f60fe40f44912be3351d0bc70434b50a1e3 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1717,6 +1717,9 @@ def get_valuation_rate( # Get moving average rate of a specific batch number if warehouse and serial_and_batch_bundle: + sabb = frappe.db.get_value( + "Serial and Batch Bundle", serial_and_batch_bundle, ["posting_date", "posting_time"], as_dict=True + ) batch_obj = BatchNoValuation( sle=frappe._dict( { @@ -1724,6 +1727,8 @@ def get_valuation_rate( "warehouse": warehouse, "actual_qty": -1, "serial_and_batch_bundle": serial_and_batch_bundle, + "posting_date": sabb.posting_date, + "posting_time": sabb.posting_time, } ) )