Skip to content

Commit

Permalink
fix: decimal issue while making the stock entry (#40394)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Mar 12, 2024
1 parent 5ac5b7f commit 4a02d14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,7 @@ def add_transfered_raw_materials_in_items(self) -> None:
as_dict=1,
)

precision = frappe.get_precision("Stock Entry Detail", "qty")
for key, row in available_materials.items():
remaining_qty_to_produce = flt(wo_data.trans_qty) - flt(wo_data.produced_qty)
if remaining_qty_to_produce <= 0 and not self.is_return:
Expand All @@ -2091,7 +2092,8 @@ def add_transfered_raw_materials_in_items(self) -> None:
serial_nos = row.serial_nos[0 : cint(qty)]
row.serial_nos = serial_nos

self.update_item_in_stock_entry_detail(row, item, qty)
if flt(qty, precision) != 0.0:
self.update_item_in_stock_entry_detail(row, item, qty)

def update_batches_to_be_consume(self, batches, row, qty):
qty_to_be_consumed = qty
Expand Down

0 comments on commit 4a02d14

Please sign in to comment.