Merge pull request #46741 from frappe/mergify/bp/version-15/pr-46734

fix: decimal values causing incorrect batch picking (backport #46733) (backport #46734)
This commit is contained in:
rohitwaghchaure
2025-03-27 09:13:56 +05:30
committed by GitHub

View File

@@ -545,7 +545,11 @@ class SubcontractingController(StockController):
def __get_batch_nos_for_bundle(self, qty, key):
available_batches = defaultdict(float)
precision = frappe.get_precision("Subcontracting Receipt Supplied Item", "consumed_qty")
for batch_no, batch_qty in self.available_materials[key]["batch_no"].items():
if flt(batch_qty, precision) <= 0:
continue
qty_to_consumed = 0
if qty > 0:
if batch_qty >= qty: