minor fix

This commit is contained in:
Nabin Hait 2014-10-08 18:38:27 +05:30
parent e96e83d557
commit fce2881de6

View File

@ -267,18 +267,20 @@ class BuyingController(StockController):
rm_supplied_idx += 1 rm_supplied_idx += 1
# get raw materials rate # get raw materials rate
from erpnext.stock.utils import get_incoming_rate if self.doctype == "Purchase Receipt":
item_rate = get_incoming_rate({ from erpnext.stock.utils import get_incoming_rate
"item_code": bom_item.item_code, rm.rate = get_incoming_rate({
"warehouse": self.supplier_warehouse, "item_code": bom_item.item_code,
"posting_date": self.posting_date, "warehouse": self.supplier_warehouse,
"posting_time": self.posting_time, "posting_date": self.posting_date,
"qty": -1 * required_qty, "posting_time": self.posting_time,
"serial_no": rm.serial_no "qty": -1 * required_qty,
}) "serial_no": rm.serial_no
rm.rate = item_rate })
rm.amount = required_qty * flt(item_rate) else:
rm.rate = bom_item.rate
rm.amount = required_qty * flt(rm.rate)
raw_materials_cost += flt(rm.amount) raw_materials_cost += flt(rm.amount)
if self.doctype == "Purchase Receipt": if self.doctype == "Purchase Receipt":