From 59a835602ab44bae11b076958ade874bdef03e47 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 30 Dec 2019 11:42:06 +0530 Subject: [PATCH] fix: service item's cost showing incorrect amount in stock entry (#20106) --- erpnext/manufacturing/doctype/bom/bom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index f8146bb01e..7000d30eff 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -768,7 +768,7 @@ def add_additional_cost(stock_entry, work_order): items = {} for d in bom.get(table): - items.setdefault(d.item_code, d.rate) + items.setdefault(d.item_code, d.amount) non_stock_items = frappe.get_all('Item', fields="name", filters={'name': ('in', list(items.keys())), 'ifnull(is_stock_item, 0)': 0}, as_list=1) @@ -777,7 +777,7 @@ def add_additional_cost(stock_entry, work_order): stock_entry.append('additional_costs', { 'expense_account': expenses_included_in_valuation, 'description': name[0], - 'amount': items.get(name[0]) + 'amount': flt(items.get(name[0])) * flt(stock_entry.fg_completed_qty) / flt(bom.quantity) }) @frappe.whitelist()