fix: decimal values causing incorrect batch picking

This commit is contained in:
Rohit Waghchaure
2025-03-26 15:20:12 +05:30
parent e2412072d9
commit 7bfe703b04

View File

@@ -551,7 +551,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: