mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-03 12:18:46 +02:00
fix: precision issue in stock entry
(cherry picked from commit 9f3b8520fe)
This commit is contained in:
committed by
Mergify
parent
7ff7ec7929
commit
fe5e42d2dc
@@ -3244,12 +3244,13 @@ def create_serial_and_batch_bundle(parent_doc, row, child, type_of_transaction=N
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
precision = frappe.get_precision("Stock Entry Detail", "qty")
|
||||||
if row.serial_nos and row.batches_to_be_consume:
|
if row.serial_nos and row.batches_to_be_consume:
|
||||||
doc.has_serial_no = 1
|
doc.has_serial_no = 1
|
||||||
doc.has_batch_no = 1
|
doc.has_batch_no = 1
|
||||||
batchwise_serial_nos = get_batchwise_serial_nos(child.item_code, row)
|
batchwise_serial_nos = get_batchwise_serial_nos(child.item_code, row)
|
||||||
for batch_no, qty in row.batches_to_be_consume.items():
|
for batch_no, qty in row.batches_to_be_consume.items():
|
||||||
while qty > 0:
|
while flt(qty, precision) > 0:
|
||||||
qty -= 1
|
qty -= 1
|
||||||
doc.append(
|
doc.append(
|
||||||
"entries",
|
"entries",
|
||||||
@@ -3270,8 +3271,9 @@ def create_serial_and_batch_bundle(parent_doc, row, child, type_of_transaction=N
|
|||||||
precision = frappe.get_precision("Serial and Batch Entry", "qty")
|
precision = frappe.get_precision("Serial and Batch Entry", "qty")
|
||||||
doc.has_batch_no = 1
|
doc.has_batch_no = 1
|
||||||
for batch_no, qty in row.batches_to_be_consume.items():
|
for batch_no, qty in row.batches_to_be_consume.items():
|
||||||
qty = flt(qty, precision)
|
if flt(qty, precision) > 0:
|
||||||
doc.append("entries", {"batch_no": batch_no, "warehouse": row.warehouse, "qty": qty * -1})
|
qty = flt(qty, precision)
|
||||||
|
doc.append("entries", {"batch_no": batch_no, "warehouse": row.warehouse, "qty": qty * -1})
|
||||||
|
|
||||||
if not doc.entries:
|
if not doc.entries:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user