From 0411a43c6e4c8b5940e7068be0893bea8f0b872b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Dec 2020 12:14:41 +0530 Subject: [PATCH] fix: set finished good item rate based on qty --- erpnext/stock/doctype/stock_entry/stock_entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index afdb54ceaa..579b8c5fe1 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -511,7 +511,7 @@ class StockEntry(StockController): bom_items = self.get_bom_raw_materials(finished_item_qty) outgoing_items_cost = sum([flt(row.qty)*flt(row.rate) for row in bom_items.values()]) - return flt(outgoing_items_cost - scrap_items_cost) + return flt((outgoing_items_cost - scrap_items_cost) / finished_item_qty) def distribute_additional_costs(self): # If no incoming items, set additional costs blank