From 83b589f86886f976fef1ad75219f40f0b47ff7ff Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 1 Apr 2025 13:15:06 +0530 Subject: [PATCH] fix: current batch qty showing zero in the stock reconciliation --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index 628925db77..f4d4face15 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -2068,7 +2068,7 @@ def get_auto_batch_nos(kwargs): picked_batches, ) - if available_batches and kwargs.get("posting_date"): + if not kwargs.get("do_not_check_future_batches") and available_batches and kwargs.get("posting_date"): filter_zero_near_batches(available_batches, kwargs) if not kwargs.consider_negative_batches: @@ -2086,7 +2086,8 @@ def filter_zero_near_batches(available_batches, kwargs): del kwargs["posting_date"] del kwargs["posting_time"] - available_batches_in_future = get_available_batches(kwargs) + kwargs.do_not_check_future_batches = 1 + available_batches_in_future = get_auto_batch_nos(kwargs) for batch in available_batches: if batch.qty <= 0: continue -- GitLab