From 75e50ee082510408ddee90af2c9411f21035a242 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 11 May 2014 12:11:15 +0530 Subject: [PATCH] Fixes for subcontracting --- erpnext/controllers/buying_controller.py | 2 +- .../stock/doctype/purchase_receipt/test_purchase_receipt.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 43276e5977..ad56d8fe94 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -256,7 +256,7 @@ class BuyingController(StockController): rm_supplied_idx += 1 - raw_materials_cost += required_qty * flt(item.rate) + raw_materials_cost += required_qty * flt(bom_item.rate) if self.doctype == "Purchase Receipt": item.rm_supp_cost = raw_materials_cost diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 0aa3accd4a..77de44d021 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -94,8 +94,9 @@ class TestPurchaseReceipt(unittest.TestCase): pr.run_method("calculate_taxes_and_totals") pr.insert() - self.assertEquals(pr.get("purchase_receipt_details")[0].rm_supp_cost, 70000.0) self.assertEquals(len(pr.get("pr_raw_material_details")), 2) + self.assertEquals(pr.get("purchase_receipt_details")[0].rm_supp_cost, 70000.0) + def test_serial_no_supplier(self): pr = frappe.copy_doc(test_records[0])