From cd6246c3823c7cb2021c7183739066e2194e1c6a Mon Sep 17 00:00:00 2001 From: "Sigma Dimensions (Yass)" <79010126+myoualid@users.noreply.github.com> Date: Thu, 4 Jan 2024 09:30:27 +0100 Subject: [PATCH] fix cost value calculation when using parent cost --- .../api/cost/calculate_cost_item_resource_value.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py index bace1c6d12..4b85ee8e44 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py @@ -108,7 +108,7 @@ class Usecase: for resource in resources: cost, unit = ifcopenshell.util.resource.get_cost(resource) if not cost: - cost = ifcopenshell.util.resource.get_parent_cost(resource) # Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data. + cost, unit = ifcopenshell.util.resource.get_parent_cost(resource) # Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data. quantity = ifcopenshell.util.resource.get_quantity(resource) if not cost or not quantity: continue @@ -117,4 +117,4 @@ class Usecase: total_cost += cost * quantity if total_cost: cost_value = ifcopenshell.api.run("cost.add_cost_value", self.file, parent=self.settings["cost_item"]) - cost_value.AppliedValue = self.file.createIfcMonetaryMeasure(total_cost) + cost_value.AppliedValue = self.file.createIfcMonetaryMeasure(total_cost) \ No newline at end of file