mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
fix: calculate operating cost based on BOM Quantity (#27464)
* fix: calculate operating cost based on BOM Quantity
* fix: added test cases
(cherry picked from commit 2e2985e4f1)
# Conflicts:
# erpnext/manufacturing/doctype/bom/bom.py
# erpnext/manufacturing/doctype/bom/test_bom.py
# erpnext/manufacturing/doctype/bom_operation/bom_operation.json
This commit is contained in:
@@ -621,6 +621,12 @@ class BOM(WebsiteGenerator):
|
|||||||
if d.set_cost_based_on_bom_qty:
|
if d.set_cost_based_on_bom_qty:
|
||||||
operating_cost = flt(d.cost_per_unit) * flt(self.quantity)
|
operating_cost = flt(d.cost_per_unit) * flt(self.quantity)
|
||||||
base_operating_cost = flt(d.base_cost_per_unit) * flt(self.quantity)
|
base_operating_cost = flt(d.base_cost_per_unit) * flt(self.quantity)
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
self.operating_cost += flt(operating_cost)
|
||||||
|
self.base_operating_cost += flt(base_operating_cost)
|
||||||
|
>>>>>>> 2e2985e4f1 (fix: calculate operating cost based on BOM Quantity (#27464))
|
||||||
|
|
||||||
self.operating_cost += flt(operating_cost)
|
self.operating_cost += flt(operating_cost)
|
||||||
self.base_operating_cost += flt(base_operating_cost)
|
self.base_operating_cost += flt(base_operating_cost)
|
||||||
|
|||||||
@@ -140,7 +140,11 @@ class TestBOM(FrappeTestCase):
|
|||||||
for op_row in bom.operations:
|
for op_row in bom.operations:
|
||||||
self.assertAlmostEqual(op_row.cost_per_unit, op_row.operating_cost / 2)
|
self.assertAlmostEqual(op_row.cost_per_unit, op_row.operating_cost / 2)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
self.assertAlmostEqual(bom.operating_cost, op_cost / 2)
|
self.assertAlmostEqual(bom.operating_cost, op_cost / 2)
|
||||||
|
=======
|
||||||
|
self.assertAlmostEqual(bom.operating_cost, op_cost/2)
|
||||||
|
>>>>>>> 2e2985e4f1 (fix: calculate operating cost based on BOM Quantity (#27464))
|
||||||
bom.delete()
|
bom.delete()
|
||||||
|
|
||||||
def test_bom_cost_multi_uom_multi_currency_based_on_price_list(self):
|
def test_bom_cost_multi_uom_multi_currency_based_on_price_list(self):
|
||||||
|
|||||||
@@ -11,7 +11,10 @@
|
|||||||
"col_break1",
|
"col_break1",
|
||||||
"workstation",
|
"workstation",
|
||||||
"time_in_mins",
|
"time_in_mins",
|
||||||
|
<<<<<<< HEAD
|
||||||
"fixed_time",
|
"fixed_time",
|
||||||
|
=======
|
||||||
|
>>>>>>> 2e2985e4f1 (fix: calculate operating cost based on BOM Quantity (#27464))
|
||||||
"costing_section",
|
"costing_section",
|
||||||
"hour_rate",
|
"hour_rate",
|
||||||
"base_hour_rate",
|
"base_hour_rate",
|
||||||
@@ -186,7 +189,11 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2022-08-22 01:18:33.547481",
|
"modified": "2022-08-22 01:18:33.547481",
|
||||||
|
=======
|
||||||
|
"modified": "2021-09-13 16:45:01.092868",
|
||||||
|
>>>>>>> 2e2985e4f1 (fix: calculate operating cost based on BOM Quantity (#27464))
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "BOM Operation",
|
"name": "BOM Operation",
|
||||||
|
|||||||
Reference in New Issue
Block a user