Skip to content

Commit

Permalink
fix: minor changes added
Browse files Browse the repository at this point in the history
(cherry picked from commit ddc0127)
  • Loading branch information
vishdha authored and mergify[bot] committed Jan 20, 2023
1 parent 0035ee2 commit 7fd8cef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def calculate_op_cost(self, update_hour_rate=False):
"""Update workstation rate and calculates totals"""
self.operating_cost = 0
self.base_operating_cost = 0
if (self.get("with_operations")):
if self.get("with_operations"):
for d in self.get("operations"):
if d.workstation:
self.update_rate_and_time(d, update_hour_rate)
Expand All @@ -628,8 +628,10 @@ def calculate_op_cost(self, update_hour_rate=False):
self.operating_cost += flt(operating_cost)
self.base_operating_cost += flt(base_operating_cost)

elif(self.get("fg_based_operating_cost")):
total_operating_cost = flt(self.get("quantity")) * flt(self.get("operating_cost_per_bom_quantity"))
elif self.get("fg_based_operating_cost"):
total_operating_cost = flt(self.get("quantity")) * flt(
self.get("operating_cost_per_bom_quantity")
)
self.operating_cost = total_operating_cost
self.base_operating_cost = flt(total_operating_cost * self.conversion_rate, 2)

Expand Down

0 comments on commit 7fd8cef

Please sign in to comment.